Skip to content

Commit

Permalink
if the server doesn't output a logfile, the protocol file is not comp…
Browse files Browse the repository at this point in the history
…ared

with it! This makes tests without server (like for file://) smarter.
  • Loading branch information
bagder committed Nov 27, 2000
1 parent 0e78911 commit 3723c52
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions tests/runtests.pl
Expand Up @@ -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";
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3723c52

Please sign in to comment.