Update with current status
[gnash.git] / testsuite / simultaneous-testrunner.sh
blob51950e15c230e32957ac48213bf7a8fca96e43d9
1 #!/bin/sh
3 #
4 # Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 while getopts c:C: name; do
21 case $name in
22 c) endtagpat="$OPTARG" ;;
23 C) endtagpat="$OPTARG"; endtagexp=X ;;
26 echo "Usage: $0 [-r <runs>] [-f <advances>] [-c <string>] <swf> ..."
27 echo " -c <pattern> : verify that the test ends with a trace "
28 echo " matching <pattern>, or print a failure"
29 echo " -C <pattern> : same as -c <pattern> but a failure is "
30 echo " expected"
31 } >&2
32 exit 1;;
33 esac
34 done
35 shift $(($OPTIND - 1))
38 top_builddir=$1
39 shift
40 t1=$1
41 shift
42 t2=$1
45 echo "#!/bin/sh"
46 echo
48 echo "# Environment"
49 env | grep GNASH | while read REPLY; do
50 echo "export ${REPLY}"
51 done
53 timeout=40
54 cat << EOF
56 outlog1=${top_builddir}/testoutlog.\$$
57 outlog2=${top_builddir}/testoutlog2.\$$
59 echo "Running first process"
60 ${top_builddir}/gui/gnash -vvv -r0 ${t1} -t ${timeout} | tee \${outlog1} &
61 echo "Running second process"
62 ${top_builddir}/gui/gnash -vvv -r0 ${t2} -t ${timeout} | tee \${outlog2} &
63 wait
65 for log in \${outlog1} \${outlog2}; do
66 if test "x${endtagpat}" != x; then
67 lasttrace=\`grep TRACE \$log | tail -1 | sed 's/.*TRACE: //'\`
68 if ! expr "\${lasttrace}" : '${endtagpat}' > /dev/null; then
69 echo "${endtagexp}FAILED: consistency check: last trace from run of test \${t} (\${lasttrace}) doesn't match pattern (${endtagpat})"
70 else
71 echo "${endtagexp}PASSED: consistency check: last trace from run of test \${t} (\${lasttrace}) matches pattern (${endtagpat})"
74 rm \$log
75 done
76 EOF