Update with current status
[gnash.git] / testsuite / swfdec / gen_run_swfdec_testsuite.sh
blob8e496926eae2b1ca769310de60f39213dcbeae53
1 #"
2 # Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #!/bin/sh -x
21 if [ -z "$3" ]; then
22 echo "Usage: `basename %0` <gnash_builddir> <gnash_srcdir> <swfdec_tracedir> [<startingcharacters>]" >&2
23 exit 1
26 BUILDDIR="$1"
27 SRCDIR="$2"
28 SWFDECTRACEDIR="$3"
29 STARTPATTERN="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
30 if [ -n "$4" ]; then
31 STARTPATTERN="$4"
33 NOW=`date`
34 if [ -x /bin/md5 ]; then
35 MD5="md5"
36 CUT="4"
37 else
38 MD5="md5sum"
39 CUT="1"
42 GPROCESSOR="${BUILDDIR}/utilities/gprocessor"
43 GNASHRC="${BUILDDIR}/testsuite/gnashrc"
44 GNASH_PLAYER="${BUILDDIR}/gui/gnash"
45 SWFDEC_GNASH_TESTER="${SRCDIR}/swfdec_gnash_tester"
47 cat<<EOF
48 #!/bin/sh
50 # TODO: fix predictability
51 # see http://wiki.gnashdev.org/PredictableLoading
53 # Generated by gen_run_swfdec_testsuite.sh on
54 # $NOW
56 # The trace output of the Date object in the testsuite has timezone as GMT.
57 export TZ=GMT
58 export GNASHRC=${GNASHRC}
59 export GPROCESSOR=${GPROCESSOR}
60 EXPECTPASS=${SRCDIR}/PASSING
61 REALTIME=${SRCDIR}/REALTIME
63 for test in \`ls ${SWFDECTRACEDIR}/[$STARTPATTERN]*.swf\`; do
64 testname=\`basename \${test}\`
65 md5=\`$MD5 \${test} | cut -d' ' -f$CUT\`
66 testid="\${testname}:\${md5}"
68 if [ -f \${test}.act ]; then
69 echo "NOTE: skipping \${testname} (unsupported user interaction)"
70 echo "UNTESTED: \${testid} (requires unsupported user interaction)"
71 continue
74 usedtopass=no
75 expectpass=no
76 expectpasslabel=no
77 if grep -q "^\${testid}\$" \${EXPECTPASS}; then
78 expectpass="yes"
79 expectpasslabel=yes
80 else
81 if grep -q "^\${testname}:" \${EXPECTPASS}; then
82 usedtopass="yes"
83 expectpasslabel="not anymore"
84 else
85 expectpasslabel=no
88 flags=
89 if grep -q "^\${testname}\$" \${REALTIME}; then
90 flags="-d -1"
91 echo "NOTE: running \${testname} (realtime - expect pass: \${expectpasslabel})"
92 else
93 echo "NOTE: running \${testname} (expect pass: \${expectpasslabel})"
96 ${SWFDEC_GNASH_TESTER} \${test} \${flags} > \${testname}.log
97 ret=\$?
98 #echo "NOTE: ${SWFDEC_GNASH_TESTER} \${test} returned \$ret"
99 if [ \$ret -eq 0 ]; then
100 if [ "\${expectpass}" = "yes" ]; then
101 echo "PASSED: \${testid}"
102 else
103 echo "XPASSED: \${testid}"
105 elif [ \$ret -eq 1 ]; then
106 if [ "\${expectpass}" = "yes" ]; then
107 echo "FAILED: \${testid} (traces in \${testname}.trace-gnash, log in \${testname}.log)"
108 else
109 if [ "\${usedtopass}" = "yes" ]; then
110 echo "XFAILED: \${testid} (USED TO PASS! traces in \${testname}.trace-gnash, log in \${testname}.log)"
111 else
112 echo "XFAILED: \${testid} (traces in \${testname}.trace-gnash, log in \${testname}.log)"
115 else
116 echo "FAILED: \${testid} crashed gnash (stdout in \${testname}.out, stderr in \${testname}.err)"
118 done