Created
August 12, 2024 11:53
-
-
Save alexbridge/494198caa434cb1c16a1e250fb3c8d64 to your computer and use it in GitHub Desktop.
Gradle include Test Files or Test methods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useJUnitPlatform { | |
// Include Test Files | |
if (project.hasProperty('includeTestFiles')) { | |
((project.property('includeTestFiles') as String).tokenize(',')).each { | |
include "${it}" | |
} | |
} | |
filter { | |
// Include Test Methods | |
if (project.hasProperty('includeTests')) { | |
((project.property('includeTests') as String).tokenize(',')).each { | |
includeTestsMatching "${it}" | |
} | |
} | |
} | |
} | |
// Usage: | |
// Files: -PincludeTestFiles=**/*Test* | |
// Methods: -PincludeTests=*Test*,*method* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment