]> The Tcpdump Group git mirrors - tcpdump/blob - tests/TESTonce
Fix the pointer tests in the non-ndoified TTEST2() macro as well.
[tcpdump] / tests / TESTonce
1 #!/usr/bin/perl
2
3 system("mkdir -p NEW DIFF");
4
5 if(@ARGV == 1) {
6 open(TESTLIST, "TESTLIST") || die "can not open TESTLIST: $!\n";
7 $wanted = $ARGV[0];
8 #print "Searching for test case $wanted\n";
9 while(<TESTLIST>) {
10 #print "Processing $_\n";
11 next unless (/^$wanted/);
12
13 chop;
14 ($name,$input,$output,$options)=split(/\s+/,$_, 4);
15 last;
16 }
17 close(TESTLIST);
18
19 die "Can not find test $wanted\n" unless defined($input);
20
21 } elsif(@ARGV == 4) {
22 $name=$ARGV[0];
23 $input=$ARGV[1];
24 $output=$ARGV[2];
25 $options=$ARGV[3];
26 } else {
27 print "Usage: TESTonce name [input output options]\n";
28 exit 20;
29 }
30
31 print "Running $name. \n";
32 print " Input: $input, OUTPUT: $output, OPTIONS: $options\n";
33
34 if (! -f $input) {
35 ($puu = $input) =~ s/\.pcap/\.puu/;
36 if( -f $puu) {
37 print "Uudecoding $puu to make $input\n";
38 system("uudecode $puu");
39 }
40 }
41
42 print " ";
43 exec("../tcpdump -n -r $input $options | tee NEW/$output | diff -w - $output >DIFF/$output.diff");
44 @cores = glob("core*");
45 exit 10 if (@cores > 0);
46 exit 0;