ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject [antunit] included/excluded tests patterns
Date Tue, 26 Sep 2006 21:06:44 GMT
When writing antunit tests, one cannot use the
log-inspection assertions or the new au:logcontent
resource outside the context of an AntUnit test.  This
is understandable/unavoidable, but it does mean that
there are some tests that cannot be developed with
'ant -f ...'.  Obviously you could write new tests in
separate files, but when they share setup with other
tests, that is inconvenient.  I was thinking of adding
a means of [in|ex]cluding tests to be run.  To that
end, it seems like it would be easy to use PatternSets
for this; it also seems like this is the kind of weird
idea I have that scares people, so I'm bringing it up
on the list.

So if file test.xml had tests "testFoo", "testBar",
and "testBaz", you could do things like

<property name="antunit.includetests"
          value="test?*" />
<property name="antunit.excludetests" value="" />
<antunit includetests="${antunit.includetests}"
         excludetests="${antunit.excludetests}">
  <resources refid="testfiles-defined-elsewhere" />
</antunit>

nested includes/excludes could be supported something
like

<antunit>
  <resources refid="testfiles-defined-elsewhere" />
  <testpatterns><!-- here's a nested patternset -->
    <include name="testFoo" />
  </testpatterns>
</antunit>

Hopefully you get the idea.  How crazy is this?  I
recognize the semi-evil of how I specified the default
includes "test?*" above, but that was weighed against
the evil of using "target pinball" to choose one of
two separate <antunit> invocations, and since this is
obviously more of an expert feature I really don't
feel too bad about it.

-Matt

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message