On 12/05/2011, at 1:51 AM, Brett Cave wrote: > Would it be possible (how would I... ) use gradle to run JUnit tests? The > primary reason for this is for pre-deploy integration tests outside of build > environment. I have configured a project to package all the dependencies to > run stand-alone integration testing, and would like to have consistency in > the reporting provided by gradle in build-time unit / component testing. > > My current methodology for this is to compile and archive main and test > classes and then run by calling org.junit.runner.JUnitCore. Ideally, I > wouldn't want to have environment dependencies on gradle in environments > other than build (i.e. a method of doing this will a fully portable test > suite).
Why is that? We might be able to do something to address your concerns. We would encourage people to consider Gradle no just for building, but for other types of automation too. It's unlikely that we will split out the test reporting into something that can be used outside Gradle. This is because the reporting is (intentionally) pretty tightly tied to the output of Gradle's test execution code. And that, in turn, is pretty tightly coupled to the Gradle infrastructure. It's certainly possible to do it, but not something we plan to do at this stage. It is, however, easy to use the Test task type without using the Java plugin, so you could put together a Gradle project which simply defines a test task. Or you could just add another Test instance to an existing project. -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com
