]>
The Tcpdump Group git mirrors - tcpdump/blob - tests/TESTonce
3 system("mkdir -p NEW DIFF");
6 print "Usage: TESTonce name input output options\n";
15 if ($^O
eq 'MSWin32') {
16 $r = system "..\\windump -n -r $input $options 2>NUL | sed 's/\\r//' | tee NEW/$output | diff $output - >DIFF/$output.diff";
19 # we used to do this as a nice pipeline, but the problem is that $r fails to
20 # to be set properly if the tcpdump core dumps.
21 $r = system "../tcpdump 2>/dev/null -n -r $input $options >NEW/$output";
23 $r = system "cat NEW/$output | diff $output - >DIFF/$output.diff";
25 #print sprintf("END: %08x\n", $r);
29 printf " %-30s: passed\n", $name;
30 unlink "DIFF/$output.diff";
33 printf " %-30s: TEST FAILED", $name;
34 open FOUT
, '>>failure-outputs.txt';
35 printf FOUT
"Failed test: $name\n\n";
37 if(-f
"DIFF/$output.diff") {
38 system "cat DIFF/$output.diff >> failure-outputs.txt";
42 print " (failed to execute: $!)\n";
46 # this is not working right, $r == 0x8b00 when there is a core dump.
47 # clearly, we need some platform specific perl magic to take this apart, so look for "core"
49 if($r & 127 || -f
"core") {
50 my $with = ($r & 128) ?
'with' : 'without';
54 printf " (terminated with signal %u, %s coredump)\n", ($r & 127), $with;
55 exit ($r & 128) ?
10 : 20;