You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Pa...@nokia.com on 2007/06/04 13:20:53 UTC

Seeing log output when running tests with AntUnit

Hello,

I've been trying to use AntUnit and cannot see a way to view the typical
Ant output of the Ant targets being tested. The only output is that
which AntUnit generates, describing the tests executed, etc. If a test
fails it is important to view the log of the steps that happened.

Can anyone suggest how AntUnit is expected to be used to access this
logging information?

Thanks

paul

Re: Seeing log output when running tests with AntUnit

Posted by Steve Loughran <st...@apache.org>.
Paul.Mackay@nokia.com wrote:
>  >It's being saved to a log where you can make assertions about 
>> output text, using <au:assertLogContains> assertion, which 
>> itself uses the the <au:logContains> condition
> 
> How would I print the content of that log?
> 
>> Maybe we could tweak antunit also print the buffer on an 
>> assertion failure, but generally I just run the target by hand 
>> when I want to see the output.
> 
> My issue is that from the test target I get this output:
> 
>   [antunit] Target: test-foo  caused an ERROR
>   [antunit]     at line 9, column 15
>   [antunit]     Message: condition satisfied
>   [antunit]     took 0.031 sec
> 
> The test has a complex condition in it, it would be useful to get more
> output on what the condition evaluation is.
> 

well, find the file and go

ant test-foo -v

-steve



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


RE: Seeing log output when running tests with AntUnit

Posted by Matt Benson <gu...@yahoo.com>.
--- Paul.Mackay@nokia.com wrote:

>  >It's being saved to a log where you can make
> assertions about 
> >output text, using <au:assertLogContains>
> assertion, which 
> >itself uses the the <au:logContains> condition
> 
> How would I print the content of that log?
> 
> >Maybe we could tweak antunit also print the buffer
> on an 
> >assertion failure, but generally I just run the
> target by hand 
> >when I want to see the output.
> 
> My issue is that from the test target I get this
> output:
> 
>   [antunit] Target: test-foo  caused an ERROR
>   [antunit]     at line 9, column 15
>   [antunit]     Message: condition satisfied
>   [antunit]     took 0.031 sec
> 
> The test has a complex condition in it, it would be
> useful to get more
> output on what the condition evaluation is.
> 

Suggestions:
  1.  make use of au:assertTrue's message attribute.
  2.  decompose your condition as much as possible
(replace <and>s with multiple assertions).

HTH,
Matt

P.S. these really seem like questions for the user
list.  :|

> paul
> >-----Original Message-----
> >From: ext Steve Loughran [mailto:stevel@apache.org]
> 
> >Sent: Monday, June 04, 2007 4:44 AM
> >To: Ant Developers List
> >Subject: Re: Seeing log output when running tests
> with AntUnit
> >
> >Paul.Mackay@nokia.com wrote:
> >> Hello,
> >> 
> >> I've been trying to use AntUnit and cannot see a
> way to view the 
> >> typical Ant output of the Ant targets being
> tested. The only 
> >output is 
> >> that which AntUnit generates, describing the
> tests executed, 
> >etc. If a 
> >> test fails it is important to view the log of the
> steps that 
> >happened.
> >> 
> >> Can anyone suggest how AntUnit is expected to be
> used to access this 
> >> logging information?
> >> 
> >> Thanks
> >> 
> >> paul
> >> 
> >
> >It's being saved to a log where you can make
> assertions about 
> >output text, using <au:assertLogContains>
> assertion, which 
> >itself uses the the <au:logContains> condition
> >
> >Maybe we could tweak antunit also print the buffer
> on an 
> >assertion failure, but generally I just run the
> target by hand 
> >when I want to see the output.
> >
> >
> >-steve
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org For 
> >additional commands, e-mail:
> dev-help@ant.apache.org
> >
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 



       
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  

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


RE: Seeing log output when running tests with AntUnit

Posted by Pa...@nokia.com.
 >It's being saved to a log where you can make assertions about 
>output text, using <au:assertLogContains> assertion, which 
>itself uses the the <au:logContains> condition

How would I print the content of that log?

>Maybe we could tweak antunit also print the buffer on an 
>assertion failure, but generally I just run the target by hand 
>when I want to see the output.

My issue is that from the test target I get this output:

  [antunit] Target: test-foo  caused an ERROR
  [antunit]     at line 9, column 15
  [antunit]     Message: condition satisfied
  [antunit]     took 0.031 sec

The test has a complex condition in it, it would be useful to get more
output on what the condition evaluation is.

paul
>-----Original Message-----
>From: ext Steve Loughran [mailto:stevel@apache.org] 
>Sent: Monday, June 04, 2007 4:44 AM
>To: Ant Developers List
>Subject: Re: Seeing log output when running tests with AntUnit
>
>Paul.Mackay@nokia.com wrote:
>> Hello,
>> 
>> I've been trying to use AntUnit and cannot see a way to view the 
>> typical Ant output of the Ant targets being tested. The only 
>output is 
>> that which AntUnit generates, describing the tests executed, 
>etc. If a 
>> test fails it is important to view the log of the steps that 
>happened.
>> 
>> Can anyone suggest how AntUnit is expected to be used to access this 
>> logging information?
>> 
>> Thanks
>> 
>> paul
>> 
>
>It's being saved to a log where you can make assertions about 
>output text, using <au:assertLogContains> assertion, which 
>itself uses the the <au:logContains> condition
>
>Maybe we could tweak antunit also print the buffer on an 
>assertion failure, but generally I just run the target by hand 
>when I want to see the output.
>
>
>-steve
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For 
>additional commands, e-mail: dev-help@ant.apache.org
>
>

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


Re: Seeing log output when running tests with AntUnit

Posted by Steve Loughran <st...@apache.org>.
Paul.Mackay@nokia.com wrote:
> Hello,
> 
> I've been trying to use AntUnit and cannot see a way to view the typical
> Ant output of the Ant targets being tested. The only output is that
> which AntUnit generates, describing the tests executed, etc. If a test
> fails it is important to view the log of the steps that happened.
> 
> Can anyone suggest how AntUnit is expected to be used to access this
> logging information?
> 
> Thanks
> 
> paul
> 

It's being saved to a log where you can make assertions about output 
text, using <au:assertLogContains> assertion, which
itself uses the the <au:logContains> condition

Maybe we could tweak antunit also print the buffer on an assertion 
failure, but generally I just run the target by hand when I want to see 
the output.


-steve

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