ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject [AntUnit] Where to put a "dump all log messages" functionality?
Date Wed, 08 Aug 2007 14:15:11 GMT
Hi all,

in order to debug the failing .NET Antlib build in Gump I'd really
need to see the ouput of the nested Ant build (the one executing the
test).

My first reaction was to add a <logdumper/> AntUnitListener which
would dump all log messages created during the test on the endTest
event, but this doesn't look too easy:  AntUnitListeners don't have
access to the log messages and they don't really have access to the
LogCapturer either.

Since AntUnit creates fresh project instances for each target, the
instances passed to startTestSuite and endTestSuite will be different
for any test project with more than one test.  Furthermore the
AntUnitListener doesn't have any way to access the project instance in
any other events than the *TestSuite events since the currently
executing project may be neither the first nor the last test-target.
This means the listener can't get the LogCapturer of the current test.

I see these options:

(1) modifiy AntUnitListener's interface to include the project under
    test in the method signatures.  Doable but breaks any existing
    listener, and there may already be some.

(2) extend AntUnitListener's interface with a method that notifies the
    listener of the current project.  Make AntUnit detect the
    interface and use it where appropriate.  Wouldn't break existing
    listeners but seems a bit heavy.

(3) add the "dump log" functionality to the AntUnit task instead of a
    listener (hence this thread's subject).  This would be pretty easy
    to implement but I don't really think it should go there.

(4) add the ability to add BuildListener implementations as nested
    elements of <antunit> and make them do the logging.  It may even be
    possible to reuse the existing build listeners as nested elements
    of AntUnit that way (they'd only need to be typedef'fed properly).

More ideas?

Stefan

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


Mime
View raw message