Multiple JUnit source sets


(iceberg) #1

Hi.

Just wondering if it’s possible to have multiple directories that have different roots for JUnit tests?

So I would have

src/test/java

for the code in

src/main/java

but I’d like to be able to store tests in a different directory too like

src/other-tests/java

If it’s possible would an example be possible?

Many thanks.


(uklance) #2
sourceSets.test.java {
   srcDir 'src/other-tests/java' 
} 

(iceberg) #3

Thanks Lance! That worked a treat. Appreciate the quick response.