@@ -20,12 +20,15 @@
<!-- this property can be overriden programatically in the Java test case -->
<!-- this property can be overriden programatically in the Java test case -->
<property name="timeToWait" value="10"/>
<property name="timeToWait" value="10"/>
<!-- this property can be overriden programatically in the Java test case -->
<!-- this property can be overriden programatically in the Java test case -->
<property name="logFile" value="${java.io.tmpdir}/spawn.log"/>
<property name="output" location="${java.io.tmpdir}/testoutput"/>
<mkdir dir="${output}"/>
<property name="logFile" value="${output}/spawn.log"/>
<property environment="env"/>
<property environment="env"/>
<!-- UNIX -->
<!-- UNIX -->
<available file="sh" filepath="${env.PATH}" property="sh.executable"/>
<available file="sh" filepath="${env.PATH}" property="sh.executable"/>
<!-- CYGWIN -->
<!-- CYGWIN -->
<available file="sh.exe" filepath="${env.PATH}" property="sh.exe.executable"/>
<available file="sh.exe" filepath="${env.PATH}" property="sh.exe.executable"/>
<property name="test.can.run" value="1"/>
<condition property="test.can.run">
<condition property="test.can.run">
<or>
<or>
<isset property="sh.executable"/>
<isset property="sh.executable"/>
@@ -42,7 +45,25 @@
</exec>
</exec>
</target>
</target>
<target name="test-out-and-err" description="see https://issues.apache.org/bugzilla/show_bug.cgi?id=50507" depends="init" if="test.can.run">
<mkdir dir="${output}" />
<ant antfile="blabla.xml" output="${output}/test-out-and-err.txt">
</ant>
<loadfile srcfile="${output}/test-out-and-err.txt" property="test-out-and-err">
<filterchain>
<replaceregex pattern="^\s*\[exec\] some blablablablablablablablablablablabla error message err$" flags="m" />
<replaceregex pattern="^\s*\[exec\] some blablablablablablablablablablablabla info message out$" flags="m" />
</filterchain>
</loadfile>
<echo>${test-out-and-err}</echo>
<fail message="output indicates a mixup of out and err">
<condition>
<contains string="${test-out-and-err}" substring="[exec]" />
</condition>
</fail>
</target>
<target name="cleanup">
<target name="cleanup">
<delete file="${logFile}" />
</target>
</target>
</project>
</project>