You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by mx...@apache.org on 2011/11/20 19:50:36 UTC

svn commit: r1204207 [2/2] - in /tcl/rivet/branches/rivet-namespace: ./ src/ src/apache-2/ tests/ tests/apachetest/ tests/docroot1/ tests/docroot2/

Modified: tcl/rivet/branches/rivet-namespace/tests/runtests.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/runtests.tcl?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/runtests.tcl (original)
+++ tcl/rivet/branches/rivet-namespace/tests/runtests.tcl Sun Nov 20 18:50:34 2011
@@ -50,9 +50,9 @@ package require apachetest
 
 if { [encoding system] eq "utf-8" } {
     puts stderr {
-	System encoding is utf-8 - this is known to cause problems
-	with the test environment!  Continuing with tests in 5 seconds
-	using the iso8859-1 encoding.
+        System encoding is utf-8 - this is known to cause problems
+        with the test environment!  Continuing with tests in 5 seconds
+        using the iso8859-1 encoding.
     }
     after 5000
 }
@@ -68,11 +68,11 @@ if { [catch {
 if {$httpd_version == 1} {
 	apachetest::need_modules {
 		{mod_log_config		config_log_module}
-		{mod_mime		mime_module}
+		{mod_mime		    mime_module}
 		{mod_negotiation	negotiation_module}
-		{mod_dir		dir_module}
-		{mod_auth		auth_module}
-		{mod_access		access_module}
+		{mod_dir		    dir_module}
+		{mod_auth		    auth_module}
+		{mod_access		    access_module}
 	}
 } else {
 	apachetest::need_modules {
@@ -129,10 +129,10 @@ set env(TCLLIBPATH) [file normalize [fil
 
 switch -exact -- [lindex $argv 1] {
     startserver {
-	apachetest::startserver
+	    apachetest::startserver
     }
     default {
-	set argv [lrange $argv 1 end]
-	source [file join . rivet.test]
+        set argv [lrange $argv 1 end]
+        source [file join . rivet.test]
     }
 }

Modified: tcl/rivet/branches/rivet-namespace/tests/upload.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/upload.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/upload.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/upload.rvt Sun Nov 20 18:50:34 2011
@@ -1,2 +1 @@
-<? puts "[upload names] [upload exists uploadtest] [upload size uploadtest] -[upload type uploadtest]- [upload filename uploadtest]" ?>
-
+<? puts "[::rivet::upload names] [::rivet::upload exists uploadtest] [::rivet::upload size uploadtest] -[::rivet::upload type uploadtest]- [::rivet::upload filename uploadtest]" ?>

Modified: tcl/rivet/branches/rivet-namespace/tests/uploadsave.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/uploadsave.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/uploadsave.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/uploadsave.rvt Sun Nov 20 18:50:34 2011
@@ -1,3 +1,3 @@
 <?
-upload save [upload names] uploadedjpeg.jpg
-?>
\ No newline at end of file
+::rivet::upload save [::rivet::upload names] uploadedjpeg.jpg
+?>

Modified: tcl/rivet/branches/rivet-namespace/tests/virtualhost.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/virtualhost.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/virtualhost.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/virtualhost.test Sun Nov 20 18:50:34 2011
@@ -22,15 +22,15 @@ set vhostconf {
 
 ::tcltest::test vhost-1.1 {basic virtual host} {
     apachetest::start {} $vhostconf {
-	set page1 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
-	set page2 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
-	set match1 [::http::data $page1]
-	set match2 [::http::data $page2]
-	::http::cleanup $page1
-	::http::cleanup $page2
+        set page1 [::http::geturl "${urlbase}basic1.rvt" -headers [list Host vhost1]]
+        set page2 [::http::geturl "${urlbase}basic2.rvt" -headers [list Host vhost2]]
+        set match1 [::http::data $page1]
+        set match2 [::http::data $page2]
+        ::http::cleanup $page1
+        ::http::cleanup $page2
     }
     list [string match {Virtual Host1 Test*} $match1] \
-	[string match {Virtual Host2 Test*} $match2]
+	     [string match {Virtual Host2 Test*} $match2]
 } {1 1}
 
 # Try virtual hosts with and without a childinitscript.
@@ -38,28 +38,28 @@ set vhostconf {
 ::tcltest::test vhost-2.1 {virtual host w/ ChildInitScript} {
     set data {}
     apachetest::start {} {
-	RivetServerConf ChildInitScript "source [file join $docroot1 childinit.tcl]"
-	NameVirtualHost 127.0.0.1
-	<VirtualHost 127.0.0.1>
-	DocumentRoot $docroot1
-	ServerName vhost1
-	</VirtualHost>
-
-	<VirtualHost 127.0.0.1>
-	RivetServerConf ChildInitScript "source [file join $docroot2 childinit.tcl]"
-	DocumentRoot $docroot2
-	ServerName vhost2
-	</VirtualHost>
+        RivetServerConf SeparateVirtualInterps off
+        RivetServerConf ChildInitScript "source [file join $docroot1 childinit.tcl]"
+        NameVirtualHost 127.0.0.1
+        <VirtualHost 127.0.0.1>
+            DocumentRoot $docroot1
+            ServerName vhost1
+        </VirtualHost>
+
+        <VirtualHost 127.0.0.1>
+            RivetServerConf ChildInitScript "source [file join $docroot2 childinit.tcl]"
+            DocumentRoot $docroot2
+            ServerName vhost2
+        </VirtualHost>
     } {
-	set page {}
-	lappend page [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
-	lappend page [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
-	foreach p $page {
-	    lappend data [::http::data $p]
-	    ::http::cleanup $p
-	}
+        set page2 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
+        set page1 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
+        set data "[::http::data $page1][::http::data $page2]"
+        ::http::cleanup $page1
+        ::http::cleanup $page2
     }
-    regexp "childinit1 exists.*childinit2 exists" $data match
+#   puts ">>>$data<<<"
+    regexp "::childinit1 exists.*::childinit2 exists" $data match
 } 1
 
 # Test out a ChildInitScript that is only in a vhost.
@@ -69,26 +69,26 @@ set vhostconf {
     apachetest::start {} {
 	NameVirtualHost 127.0.0.1
 	<VirtualHost 127.0.0.1>
-	DocumentRoot $docroot1
-	ServerName vhost1
+        DocumentRoot $docroot1
+        ServerName vhost1
 	</VirtualHost>
 
 	<VirtualHost 127.0.0.1>
-	RivetServerConf ChildInitScript "source [file join $docroot2 childinit.tcl]"
-	DocumentRoot $docroot2
-	ServerName vhost2
+        RivetServerConf ChildInitScript "source [file join $docroot2 childinit.tcl]"
+        DocumentRoot $docroot2
+        ServerName vhost2
 	</VirtualHost>
     } {
-	set page {}
-	lappend page [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
-	lappend page [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
-	foreach p $page {
-	    lappend data [::http::data $p]
-	    ::http::cleanup $p
-	}
+        set page {}
+        lappend page [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
+        lappend page [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
+        foreach p $page {
+            lappend data [::http::data $p]
+            ::http::cleanup $p
+        }
     }
-    regexp "vhost2 hello world\nchildinit2 exists" $data match
-#    set data
+#   set data
+    regexp "vhost2 hello world<br>\n::childinit2 exists<br>" $data match
 } 1
 
 # Test out a beforescript in a virtual host.
@@ -109,16 +109,15 @@ set vhostconf {
 	ServerName vhost2
 	</VirtualHost>
     } {
-	set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
-	set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
-	set data1 [::http::data $page1]
-	set data2 [::http::data $page2]
-	::http::cleanup $page1
-	::http::cleanup $page2
+        set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
+        set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
+        set data1 [::http::data $page1]
+        set data2 [::http::data $page2]
+        ::http::cleanup $page1
+        ::http::cleanup $page2
     }
-    list \
-	[regexp "^beforescript2\nVirtual Host2 Test" $data1 match] \
-	[regexp "^beforescript1\nVirtual Host1 Test" $data2 match]
+    list [regexp "^beforescript2\nVirtual Host2 Test" $data1 match] \
+	     [regexp "^beforescript1\nVirtual Host1 Test" $data2 match]
 #    list $data1 $data2
 } {1 1}
 
@@ -128,28 +127,32 @@ set vhostconf {
 ::tcltest::test vhost-4.1 {virtual host w/ separate interps} {
     set data {}
     apachetest::start {} {
-	RivetServerConf SeparateVirtualInterps on
-	NameVirtualHost 127.0.0.1
-	<VirtualHost 127.0.0.1>
-	DocumentRoot $docroot1
-	ServerName vhost1
-	</VirtualHost>
-
-	<VirtualHost 127.0.0.1>
-	DocumentRoot $docroot2
-	ServerName vhost2
-	</VirtualHost>
+        RivetServerConf SeparateVirtualInterps on
+        NameVirtualHost 127.0.0.1
+        <VirtualHost 127.0.0.1>
+            RivetServerConf ChildInitScript "set ::childinit1 1"
+            DocumentRoot $docroot1
+            ServerName vhost1
+        </VirtualHost>
+
+        <VirtualHost 127.0.0.1>
+            RivetServerConf ChildInitScript "set ::childinit2 1"
+            DocumentRoot $docroot2
+            ServerName vhost2
+        </VirtualHost>
     } {
-	set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
-	set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
-	set data1 [::http::data $page1]
-	set data2 [::http::data $page2]
-	::http::cleanup $page1
-	::http::cleanup $page2
+        set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
+        set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
+        set data1 [::http::data $page1]
+        set data2 [::http::data $page2]
+        ::http::cleanup $page1
+        ::http::cleanup $page2
     }
+#   puts "--$data1--"
+#   puts "--$data2--"
     list \
-	[regexp "vhost2 hello world\nvhost2 exists<br>" $data1 match] \
-	[regexp "vhost1 hello world<br>\nvhost1 exists<br>" $data2 match]
+	[regexp "vhost2 hello world<br>\n::childinit2 exists<br>" $data1 match] \
+	[regexp "vhost1 hello world<br>\n::childinit1 exists<br>" $data2 match]
 #    list $data1 $data2
 } {1 1}
 
@@ -158,7 +161,8 @@ set vhostconf {
 
 # Format: directive, file, 2 regexps to match
 set configs {
-    ChildInitScript childinit.tcl "childinit1 exists<br>\nchildinit2 exists<br>" "childinit1 exists<br>\nchildinit2 exists<br>"
+    ChildInitScript childinit.tcl "vhost2 hello world<br>\n::childinit2 exists<br>\n::childinit1 exists<br>\n" \
+                                  "vhost1 hello world<br>\n::childinit1 exists<br>\n::childinit2 exists<br>"
     BeforeScript beforescript.tcl "^beforescript2\nVirtual Host2 Test" "^beforescript1\nVirtual Host1 Test"
     AfterScript afterscript.tcl "afterscript2" "afterscript1"
 }
@@ -167,6 +171,7 @@ set i 1
 foreach {conf file re1 re2} $configs {
     ::tcltest::test vhost-5.$i [list vhost with $conf] {
 	apachetest::start {} "
+RivetServerConf SeparateVirtualInterps off
 RivetServerConf $conf \"source [file join $docroot1 $file]\"
 NameVirtualHost 127.0.0.1
 <VirtualHost 127.0.0.1>
@@ -187,13 +192,16 @@ ServerName vhost2
 	::http::cleanup $page1
 	::http::cleanup $page2
 }
+#puts "--$re1--\n--$data1--"
+#puts "--$re2--\n--$data2--"
+
 list [regexp $re1 $data1 match] [regexp $re1 $data1 match]
 #list $data1 $data2
     } {1 1}
 }
 
 set configs {
-    ChildInitScript childinit.tcl "vhost2 hello world\nchildinit2 exists<br>\nvhost2 exists<br>" "vhost1 hello world<br>\nvhost1 exists<br>"
+    ChildInitScript childinit.tcl "vhost2 hello world<br>\n::childinit2 exists<br>\n" "vhost1 hello world<br>\n::childinit1 exists<br>\n"
     BeforeScript beforescript.tcl "^beforescript2\nVirtual Host2 Test" "^beforescript1\nVirtual Host1 Test"
     AfterScript afterscript.tcl "afterscript2" "afterscript1"
 }
@@ -225,8 +233,10 @@ ServerName vhost2
 	::http::cleanup $page1
 	::http::cleanup $page2
 }
+#puts "--$re1--\n--$data1--"
+#puts "--$re2--\n--$data2--"
+
 list [regexp $re1 $data1 match] [regexp $re1 $data1 match]
-#list $data1 $data2
     } {1 1}
 
 incr i



---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org