Gradle as test reporting tool


(Binh Nguyen) #1

Is there a way to use Graddle run tests from a jar? Basically, I am using Graddle to pull a bunch of jars from Ivy, then run tests on these jars.

Thanks


(Peter Niederwieser) #2

It should work if you extract the Jar and set ‘Test.testClassesDir’ accordingly.


(Binh Nguyen) #3

Can I do this:

task runClientTest(type: Test, dependsOn: setupJars) {
     testClassesDir = file( 'dist')
}

Or I have to set testClassesDir somewhere else?

Thanks


(Peter Niederwieser) #4

Check the DSL reference for the ‘Test’ task type. The ‘testClassesDir’ property has type ‘File’.


(Binh Nguyen) #5

I tried

Test.testClassesDir = File('dist')

but it doesn’t work. Do you have an example showing how it work exactly?

Thanks a lot,


(Peter Niederwieser) #6

Your previous, updated post already shows the solution.