Invoking tests from different sub-projects/modules


(goa) #1

Hi ,

 I have a project structure 

 project
     project-1
     project-2
     project-3

And project contains the build.gradle and settings.gradle. Each of the sub-projects namely project-1, project-2 and project-3 contain only build.gradle. The sub-projects project-1 and project-2 contain the java source files and test files and the sub-project project-3 contains the custom (testng) test framework files which has one TestingApp source file with main method. The project build file contains a task

task test(overwrite: true, type: JavaExec, dependsOn: [testClasses, classes]) {

main 'myframework.TestingApp'
classpath += sourceSets.test.runtimeClasspath

}
But when I run gradle clean test , the test files are not invoked from sub-projects project-1 and project-2.All tests are under src/test/java.
How can I make the test files package available ?
Gradle version is 1.2

Thanks,
Sat