We use function tests in a java project that we run with junit and gradle. They take some time. Several minutes per test and we have 200. The test output looks something like this:
TEST testname1(location) PASSED/FAILED
TEST testname2(location) PASSED/FAILED
So when we look at the log we don’t know if it was test1 or test2 that took time. Is it possible to add a timestamp to the gradle output?
datetime: TEST testname1(location) PASSED/FAILED
datetime: TEST testname2(location) PASSED/FAILED
And also is it possible to write testname before we know if the test passes or failes? So if a test hangs we will see which test that is hanging?
The new test logging feature in Gradle 1.1 will help you with this. You can already try 1.1-rc-2 today.
The other options is to implement and register a custom
org.gradle.api.tasks.testing.TestListener. See the java/testListener sample in the full Gradle distribution.