ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Arrenbrecht" <peter.arrenbre...@gmail.com>
Subject [junit task] Trying to make the test runner not query test names unless there is a failure
Date Tue, 11 Dec 2007 08:37:49 GMT
Hi all

I am running a suite of some hundreds of thousands of tests. In case
of failure, I want to return a name with lots of context information.
This name, however, is a bit expensive to build. So I don't want it
queried for successful tests.

The current JUnitTask, however, always turns on the test listener,
which in turn logs the names to a dummy output writer:

            runner = delegate.newJUnitTestRunner(test, test.getHaltonerror(),
                                         test.getFiltertrace(),
                                         test.getHaltonfailure(), false,
                                         true, classLoader);

(the second to last argument sets logTestListenerEvents to true).

Why is logTestListenerEvents always true? At least if showOutput is
false, I think one could set it to false. After all, the results
formatters seem to use their own listener.

Thanks for any clarifications,
-peter

ps. A workaround of sorts is to only return full context in toString()
and return a simple name in getName(). But I still would like Ant to
avoid calling getName() when it is not needed.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message