szpak / gradle-pitest-plugin

Gradle plugin for PIT Mutation Testing
http://gradle-pitest-plugin.solidsoft.info/
214 stars 58 forks source link

@Option to select tests for PitestTask #143

Closed Vampire closed 4 years ago

Vampire commented 5 years ago

Since Gradle 4.6 you can add custom command-line flags for tasks using the @Option annotation. It would be nice if the PitestTask had such an option like --tests for the Test task, to easily select the tests to run to not have to always run all tests when you are working on something specific.

szpak commented 5 years ago

Last of support for List/SetProperty (explained in #139) makes the implemention of that harder (more "hacky").

szpak commented 5 years ago

I implemented it as:

gw pitets --targetTests com.example.tests.*

which overrides targetTests defined in the project configuration. Does it satisfy your needed?

Vampire commented 5 years ago

Well, I called it --tests to have it consistent with the default Gradle Test task, but --targetTests will probably also do, as long as it works as intended. :-)

Vampire commented 5 years ago

Hm, while thinking about it, for my use-case it would actually be more helpful to be able to (also) set targetClasses, can you do the same for that one please? :-)