summaryrefslogtreecommitdiffstats
path: root/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec')
-rw-r--r--framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/blabla.sh24
-rw-r--r--framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/blabla.xml19
-rw-r--r--framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/exec.xml69
-rw-r--r--framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/parrot.sh19
-rw-r--r--framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/spawn.sh29
5 files changed, 160 insertions, 0 deletions
diff --git a/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/blabla.sh b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/blabla.sh
new file mode 100644
index 00000000..c996d6af
--- /dev/null
+++ b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/blabla.sh
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+echo "some blablablablablablablablablablablabla error message" err>&2
+echo "some blablablablablablablablablablablabla info message" out
+echo "some blablablablablablablablablablablabla error message" err>&2
+echo "some blablablablablablablablablablablabla info message" out
+echo "some blablablablablablablablablablablabla error message" err>&2
+echo "some blablablablablablablablablablablabla info message" out
+echo "some blablablablablablablablablablablabla error message" err>&2
+echo "some blablablablablablablablablablablabla info message" out
+echo "some blablablablablablablablablablablabla error message" err>&2
+echo "some blablablablablablablablablablablabla info message" out
diff --git a/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/blabla.xml b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/blabla.xml
new file mode 100644
index 00000000..3b13195f
--- /dev/null
+++ b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/blabla.xml
@@ -0,0 +1,19 @@
+<project name="blabla" default="doit">
+ <target name="blabla">
+ <exec executable="sh">
+ <arg value="blabla.sh" />
+ </exec>
+ </target>
+ <target name="doit">
+ <antcall target="blabla"/>
+ <antcall target="blabla"/>
+ <antcall target="blabla"/>
+ <antcall target="blabla"/>
+ <antcall target="blabla"/>
+ <antcall target="blabla"/>
+ <antcall target="blabla"/>
+ <antcall target="blabla"/>
+ <antcall target="blabla"/>
+ <antcall target="blabla"/>
+ </target>
+</project>
diff --git a/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/exec.xml b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/exec.xml
new file mode 100644
index 00000000..20e56565
--- /dev/null
+++ b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/exec.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project name="exec-test" default="spawn" basedir=".">
+ <import file="../../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}"/>
+ <!-- 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="${output}/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"/>
+ <!-- WINDOWS + 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="setUp" if="test.can.run">
+ <exec executable="sh" spawn="true">
+ <arg value="spawn.sh"/>
+ <arg value="${timeToWait}"/>
+ <arg value="${logFile}"/>
+ </exec>
+ </target>
+
+ <target name="test-out-and-err" description="see https://issues.apache.org/bugzilla/show_bug.cgi?id=50507"
+ depends="setUp" 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>
+ <fail message="output indicates a mixup of out and err: '${test-out-and-err}'">
+ <condition>
+ <contains string="${test-out-and-err}" substring="[exec]"/>
+ </condition>
+ </fail>
+
+ </target>
+
+</project>
diff --git a/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/parrot.sh b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/parrot.sh
new file mode 100644
index 00000000..2467f23a
--- /dev/null
+++ b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/parrot.sh
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+for arg in "$@" ; do
+ echo $arg out
+ sleep 1
+ echo $arg err>&2
+done
diff --git a/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/spawn.sh b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/spawn.sh
new file mode 100644
index 00000000..2cf0631d
--- /dev/null
+++ b/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/exec/spawn.sh
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+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