add support for selective (e.g., "manual") test execution Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/be8c935a Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/be8c935a Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/be8c935a
Branch: refs/heads/master Commit: be8c935a1fc14dbae94196d3599b77d3d14acd6a Parents: 76c1972 Author: Dale LaBossiere <[email protected]> Authored: Tue Aug 30 18:18:33 2016 -0400 Committer: Dale LaBossiere <[email protected]> Committed: Tue Aug 30 18:18:33 2016 -0400 ---------------------------------------------------------------------- build.gradle | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/be8c935a/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 6de05ae..c26ae29 100644 --- a/build.gradle +++ b/build.gradle @@ -271,6 +271,16 @@ def String mkManifestClassPath(Project proj) { return classPathStr } +test { + println "\nHINT: to include tests than **/*Test.class you can: ./gradlew -Ptest.base.pattern='<path-pattern>.class' [project-scope:]test" + println "e.g. ./gradlew -Ptest.base.pattern='**/*TestManual.class' test" + println "e.g. ./gradlew -Ptest.base.pattern='**/MqttOpenTest.class' :connectors:mqtt:test" + println "To force a rerun of previously successful test task you can first specify the 'cleanTest' task" + println "e.g., ./gradlew :connectors:mqtt:cleanTest :connectors:mqtt:test" + println "" + sleep 1 +} + /* Configure subprojects */ subprojects { @@ -338,7 +348,13 @@ subprojects { if(it.path == ":test:fvtiot" || it.path == ":providers:development") { dependsOn ":console:servlets" } - include '**/*Test.class' + + // see HINT in rootProject test task + def test_base_pattern = rootProject.hasProperty('test.base.pattern') + ? rootProject.getProperty('test.base.pattern') + : '**/*Test.class' + + include test_base_pattern systemProperty 'edgent.test.top.dir.file.path', rootProject.projectDir systemProperty 'edgent.test.root.dir', rootProject.projectDir
