6 messages in com.canoo.lists.webtest[Webtest] Tweaks to Ant Build File to...| From | Sent On | Attachments |
|---|---|---|
| Rex Madden | 11 Apr 2002 09:33 | |
| Dierk König | 12 Apr 2002 07:48 | |
| Eric Pugh | 12 Apr 2002 11:20 | |
| Dierk König | 15 Apr 2002 07:46 | |
| Eric Pugh | 15 Apr 2002 08:17 | |
| Donald Ball | 15 Apr 2002 12:30 |
| Subject: | [Webtest] Tweaks to Ant Build File to easily run singletest![]() |
|---|---|
| From: | Eric Pugh (epu...@upstate.com) |
| Date: | 04/12/2002 11:20:21 AM |
| List: | com.canoo.lists.webtest |
Hi all,
I was trying to change the selfTest build file for my own site, and ran into some oddnesses that I fixed in my version, but might make sense to backport.
One is that the target "main" that you think would be the default, is not. Instead it is CreateSummaryReport. Also, there is no way to run a single test, and then create the report off that. And if you are building a long list of tests to run from main, it helps to be able to be able to dynamically run one.
I have copied below the relavant portions of my ant file. Basically I changed main to be the default target, and made CreateSummaryReport not depend on anyone else. I then added a target singletest that you can call with a test to run: ant -f myfile.xml singletest -Dtestcase=mysingletestcase . I chose the name singletest because that is what the Jakarta Maven project uses as the target for running one test case. If this is a change people want, then I can submit a CVS diff if that is better.
Eric Pugh
<!-- ALL TEST TO BE RUN -->
<target name="main" depends="prepareResultDir, testWorkOrderList,testWorkorderEditPage, testCompoundListPage "> <antcall target="CreateSummaryReport"/> </target>
<!-- SINGLE TEST TO BE RUN --> <!-- run whatever testcase is passed in vid a -Dtestcase=mytest --> <target name="singletest"> <antcall target="${testcase}"/> <antcall target="CreateSummaryReport"/> </target>
<!-- . . . . all the test cases . . . -->
<target name="CreateSummaryReport"> <copy file="${base.dir}/report.css" todir="${resultpath}"/> <copy file="${base.dir}/../info/manual/Services.css" todir="${resultpath}"/> <copy file="${resultpath}/${resultfile}" todir="${base.dir}"/> <tstamp> <format property="report.time" pattern="dd.MM.yyyy hh:mm:ss"/> </tstamp> <ant antfile="${base.dir}/ApplyXSL.xml" target="applySingle"> <!-- report.time already set --> <property name="resultpath" value="${base.dir}"/> <property name="resultfile" value="WebTestReport.xml"/> <property name="resultfile.html" value="TestResultOverview.html"/> <property name="style" value="${base.dir}/WebTestReport.xsl"/> </ant> <move file="${base.dir}/TestResultOverview.html" todir="${resultpath}"/> <delete file="${base.dir}/${resultfile}" /> </target>




