gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9736: rename file.


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9736: rename file.
Date: Sun, 16 Nov 2008 16:16:27 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9736
committer: address@hidden
branch nick: rtmp
timestamp: Sun 2008-11-16 16:16:27 -0700
message:
  rename file.
renamed:
  cygnal/testsuite/simple.exp => cygnal/testsuite/cygnal.exp
modified:
  cygnal/testsuite/cygnal.exp
=== renamed file 'cygnal/testsuite/simple.exp' => 'cygnal/testsuite/cygnal.exp'
--- a/cygnal/testsuite/simple.exp       2007-12-11 03:23:01 +0000
+++ b/cygnal/testsuite/cygnal.exp       2008-11-16 23:16:27 +0000
@@ -16,93 +16,165 @@
 set file all
 set params ""
 
+set cport 80
+set chost "localhost"
+
+proc create_file { name contents } {
+    verbose "Trying to create $name"
+    set fd [ open $name "w" ]
+    puts -nonewline $fd $contents
+    catch "close -i $fd"
+}
+
+#
+# Send something to the copy of Cygnal we started
+proc netcat { name } {
+    global chost
+    global cport
+    verbose "Trying to send $name to Cygnal $chost : $cport)"
+    spawn -noecho nc -q 10 $chost $cport
+    set nid $spawn_id
+    expect {
+       eof {
+           verbose "Netcat all done..."
+       }
+       timeout {
+           verbose "Netcat still running after ${timeout} seconds, killing it 
(deadlock?)"
+               catch close
+               continue;
+       }
+    }
+#verbose "Started NetCat $netcat -q 10"
+    
+}
+
+set data "GET /index.html HTTP/1.0
+Host: localhost:4080
+Accept: text/html, text/plain, text/css, text/sgml, */*;q=0.01
+Accept-Encoding: gzip, bzip2
+Accept-Language: en
+User-Agent: DejaGnu 1.x
+"
+
+create_file "foo" $data
+
+set server "/usr/local/bin/cygnal"
+spawn -noecho $server -p 4000 -vv -n
+set sid $spawn_id
+
+set netcat "netcat"
+#set nid [spawn -noecho $netcat]
+#verbose "Started NetCat $netcat -q 10"
+
+
+netcat "foo"
+
 # testcases is set by the Makefile in the site.exp data file.
 foreach file $testcases {
 
-    verbose "Running test $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
-    spawn -noecho ./$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" 
-           exp_continue -continue_timer
-       }
-       -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 {
+       -i $sid "*Starting" {
+           verbose "Started Cygnal \"$server -p 4000 -vv -n\""
+       }
+       -i $sid "HTTP Handler" {
+           verbose "Started HTTP Handler"
+       }
+       -i $sid eof {
            #       unresolved "${file} died prematurely"
            #       catch close
            #       return "${file} died prematurely"
        }
        timeout {
-               fail "Test case ${file} still running after ${timeout} seconds, 
killing it (deadlock?)"
+               fail "Test case ${server} 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 }
-
-       if { [ llength $retcode ] > 5 } {
+    }
+
+#     verbose "Running test $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
+#     spawn -noecho ./$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" 
+#          exp_continue -continue_timer
+#      }
+#      -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 }
+    
+    if { [ llength $retcode ] > 5 } {
                fail "${file} died prematurely ([lindex $retcode 6])"
-       }
-       if { [ lindex $retcode 3 ] != 0 } {
-               fail "${file} exited with non-zero code ([lindex $retcode 3])"
-       }
-
-
-
+    }
+    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
 }


reply via email to

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