Some more tests (minor)
[gnash.git] / testsuite / simultaneous-testrunner.sh
blobdc089c14f9d1bf0eb214919fea83fb17edf42021
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 -v -r0 ${t1} -t ${timeout} > \${outlog1}
61 cat \${outlog1}
62 if test "x${endtagpat}" != x; then
63 lasttrace=\`grep TRACE \${outlog1} | tail -1 | sed 's/.*TRACE: //'\`
64 if ! expr "\${lasttrace}" : '${endtagpat}' > /dev/null; then
65 echo "${endtagexp}FAILED: consistency check: last trace from run of test \${t} (\${lasttrace}) doesn't match pattern (${endtagpat})"
66 else
67 echo "${endtagexp}PASSED: consistency check: last trace from run of test \${t} (\${lasttrace}) matches pattern (${endtagpat})"
70 rm \${outlog1}
71 ) &
73 echo "Running second process"
74 ${top_builddir}/gui/gnash -v -r0 ${t2} -t ${timeout} > \${outlog2}
75 cat \${outlog2}
76 if test "x${endtagpat}" != x; then
77 lasttrace=\`grep TRACE \${outlog2} | tail -1 | sed 's/.*TRACE: //'\`
78 if ! expr "\${lasttrace}" : '${endtagpat}' > /dev/null; then
79 echo "${endtagexp}FAILED: consistency check: last trace from run of test \${t} (\${lasttrace}) doesn't match pattern (${endtagpat})"
80 else
81 echo "${endtagexp}PASSED: consistency check: last trace from run of test \${t} (\${lasttrace}) matches pattern (${endtagpat})"
84 rm \${outlog2}
86 EOF