summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-27 11:53:50 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-27 11:53:50 +0000
commit3723c52057a871600f0f4e8aaae847a1c9113da8 (patch)
treeda3690e4e9b81f7bd599840ea785ea996cee26a5
parent0e78911ce3e6927d72ee85675a3a1b64f4d5a614 (diff)
downloadgnurl-3723c52057a871600f0f4e8aaae847a1c9113da8.tar.gz
gnurl-3723c52057a871600f0f4e8aaae847a1c9113da8.tar.bz2
gnurl-3723c52057a871600f0f4e8aaae847a1c9113da8.zip
if the server doesn't output a logfile, the protocol file is not compared
with it! This makes tests without server (like for file://) smarter.
-rwxr-xr-xtests/runtests.pl35
1 files changed, 20 insertions, 15 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 298b83478..e5761a9e0 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -345,6 +345,9 @@ sub singletest {
next;
}
+ # remove previous server output logfile
+ unlink($SERVERIN);
+
# name of the test
open(N, "<$TESTDIR/name$NUMBER.txt") ||
print "** Couldn't read name on test $NUMBER\n";
@@ -464,22 +467,24 @@ sub singletest {
}
- if (! -r $PROT) {
- print "** Missing protocol file for test $NUMBER",
- ", should be similar to $SERVERIN\n";
- return 1;
- }
-
- # The strip pattern below is for stripping off User-Agent: since
- # that'll be different in all versions, and the lines in a
- # RFC1876-post that are randomly generated and therefore are doomed to
- # always differ!
+ if(-r $SERVERIN) {
+ if(! -r $PROT) {
+ print "** Missing protocol file for test $NUMBER",
+ ", should be similar to $SERVERIN\n";
+ return 1;
+ }
- # verify the sent request
- $res = compare($SERVERIN, $PROT, "protocol",
- "^(User-Agent:|--curl|Content-Type: multipart/form-data; boundary=|PORT ).*\r\n");
- if($res) {
- return 1;
+ # The strip pattern below is for stripping off User-Agent: since
+ # that'll be different in all versions, and the lines in a
+ # RFC1876-post that are randomly generated and therefore are
+ # doomed to always differ!
+
+ # verify the sent request
+ $res = compare($SERVERIN, $PROT, "protocol",
+ "^(User-Agent:|--curl|Content-Type: multipart/form-data; boundary=|PORT ).*\r\n");
+ if($res) {
+ return 1;
+ }
}
# remove the stdout and stderr files