[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/avm2 r9742: add test driver.
From: |
rob |
Subject: |
[Gnash-commit] /srv/bzr/gnash/avm2 r9742: add test driver. |
Date: |
Sat, 16 May 2009 12:37:27 -0600 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 9742
committer: address@hidden
branch nick: avm2
timestamp: Sat 2009-05-16 12:37:27 -0600
message:
add test driver.
added:
testsuite/as3/classes.all/classes.exp
=== added file 'testsuite/as3/classes.all/classes.exp'
--- a/testsuite/as3/classes.all/classes.exp 1970-01-01 00:00:00 +0000
+++ b/testsuite/as3/classes.all/classes.exp 2009-05-16 18:37:27 +0000
@@ -0,0 +1,133 @@
+
+load_lib "dejagnu.exp"
+
+
+# If tracing has been enabled at the top level, then turn it on here
+# too.
+if $tracelevel {
+ strace $tracelevel
+}
+
+# After these many seconds of execution the test script is aborted with a
failure.
+# This is to handle deadlocks. We don't reset the timeout when a match is
+# found to avoid hanging in case of a testcase sending matches in an infinite
loops.
+# (not unlikely as it seems, think about flash movies...)
+#
+# Expressed in seconds.
+#
+set timeout 600
+set file all
+set params ""
+
+global env
+set env(LANG) en_US.UTF-8
+set env(LANGUAGE) en_US.UTF-8
+set env(LC_ALL) en_US.UTF-8
+
+set gprocessor [lookfor_file $objdir utilities/gprocessor]
+
+set testcases [glob -nocomplain *.swf]
+
+# testcases is set by the Makefile in the site.exp data file.
+foreach file $testcases {
+
+ verbose "Running test $gprocessor $file"
+
+ # spawn the executable and look for the DejaGnu output messages from the
+ # test case.
+
+ # this version of the call allows use of 'wait' to check return code
+ # -open [open "|cmd" "r"] doesn't work for that
+
+ # Ignore SIGHUP or we'd get a lot of them on Debian stable
+ spawn -noecho -ignore SIGHUP $gprocessor ./$file
+
+ expect {
+ -re "^\[^\n]*NOTE:\[^\n]*\n" {
+ regsub ".*NOTE: " $expect_out(0,string) "" output
+ set output [string range $output 0 end-2]
+ verbose "${file} $output"
+ # notes tipically come from the test runner, so we'll trust it to
mean
+ # things are someone not too bad...
+ # -continue_timer
+ exp_continue
+ }
+ -re "^\[^\n]*XPASSED:\[^\n]*\n" {
+ regsub ".*XPASSED: " $expect_out(0,string) "" output
+ set output [string range $output 0 end-2]
+ xpass "${file}: $output"
+ exp_continue -continue_timer
+ }
+ -re "^\[^\n]*PASSED:\[^\n]*\n" {
+ regsub ".*PASSED: " $expect_out(0,string) "" output
+ set output [string range $output 0 end-2]
+ pass "${file}: $output"
+ exp_continue -continue_timer
+ }
+ -re "^\[^\n]*XFAILED:\[^\n]*\n" {
+ regsub ".*XFAILED: " $expect_out(0,string) "" output
+ set output [string range $output 0 end-2]
+ xfail "${file}: $output"
+ exp_continue -continue_timer
+ }
+ -re "^\[^\n]*FAILED:\[^\n]*\n" {
+ regsub ".*FAILED: " $expect_out(0,string) "" output
+ set output [string range $output 0 end-2]
+ fail "${file}: $output"
+ exp_continue -continue_timer
+ }
+ -re "^\[^\n]*UNTESTED:\[^\n]*\n" {
+ regsub ".*UNTESTED: " $expect_out(0,string) "" output
+ set output [string range $output 0 end-2]
+ untested "${file}: $output"
+ exp_continue -continue_timer
+ }
+ -re "^\[^\n]*UNRESOLVED:\[^\n]*\n" {
+ regsub ".*UNRESOLVED: " $expect_out(0,string) "" output
+ set output [string range $output 0 end-2]
+ unresolved "${file}: $output"
+ exp_continue -continue_timer
+ }
+ -re "^\[^\n]*\n" {
+ # just remove non-matching lines!
+ exp_continue -continue_timer
+ }
+ eof {
+ # unresolved "${file} died prematurely"
+ # catch close
+ # return "${file} died prematurely"
+ }
+ timeout {
+ fail "Test case ${file} still running after ${timeout} seconds,
killing it (deadlock?)"
+ catch close
+ continue;
+ }
+ }
+
+ # wait for the process to coplete to
+ # check return code
+ set retcode [wait]
+
+ # debugging
+ #set i 0; foreach j $retcode { print "${file} wait($i) $j"; incr i }
+
+ # This snippet catches segfaults and aborts.
+ # Would also catch SIGHUP, but we're ignoring them
+ # as on Debian Stable we unexpectedly get them for no apparent reason
+ #
+ if { [ llength $retcode ] > 5 } {
+ fail "${file} died prematurely ([lindex $retcode 6])"
+ }
+
+ # This snippet catches non-zero returns
+ if { [ lindex $retcode 3 ] != 0 } {
+ fail "${file} exited with non-zero code ([lindex $retcode 3])"
+ }
+
+
+
+ # force a close of the executable to be safe.
+ catch close
+}
+
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/avm2 r9742: add test driver.,
rob <=