You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-cvs@tcl.apache.org by da...@apache.org on 2001/12/03 16:37:39 UTC
cvs commit: tcl-websh/src/apachetests hello.test hello.ws3 mod_websh.test runtests.tcl template.conf.tcl testcode.ws3
davidw 01/12/03 07:37:39
Modified: src/apachetests mod_websh.test runtests.tcl
template.conf.tcl
Added: src/apachetests hello.test hello.ws3
Removed: src/apachetests testcode.ws3
Log:
Cleaned up the apachetest files some.
Revision Changes Path
1.2 +5 -7 tcl-websh/src/apachetests/mod_websh.test
Index: mod_websh.test
===================================================================
RCS file: /home/cvs/tcl-websh/src/apachetests/mod_websh.test,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mod_websh.test 2001/11/20 13:55:04 1.1
+++ mod_websh.test 2001/12/03 15:37:39 1.2
@@ -6,23 +6,21 @@
# See README file for more information.
-# $Id: mod_websh.test,v 1.1 2001/11/20 13:55:04 davidw Exp $
+# $Id: mod_websh.test,v 1.2 2001/12/03 15:37:39 davidw Exp $
package require tcltest
package require http 2.1
set urlbase "http://localhost:8080/"
-set testfilename1 "testcode.ws3"
+set testfilename1 "hello.ws3"
# Test stanzas are created by giving the test a name and a
# description. The code is then executed, and the results compared
# with the desired result, which is placed after the block of code.
# See man tcltest for more information.
-::tcltest::test hello-1.1 {hello world test} {
- set page [ ::http::geturl "${urlbase}$testfilename1" ]
- regexp -line {^Hello, World$} [ ::http::data $page ] match
- set match
-} {Hello, World}
+foreach Test {hello.test} {
+ source $Test
+}
::tcltest::cleanupTests
1.2 +34 -8 tcl-websh/src/apachetests/runtests.tcl
Index: runtests.tcl
===================================================================
RCS file: /home/cvs/tcl-websh/src/apachetests/runtests.tcl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- runtests.tcl 2001/11/20 13:55:04 1.1
+++ runtests.tcl 2001/12/03 15:37:39 1.2
@@ -1,16 +1,42 @@
#!/bin/sh
# the next line restarts using tclsh \
-exec tclsh "$0" "$@"
+ exec tclsh "$0" "$@"
-source makeconf.tcl
+proc getbinname { } {
+ global argv
+ set binname [lindex $argv 0]
+ if { $binname == "" || ! [file exists $binname] } {
+ puts stderr "Please supply the full name and path of the Apache executable on the command line!"
+ exit 1
+ }
+ return $binname
+}
set binname [ getbinname ]
+source makeconf.tcl
makeconf $binname server.conf
-
-# We could include some sort of loop here, running the server + tests
-set apachepid [ exec $binname -X -f "[file join [pwd] server.conf]" & ]
-set oput [ exec [file join . mod_websh.test] ]
-puts $oput
-exec kill $apachepid
+puts "$binname -X -f [file join [pwd] server.conf]"
+switch -exact [lindex $argv 1] {
+ withconfigs {
+ foreach {option val} {
+ {} {}
+ WebshConfig config.tcl
+ } {
+ set apachepid [exec $binname -X -f "[file join [pwd] server.conf]" -c "$option $val" &]
+ set oput [exec [file join . mod_websh.test]]
+ puts $oput
+ exec kill $apachepid
+ }
+ }
+ startserver {
+ set apachepid [exec $binname -X -f "[file join [pwd] server.conf]" &]
+ }
+ default {
+ set apachepid [exec $binname -X -f "[file join [pwd] server.conf]" &]
+ set oput [exec [file join . mod_websh.test]]
+ puts $oput
+ exec kill $apachepid
+ }
+}
1.2 +0 -1 tcl-websh/src/apachetests/template.conf.tcl
Index: template.conf.tcl
===================================================================
RCS file: /home/cvs/tcl-websh/src/apachetests/template.conf.tcl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- template.conf.tcl 2001/11/20 13:55:04 1.1
+++ template.conf.tcl 2001/12/03 15:37:39 1.2
@@ -50,7 +50,6 @@
LogFormat "%h %l %u %t \\"%r\\" %>s %b \\"%{Referer}i\\" \\"%{User-Agent}i\\"" combined
CustomLog "$CWD/access_log" combined
-WebshConfig [file join $CWD config.tcl]
<IfModule mod_mime.c>
AddLanguage en .en
1.1 tcl-websh/src/apachetests/hello.test
Index: hello.test
===================================================================
# $Id: hello.test,v 1.1 2001/12/03 15:37:39 davidw Exp $
# hello world test
::tcltest::test hello-1.1 {hello world test} {
set page [ ::http::geturl "${urlbase}$testfilename1" ]
regexp -line {^Hello, World$} [ ::http::data $page ] match
set match
} {Hello, World}
1.1 tcl-websh/src/apachetests/hello.ws3
Index: hello.ws3
===================================================================
# $Id: hello.ws3,v 1.1 2001/12/03 15:37:39 davidw Exp $
# hello world websh code.
web::command default {
web::put "Hello, World"
}
web::dispatch