[Webtest] Tweaks to Ant Build File to easily run singletest
Eric Pugh
webtest@lists.canoo.com
Mon, 15 Apr 2002 11:17:56 -0400
I guess maybe what might be nice is: "sample-build.xml" which is one that
is designed to be portable to any project, versus specific to running the
selftest.
I find that having a nice build.xml gets me up and running faster, versus
having to start from scratch. If this sounds like something you would want,
I can take a first cut at one.
Eric
-----Original Message-----
From: Dierk König [mailto:Dierk.Koenig@canoo.com]
Sent: Monday, April 15, 2002 3:47 PM
To: webtest@gate.canoo.com
Subject: RE: [Webtest] Tweaks to Ant Build File to easily run singletest
Hi Eric,
good idea. The selftest needs some brushing up anyways - maybe some
submodules - for it has grown so much over time.
The selftest runs automatically with every new build of webtest. Therefore
the default target should be the one that calls all the tests and produces
the full report.
cheers
Mittie
-----Original Message-----
From: webtest-admin@lists.canoo.com [mailto:webtest-admin@lists.canoo.com]On
Behalf Of Eric Pugh
Sent: Freitag, 12. April 2002 20:21
To: webtest@gate.canoo.com
Subject: [Webtest] Tweaks to Ant Build File to easily run singletest
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>
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest