harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Loenko <mloe...@gmail.com>
Subject Re: [classlib] Unit and performance testing
Date Wed, 25 Jan 2006 11:48:03 GMT
One more reason when logs are necessary:

If testing is possible in some configurations only
(like set of providers contains something or default encoding is ...), then
1) build failing in all different configs would be annoying
2) One has to be able to scan logs for warnings to verify that
functionality is tested
when the config is as expected

A different exit status for the tests that can test in the given
configuration would
help.

Thanks,
Mikhail

On 1/25/06, Anton Avtamonov <anton.avtamonov@gmail.com> wrote:
> On 1/25/06, Thorbjørn Ravn Andersen <thunderaxiom@gmail.com> wrote:
> > Mikhail Loenko wrote:
> >
> > > fail() is not always convinient, for example, how would you print
> > >
> > >stack trace to fail()? Meanwhile stacktrace is most often enough
> > >
> > >
> > If you need a stacktrace, why not just throw a RuntimeException at that
> > point?  JUnit will then include the stack trace in the report.
> >
> > --
> > Thorbjørn
> >
>
> Absolutely agree
> As I know 'standard' test case signature is:
>
> public void testSomeTestName() throws Exception {
> }
>
> So that all checked and runtime exceptions are passed directly to
> JUnit framework (which properly logs them).
>
> I do beleive logging is very useful feature. However I think that the
> preferrable place to do logging is code rather than tests. JUnit
> provides lots of fucntionality to write well-documented tests and we
> don't have to add extra-code for logging (which obviously made test
> cases longer and harder for understanding).
>
> I beleive the right place to use logging are try/catch sections where
> catch does nothing (the most ususal case), so that we just silently
> ignore some error situations. Having logs there will allow us to
> understand the system execution paths and what was going wrong and
> where. For such purpose different logging levels work really fine.
>
> --
> Anton Avtamonov,
> Intel Managed Runtime Division
>

Mime
View raw message