Skip to content

Commit

Permalink
merge origin/main
Browse files Browse the repository at this point in the history
  • Loading branch information
compscidr committed May 12, 2023
2 parents d0928f5 + 30676cf commit e05bb05
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,32 @@ android {
//excludeTags 'TEST2'
}
}
// should let the tests run with with gradle via -DincludeTags="tag1,tag2" -DexcludeTags="tag3,tag4"
// https://github.com/mannodermaus/android-junit5/wiki/Configuration
// https://junit.org/junit5/docs/current/user-guide/#writing-tests-tagging-and-filtering
// https://www.vogella.com/tutorials/AndroidTesting/article.html
junitPlatform {
String includedTagsProperty = System.getProperty("includeTags")
boolean includedTagsPropertySet = includedTagsProperty != null

String excludedTagsProperty = System.getProperty("excludeTags")
boolean excludedTagsPropertySet = excludedTagsProperty != null

if (includedTagsPropertySet && excludedTagsPropertySet) {
filters("debug") {
includeTags includedTagsProperty
excludeTags excludedTagsProperty
}
} else if (includedTagsPropertySet && !excludedTagsPropertySet) {
filters("debug") {
includeTags includedTagsProperty
}
} else if (!includedTagsPropertySet && excludedTagsPropertySet) {
filters("debug") {
excludeTags excludedTagsProperty
}
}
}
}
}

Expand Down

0 comments on commit e05bb05

Please sign in to comment.