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