ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Cuthbert <bencuthb...@me.com>
Subject Re: Build fail
Date Tue, 24 Nov 2009 10:28:51 GMT
Strange if i put in the changes as you suggested it does not even execute my targets. If I
run the following on the command line

ant build -Dunit.test=true

 
On Monday, November 23, 2009, at 09:52PM, "glenn opdycke-hansen" <glennoph@gmail.com>
wrote:
>I agree that there is nothing obviously incorrect.  However, do you run unit
>tests and acceptance tests at the same time?
>If so then there is a potential problem that the script will run the unit
>tests then the acceptance tests then check the properties.
>I suggest that the <if><then> not be used, instead have the test target
>depend on targets for unit test and acceptance test.  Each of the new tasks
>should check the tests.* properties.  I do not use <if><then>.  Some would
>argue that it should not be used in Ant.  Do you know if properties set in
><if><then> will be present to the parent?
>
>The script would look something like this:
>
>       <target name="test" description="Runmning unit tests"
>depends="test-unit,test-acceptance">
>       </target>
>
>       <target name="test-unit" if="${unit.test}">
>           <echo message="running unit tests for project ${module}" />
>
>           <junit haltonfailure="no" haltonerror="no"
>failureproperty="tests.failures" errorproperty="tests.errors">
>
>               <classpath>
>                   <path refid="classpath.test" />
>            </classpath>
>
>            <formatter type="brief" usefile="false" />
>
>            <batchtest fork="yes">
>                <fileset dir="${src.tests}">
>                    <include name="**/*UnitTestCase.java" />
>                </fileset>
>            </batchtest>
>            </junit>
>
>            <fail if="tests.errors" message="Test errors!!!"  />
>            <fail if="tests.failures"  message="Test failed!!!"/>
>
>       </target>
>
>       <target name="test-acceptance" if="${acceptance.test}">
>           <echo message="running acceptence tests for ${module}" />
>
>           <junit haltonfailure="no" haltonerror="no"
>failureproperty="tests.failures" errorproperty="tests.errors">
>
>               <classpath>
>                <path refid="classpath.test" />
>            </classpath>
>
>            <formatter type="brief" usefile="false" />
>
>            <batchtest fork="yes">
>                <fileset dir="${src.tests}">
>                    <include name="**/*AcceptenceTestCase.java" />
>                </fileset>
>            </batchtest>
>            </junit>
>
>            <fail if="tests.errors" message="Test errors!!!"  />
>            <fail if="tests.failures"  message="Test failed!!!"/>
>
>       </target>
>
>

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


Mime
View raw message