summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-06-13 01:55:49 -0700
committerGuy Harris <gharris@sonic.net>2020-06-13 01:55:49 -0700
commita0f5052f63276e04d4663a83c9f0c13ca6bbaf98 (patch)
tree0985f2bfdd3e780eefb762928cbf9701a7190e59 /tests
parentf28d5b06872ae9ab7dd9216f9cd56cba1ec7178b (diff)
downloadtcpdump-a0f5052f63276e04d4663a83c9f0c13ca6bbaf98.tar.gz
TESTrun: use fc, rather than diff, on Windows.
diff doesn't come standard with Windows; fc does.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/TESTrun22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/TESTrun b/tests/TESTrun
index b5d2aa84..bd4c21bb 100755
--- a/tests/TESTrun
+++ b/tests/TESTrun
@@ -125,7 +125,17 @@ sub runtest {
$r = 0;
}
if($r == 0) {
- $r = system "diff $output tests/NEW/$outputbase >tests/DIFF/$outputbase.diff";
+ #
+ # Compare tcpdump's output with what we think it should be.
+ # If tcpdump failed to produce output, we've produced our own
+ # "output" above, with the exit status.
+ #
+ if ($^O eq 'MSWin32') {
+ my $winoutput = File::Spec->canonpath($output);
+ $r = system "fc/lb1000/t/1 $winoutput tests\\NEW\\$outputbase >tests\\DIFF\\$outputbase.diff";
+ } else {
+ $r = system "diff $output tests/NEW/$outputbase >tests/DIFF/$outputbase.diff";
+ }
$diffstat = WEXITSTATUS($r);
}
@@ -147,7 +157,15 @@ sub runtest {
close(ERRORRAW);
if ( -f "$output.stderr" ) {
- $nr = system "diff $output.stderr $stderrlog >tests/DIFF/$outputbase.stderr.diff";
+ #
+ # Compare the standard error with what we think it should be.
+ #
+ if ($^O eq 'MSWin32') {
+ my $canonstderrlog = File::Spec->canonpath($stderrlog);
+ $nr = system "fc/lb1000/t/1 $output.stderr $canonstderrlog >tests/DIFF/$outputbase.stderr.diff";
+ } else {
+ $nr = system "diff $output.stderr $stderrlog >tests/DIFF/$outputbase.stderr.diff";
+ }
if($r == 0) {
$r = $nr;
}