From 3a8e0a4dfd9bce54a71c6725c2676d7b9acf5bb9 Mon Sep 17 00:00:00 2001 From: brectanus Date: Wed, 19 Dec 2007 23:43:51 +0000 Subject: [PATCH] Some more reorg of tests. --- apache2/t/{operators => op}/beginsWith.t | 0 apache2/t/{operators => op}/contains.t | 0 apache2/t/{operators => op}/containsWord.t | 0 apache2/t/{operators => op}/endsWith.t | 0 apache2/t/{operators => op}/eq.t | 0 apache2/t/{operators => op}/ge.t | 0 apache2/t/{operators => op}/geoLookup.t | 0 apache2/t/{operators => op}/gt.t | 0 apache2/t/{operators => op}/inspectFile.t | 0 apache2/t/{operators => op}/le.t | 0 apache2/t/{operators => op}/lt.t | 0 apache2/t/{operators => op}/m.t | 0 apache2/t/{operators => op}/noMatch.t | 0 apache2/t/{operators => op}/pm.t | 0 apache2/t/{operators => op}/pmFromFile.t | 0 apache2/t/{operators => op}/rbl.t | 0 apache2/t/{operators => op}/rx.t | 0 apache2/t/{operators => op}/streq.t | 0 .../t/{operators => op}/unconditionalMatch.t | 0 apache2/t/{operators => op}/validateByteRange.t | 0 apache2/t/{operators => op}/validateDTD.t | 0 apache2/t/{operators => op}/validateSchema.t | 0 .../t/{operators => op}/validateUrlEncoding.t | 0 .../t/{operators => op}/validateUtf8Encoding.t | 0 apache2/t/{operators => op}/verifyCC.t | 0 apache2/t/{operators => op}/within.t | 0 apache2/t/run-tests.pl | 17 ++++++++++++++--- apache2/t/{tfns => tfn}/base64Decode.t | 0 apache2/t/{tfns => tfn}/base64Encode.t | 0 apache2/t/{tfns => tfn}/compressWhitespace.t | 0 apache2/t/{tfns => tfn}/escapeSeqDecode.t | 0 apache2/t/{tfns => tfn}/hexDecode.t | 0 apache2/t/{tfns => tfn}/hexEncode.t | 0 apache2/t/{tfns => tfn}/htmlEntityDecode.t | 0 apache2/t/{tfns => tfn}/jsDecode.t | 0 apache2/t/{tfns => tfn}/length.t | 0 apache2/t/{tfns => tfn}/lowercase.t | 0 apache2/t/{tfns => tfn}/md5.t | 0 apache2/t/{tfns => tfn}/normalisePath.t | 0 apache2/t/{tfns => tfn}/normalisePathWin.t | 0 apache2/t/{tfns => tfn}/removeNulls.t | 0 apache2/t/{tfns => tfn}/removeWhitespace.t | 0 apache2/t/{tfns => tfn}/replaceComments.t | 0 apache2/t/{tfns => tfn}/replaceNulls.t | 0 apache2/t/{tfns => tfn}/sha1.t | 0 apache2/t/{tfns => tfn}/trim.t | 0 apache2/t/{tfns => tfn}/trimLeft.t | 0 apache2/t/{tfns => tfn}/trimRight.t | 0 apache2/t/{tfns => tfn}/urlDecode.t | 0 apache2/t/{tfns => tfn}/urlDecodeUni.t | 0 apache2/t/{tfns => tfn}/urlEncode.t | 0 51 files changed, 14 insertions(+), 3 deletions(-) rename apache2/t/{operators => op}/beginsWith.t (100%) rename apache2/t/{operators => op}/contains.t (100%) rename apache2/t/{operators => op}/containsWord.t (100%) rename apache2/t/{operators => op}/endsWith.t (100%) rename apache2/t/{operators => op}/eq.t (100%) rename apache2/t/{operators => op}/ge.t (100%) rename apache2/t/{operators => op}/geoLookup.t (100%) rename apache2/t/{operators => op}/gt.t (100%) rename apache2/t/{operators => op}/inspectFile.t (100%) rename apache2/t/{operators => op}/le.t (100%) rename apache2/t/{operators => op}/lt.t (100%) rename apache2/t/{operators => op}/m.t (100%) rename apache2/t/{operators => op}/noMatch.t (100%) rename apache2/t/{operators => op}/pm.t (100%) rename apache2/t/{operators => op}/pmFromFile.t (100%) rename apache2/t/{operators => op}/rbl.t (100%) rename apache2/t/{operators => op}/rx.t (100%) rename apache2/t/{operators => op}/streq.t (100%) rename apache2/t/{operators => op}/unconditionalMatch.t (100%) rename apache2/t/{operators => op}/validateByteRange.t (100%) rename apache2/t/{operators => op}/validateDTD.t (100%) rename apache2/t/{operators => op}/validateSchema.t (100%) rename apache2/t/{operators => op}/validateUrlEncoding.t (100%) rename apache2/t/{operators => op}/validateUtf8Encoding.t (100%) rename apache2/t/{operators => op}/verifyCC.t (100%) rename apache2/t/{operators => op}/within.t (100%) rename apache2/t/{tfns => tfn}/base64Decode.t (100%) rename apache2/t/{tfns => tfn}/base64Encode.t (100%) rename apache2/t/{tfns => tfn}/compressWhitespace.t (100%) rename apache2/t/{tfns => tfn}/escapeSeqDecode.t (100%) rename apache2/t/{tfns => tfn}/hexDecode.t (100%) rename apache2/t/{tfns => tfn}/hexEncode.t (100%) rename apache2/t/{tfns => tfn}/htmlEntityDecode.t (100%) rename apache2/t/{tfns => tfn}/jsDecode.t (100%) rename apache2/t/{tfns => tfn}/length.t (100%) rename apache2/t/{tfns => tfn}/lowercase.t (100%) rename apache2/t/{tfns => tfn}/md5.t (100%) rename apache2/t/{tfns => tfn}/normalisePath.t (100%) rename apache2/t/{tfns => tfn}/normalisePathWin.t (100%) rename apache2/t/{tfns => tfn}/removeNulls.t (100%) rename apache2/t/{tfns => tfn}/removeWhitespace.t (100%) rename apache2/t/{tfns => tfn}/replaceComments.t (100%) rename apache2/t/{tfns => tfn}/replaceNulls.t (100%) rename apache2/t/{tfns => tfn}/sha1.t (100%) rename apache2/t/{tfns => tfn}/trim.t (100%) rename apache2/t/{tfns => tfn}/trimLeft.t (100%) rename apache2/t/{tfns => tfn}/trimRight.t (100%) rename apache2/t/{tfns => tfn}/urlDecode.t (100%) rename apache2/t/{tfns => tfn}/urlDecodeUni.t (100%) rename apache2/t/{tfns => tfn}/urlEncode.t (100%) diff --git a/apache2/t/operators/beginsWith.t b/apache2/t/op/beginsWith.t similarity index 100% rename from apache2/t/operators/beginsWith.t rename to apache2/t/op/beginsWith.t diff --git a/apache2/t/operators/contains.t b/apache2/t/op/contains.t similarity index 100% rename from apache2/t/operators/contains.t rename to apache2/t/op/contains.t diff --git a/apache2/t/operators/containsWord.t b/apache2/t/op/containsWord.t similarity index 100% rename from apache2/t/operators/containsWord.t rename to apache2/t/op/containsWord.t diff --git a/apache2/t/operators/endsWith.t b/apache2/t/op/endsWith.t similarity index 100% rename from apache2/t/operators/endsWith.t rename to apache2/t/op/endsWith.t diff --git a/apache2/t/operators/eq.t b/apache2/t/op/eq.t similarity index 100% rename from apache2/t/operators/eq.t rename to apache2/t/op/eq.t diff --git a/apache2/t/operators/ge.t b/apache2/t/op/ge.t similarity index 100% rename from apache2/t/operators/ge.t rename to apache2/t/op/ge.t diff --git a/apache2/t/operators/geoLookup.t b/apache2/t/op/geoLookup.t similarity index 100% rename from apache2/t/operators/geoLookup.t rename to apache2/t/op/geoLookup.t diff --git a/apache2/t/operators/gt.t b/apache2/t/op/gt.t similarity index 100% rename from apache2/t/operators/gt.t rename to apache2/t/op/gt.t diff --git a/apache2/t/operators/inspectFile.t b/apache2/t/op/inspectFile.t similarity index 100% rename from apache2/t/operators/inspectFile.t rename to apache2/t/op/inspectFile.t diff --git a/apache2/t/operators/le.t b/apache2/t/op/le.t similarity index 100% rename from apache2/t/operators/le.t rename to apache2/t/op/le.t diff --git a/apache2/t/operators/lt.t b/apache2/t/op/lt.t similarity index 100% rename from apache2/t/operators/lt.t rename to apache2/t/op/lt.t diff --git a/apache2/t/operators/m.t b/apache2/t/op/m.t similarity index 100% rename from apache2/t/operators/m.t rename to apache2/t/op/m.t diff --git a/apache2/t/operators/noMatch.t b/apache2/t/op/noMatch.t similarity index 100% rename from apache2/t/operators/noMatch.t rename to apache2/t/op/noMatch.t diff --git a/apache2/t/operators/pm.t b/apache2/t/op/pm.t similarity index 100% rename from apache2/t/operators/pm.t rename to apache2/t/op/pm.t diff --git a/apache2/t/operators/pmFromFile.t b/apache2/t/op/pmFromFile.t similarity index 100% rename from apache2/t/operators/pmFromFile.t rename to apache2/t/op/pmFromFile.t diff --git a/apache2/t/operators/rbl.t b/apache2/t/op/rbl.t similarity index 100% rename from apache2/t/operators/rbl.t rename to apache2/t/op/rbl.t diff --git a/apache2/t/operators/rx.t b/apache2/t/op/rx.t similarity index 100% rename from apache2/t/operators/rx.t rename to apache2/t/op/rx.t diff --git a/apache2/t/operators/streq.t b/apache2/t/op/streq.t similarity index 100% rename from apache2/t/operators/streq.t rename to apache2/t/op/streq.t diff --git a/apache2/t/operators/unconditionalMatch.t b/apache2/t/op/unconditionalMatch.t similarity index 100% rename from apache2/t/operators/unconditionalMatch.t rename to apache2/t/op/unconditionalMatch.t diff --git a/apache2/t/operators/validateByteRange.t b/apache2/t/op/validateByteRange.t similarity index 100% rename from apache2/t/operators/validateByteRange.t rename to apache2/t/op/validateByteRange.t diff --git a/apache2/t/operators/validateDTD.t b/apache2/t/op/validateDTD.t similarity index 100% rename from apache2/t/operators/validateDTD.t rename to apache2/t/op/validateDTD.t diff --git a/apache2/t/operators/validateSchema.t b/apache2/t/op/validateSchema.t similarity index 100% rename from apache2/t/operators/validateSchema.t rename to apache2/t/op/validateSchema.t diff --git a/apache2/t/operators/validateUrlEncoding.t b/apache2/t/op/validateUrlEncoding.t similarity index 100% rename from apache2/t/operators/validateUrlEncoding.t rename to apache2/t/op/validateUrlEncoding.t diff --git a/apache2/t/operators/validateUtf8Encoding.t b/apache2/t/op/validateUtf8Encoding.t similarity index 100% rename from apache2/t/operators/validateUtf8Encoding.t rename to apache2/t/op/validateUtf8Encoding.t diff --git a/apache2/t/operators/verifyCC.t b/apache2/t/op/verifyCC.t similarity index 100% rename from apache2/t/operators/verifyCC.t rename to apache2/t/op/verifyCC.t diff --git a/apache2/t/operators/within.t b/apache2/t/op/within.t similarity index 100% rename from apache2/t/operators/within.t rename to apache2/t/op/within.t diff --git a/apache2/t/run-tests.pl b/apache2/t/run-tests.pl index 77589153..4c265cf7 100755 --- a/apache2/t/run-tests.pl +++ b/apache2/t/run-tests.pl @@ -2,7 +2,7 @@ use strict; use File::Basename qw(basename dirname); -my @TYPES = qw(tfns operators); +my @TYPES = qw(tfn op); my $TEST = "./msc_test"; my $SCRIPT = basename($0); my $SCRIPTDIR = dirname($0); @@ -59,9 +59,20 @@ sub runfile { my $in = $t{input}; my $out = escape($t{output}); # Escape so we can send via commandline quit(1, "Failed to interpret output \"$cfg\": $@") if ($@); + my $param; my $rc = 0; - open(TEST, "|-", $TEST, $t{type}, $t{name}, $out, (exists($t{ret}) ? ($t{ret}) : ())) or quit(1, "Failed to execute test \"$cfg\": $!"); + if ($t{type} eq "tfn") { + $param = $t{output}; + } + elsif ($t{type} eq "op") { + $param = $t{param}; + } + else { + quit(1, "Unknown type \"$t{type}\" - should be one of: " . join(",",@TYPES)); + } + + open(TEST, "|-", $TEST, $t{type}, $t{name}, $param, (exists($t{ret}) ? ($t{ret}) : ())) or quit(1, "Failed to execute test \"$cfg\": $!"); print TEST "$in"; close TEST; @@ -102,7 +113,7 @@ sub quit { sub done { if ($PASSED != $TOTAL) { - quit(1, "\nOnly $PASSED/$TOTAL tests passed."); + quit(1, "\n$PASSED/$TOTAL tests passed."); } quit(0, "\nAll tests passed ($TOTAL)."); diff --git a/apache2/t/tfns/base64Decode.t b/apache2/t/tfn/base64Decode.t similarity index 100% rename from apache2/t/tfns/base64Decode.t rename to apache2/t/tfn/base64Decode.t diff --git a/apache2/t/tfns/base64Encode.t b/apache2/t/tfn/base64Encode.t similarity index 100% rename from apache2/t/tfns/base64Encode.t rename to apache2/t/tfn/base64Encode.t diff --git a/apache2/t/tfns/compressWhitespace.t b/apache2/t/tfn/compressWhitespace.t similarity index 100% rename from apache2/t/tfns/compressWhitespace.t rename to apache2/t/tfn/compressWhitespace.t diff --git a/apache2/t/tfns/escapeSeqDecode.t b/apache2/t/tfn/escapeSeqDecode.t similarity index 100% rename from apache2/t/tfns/escapeSeqDecode.t rename to apache2/t/tfn/escapeSeqDecode.t diff --git a/apache2/t/tfns/hexDecode.t b/apache2/t/tfn/hexDecode.t similarity index 100% rename from apache2/t/tfns/hexDecode.t rename to apache2/t/tfn/hexDecode.t diff --git a/apache2/t/tfns/hexEncode.t b/apache2/t/tfn/hexEncode.t similarity index 100% rename from apache2/t/tfns/hexEncode.t rename to apache2/t/tfn/hexEncode.t diff --git a/apache2/t/tfns/htmlEntityDecode.t b/apache2/t/tfn/htmlEntityDecode.t similarity index 100% rename from apache2/t/tfns/htmlEntityDecode.t rename to apache2/t/tfn/htmlEntityDecode.t diff --git a/apache2/t/tfns/jsDecode.t b/apache2/t/tfn/jsDecode.t similarity index 100% rename from apache2/t/tfns/jsDecode.t rename to apache2/t/tfn/jsDecode.t diff --git a/apache2/t/tfns/length.t b/apache2/t/tfn/length.t similarity index 100% rename from apache2/t/tfns/length.t rename to apache2/t/tfn/length.t diff --git a/apache2/t/tfns/lowercase.t b/apache2/t/tfn/lowercase.t similarity index 100% rename from apache2/t/tfns/lowercase.t rename to apache2/t/tfn/lowercase.t diff --git a/apache2/t/tfns/md5.t b/apache2/t/tfn/md5.t similarity index 100% rename from apache2/t/tfns/md5.t rename to apache2/t/tfn/md5.t diff --git a/apache2/t/tfns/normalisePath.t b/apache2/t/tfn/normalisePath.t similarity index 100% rename from apache2/t/tfns/normalisePath.t rename to apache2/t/tfn/normalisePath.t diff --git a/apache2/t/tfns/normalisePathWin.t b/apache2/t/tfn/normalisePathWin.t similarity index 100% rename from apache2/t/tfns/normalisePathWin.t rename to apache2/t/tfn/normalisePathWin.t diff --git a/apache2/t/tfns/removeNulls.t b/apache2/t/tfn/removeNulls.t similarity index 100% rename from apache2/t/tfns/removeNulls.t rename to apache2/t/tfn/removeNulls.t diff --git a/apache2/t/tfns/removeWhitespace.t b/apache2/t/tfn/removeWhitespace.t similarity index 100% rename from apache2/t/tfns/removeWhitespace.t rename to apache2/t/tfn/removeWhitespace.t diff --git a/apache2/t/tfns/replaceComments.t b/apache2/t/tfn/replaceComments.t similarity index 100% rename from apache2/t/tfns/replaceComments.t rename to apache2/t/tfn/replaceComments.t diff --git a/apache2/t/tfns/replaceNulls.t b/apache2/t/tfn/replaceNulls.t similarity index 100% rename from apache2/t/tfns/replaceNulls.t rename to apache2/t/tfn/replaceNulls.t diff --git a/apache2/t/tfns/sha1.t b/apache2/t/tfn/sha1.t similarity index 100% rename from apache2/t/tfns/sha1.t rename to apache2/t/tfn/sha1.t diff --git a/apache2/t/tfns/trim.t b/apache2/t/tfn/trim.t similarity index 100% rename from apache2/t/tfns/trim.t rename to apache2/t/tfn/trim.t diff --git a/apache2/t/tfns/trimLeft.t b/apache2/t/tfn/trimLeft.t similarity index 100% rename from apache2/t/tfns/trimLeft.t rename to apache2/t/tfn/trimLeft.t diff --git a/apache2/t/tfns/trimRight.t b/apache2/t/tfn/trimRight.t similarity index 100% rename from apache2/t/tfns/trimRight.t rename to apache2/t/tfn/trimRight.t diff --git a/apache2/t/tfns/urlDecode.t b/apache2/t/tfn/urlDecode.t similarity index 100% rename from apache2/t/tfns/urlDecode.t rename to apache2/t/tfn/urlDecode.t diff --git a/apache2/t/tfns/urlDecodeUni.t b/apache2/t/tfn/urlDecodeUni.t similarity index 100% rename from apache2/t/tfns/urlDecodeUni.t rename to apache2/t/tfn/urlDecodeUni.t diff --git a/apache2/t/tfns/urlEncode.t b/apache2/t/tfn/urlEncode.t similarity index 100% rename from apache2/t/tfns/urlEncode.t rename to apache2/t/tfn/urlEncode.t