You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by an...@apache.org on 2003/07/28 15:38:09 UTC
cvs commit: ant/src/etc/testcases/taskdefs/exec exec.xml spawn.sh
antoine 2003/07/28 06:38:09
Added: src/etc/testcases/taskdefs/exec exec.xml spawn.sh
Log:
new files for tests of the exec task
Revision Changes Path
1.1 ant/src/etc/testcases/taskdefs/exec/exec.xml
Index: exec.xml
===================================================================
<project name="exec-test" default="spawn" basedir=".">
<target name="init">
<!-- this property can be overriden programatically in the Java test case -->
<property name="timeToWait" value="10"/>
<!-- this property can be overriden programatically in the Java test case -->
<property name="logFile" value="/tmp/spawn.log"/>
<property environment="env"/>
<!-- UNIX -->
<available file="sh" filepath="${env.PATH}" property="sh.executable"/>
<!-- CYGWIN -->
<available file="sh.exe" filepath="${env.PATH}" property="sh.exe.executable"/>
<condition property="test.can.run">
<or>
<isset property="sh.executable"/>
<isset property="sh.exe.executable"/>
</or>
</condition>
</target>
<target name="spawn" depends="init" if="test.can.run">
<exec executable="sh" spawn="true">
<arg value="spawn.sh"/>
<arg value="${timeToWait}" />
<arg value="${logFile}" />
</exec>
</target>
<target name="cleanup">
<delete file="${logFile}"/>
</target>
</project>
1.1 ant/src/etc/testcases/taskdefs/exec/spawn.sh
Index: spawn.sh
===================================================================
sleeptime=10
logfile=spawn.log
if [ $# -ge 1 ]; then
sleeptime=$1
echo $sleeptime
fi
if [ $# -ge 2 ]; then
logfile=$2
echo $logfile
fi
echo hello
rm $logfile
sleep $sleeptime
echo bye bye > $logfile
echo bye bye
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org