gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash/testsuite libbase/libbase.exp server/serv...


From: Rob Savoye
Subject: [Gnash-commit] gnash/testsuite libbase/libbase.exp server/serv...
Date: Thu, 12 Oct 2006 19:36:24 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    06/10/12 19:36:24

Added files:
        testsuite/libbase: libbase.exp 
        testsuite/server: server.exp 

Log message:
        Initial shot at DejaGnu support for these test cases.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/libbase.exp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/server/server.exp?cvsroot=gnash&rev=1.1

Patches:
Index: libbase/libbase.exp
===================================================================
RCS file: libbase/libbase.exp
diff -N libbase/libbase.exp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libbase/libbase.exp 12 Oct 2006 19:36:24 -0000      1.1
@@ -0,0 +1,87 @@
+
+load_lib "dejagnu.exp"
+
+
+# If tracing has been enabled at the top level, then turn it on here
+# too.
+if $tracelevel {
+    strace $tracelevel
+}
+
+set timeoutmsg "Timed out: Never got started, "
+set timeout 100
+set file all
+set timetol 0
+set params ""
+
+foreach file [glob *Test] {
+    # spawn the executable and look for the DejaGnu output messages from the
+    # test case.
+    spawn -noecho -open [open "|./$file" "r"]
+    expect {
+       -re "\[0-9\]\[0-9\]:..:..:${text}\n" {
+           regsub "\[\n\t\]*NOTE: $text\n" $expect_out(0,string) "" output
+           verbose "$output" 3
+           set timetol 0
+           exp_continue
+       }
+       -re "NOTE:\[^\n]*\n" {
+           regsub "\[\n\t\]*NOTE: " $expect_out(0,string) "" output
+           set output [string range $output 6 end-2]
+           verbose "${file} $output" 2
+           set timetol 0
+           exp_continue
+       }
+       -re "PASSED:\[^\n]*\n" {
+           regsub "\[\n\t\]*PASSED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2]
+           pass "${file}: $output"
+           set timetol 0
+           exp_continue
+       }
+       -re "FAILED:\[^\n\]*\n" {
+           regsub "\[\n\t\]*FAILED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2] 
+           fail "${file}: $output"
+           set timetol 0
+           exp_continue
+       }
+       -re "UNTESTED:\[^\n]*\n" {
+           regsub "\[\n\t\]*TESTED: " $expect_out(0,string) "" output
+           set output [string range $output 8 end-2]
+           untested "${file}: $output"
+           set timetol 0
+           exp_continue
+       }
+       -re "UNRESOLVED:\[^\n]*\n" {
+           regsub "\[\n\t\]*UNRESOLVED: " $expect_out(0,string) "" output
+           set output [string range $output 8 end-2]
+           unresolved "${file}: $output"
+           set timetol 0
+           exp_continue
+       }
+       -re "Totals" {
+           verbose "All done" 2
+       }
+       eof {
+           #       unresolved "${executable} died prematurely"
+           #       catch close
+           #       return "${executable} died prematurely"
+       }
+       timeout {
+           warning "Timed out executing test case"
+           if { $timetol <= 2 } {
+               incr timetol
+               exp_continue
+           } else {
+               -               catch close
+               return "Timed out executing test case"
+           }
+       }
+   }
+
+    # force a close of the executable to be safe.
+    catch close
+}
+
+

Index: server/server.exp
===================================================================
RCS file: server/server.exp
diff -N server/server.exp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ server/server.exp   12 Oct 2006 19:36:24 -0000      1.1
@@ -0,0 +1,87 @@
+
+load_lib "dejagnu.exp"
+
+
+# If tracing has been enabled at the top level, then turn it on here
+# too.
+if $tracelevel {
+    strace $tracelevel
+}
+
+set timeoutmsg "Timed out: Never got started, "
+set timeout 100
+set file all
+set timetol 0
+set params ""
+
+foreach file [glob *Test] {
+    # spawn the executable and look for the DejaGnu output messages from the
+    # test case.
+    spawn -noecho -open [open "|./$file" "r"]
+    expect {
+       -re "\[0-9\]\[0-9\]:..:..:${text}\n" {
+           regsub "\[\n\t\]*NOTE: $text\n" $expect_out(0,string) "" output
+           verbose "$output" 3
+           set timetol 0
+           exp_continue
+       }
+       -re "NOTE:\[^\n]*\n" {
+           regsub "\[\n\t\]*NOTE: " $expect_out(0,string) "" output
+           set output [string range $output 6 end-2]
+           verbose "${file} $output" 2
+           set timetol 0
+           exp_continue
+       }
+       -re "PASSED:\[^\n]*\n" {
+           regsub "\[\n\t\]*PASSED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2]
+           pass "${file}: $output"
+           set timetol 0
+           exp_continue
+       }
+       -re "FAILED:\[^\n\]*\n" {
+           regsub "\[\n\t\]*FAILED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2] 
+           fail "${file}: $output"
+           set timetol 0
+           exp_continue
+       }
+       -re "UNTESTED:\[^\n]*\n" {
+           regsub "\[\n\t\]*TESTED: " $expect_out(0,string) "" output
+           set output [string range $output 8 end-2]
+           untested "${file}: $output"
+           set timetol 0
+           exp_continue
+       }
+       -re "UNRESOLVED:\[^\n]*\n" {
+           regsub "\[\n\t\]*UNRESOLVED: " $expect_out(0,string) "" output
+           set output [string range $output 8 end-2]
+           unresolved "${file}: $output"
+           set timetol 0
+           exp_continue
+       }
+       -re "Totals" {
+           verbose "All done" 2
+       }
+       eof {
+           #       unresolved "${executable} died prematurely"
+           #       catch close
+           #       return "${executable} died prematurely"
+       }
+       timeout {
+           warning "Timed out executing test case"
+           if { $timetol <= 2 } {
+               incr timetol
+               exp_continue
+           } else {
+               -               catch close
+               return "Timed out executing test case"
+           }
+       }
+   }
+
+    # force a close of the executable to be safe.
+    catch close
+}
+
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]