Skip to content

Support --test parameter in gradle nativeTest target #476

@cschuyle

Description

@cschuyle

Is your feature request related to a problem? Please describe.

I'd like to be able to run only certain tests from the gradle nativeTest target, in the same way as gradle test --tests 'testPattern' (gradle test filtering) works.

Please make sure that you are using the latest plugin version, and that similar feature hasn't been requested before.

native-build-tools version 0.9.23
gradle versions tried:

  • 8.2.1
  • 7.6

Describe the solution you'd like

When executing the gradle nativeTest target --tests PATTERN, the test runner should run only tests whose method name matches PATTERN, following the same specification as the gradle test target does as documented in the Gradle Test Filtering docs:
https://docs.gradle.org/current/userguide/java_testing.html#test_filtering

Describe alternatives you've considered
I've resorted to commenting-out the unwanted tests.

Note that I have successfully configured the test filter in build.gradle. The following works fine, and only runs the TestClass.testMethod test:

test {
    filter {
        //include specific method in any of the tests
        includeTestsMatching "*TestClass.testMethod"
    }
}

I'm logging this issue because it'd be convenient for the command line option to work as well.

Additional context
none

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgradle-pluginRelated to Gradle pluginjunit-supportRelated to JUnit Support project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions