usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / tcpdump / tests / TESTonce
blobc5bcb34b07737ecc0f7a20c843831ed343112ad9
1 #!/usr/bin/perl
3 $debug = 0;
4 system("mkdir -p NEW DIFF");
6 if(@ARGV == 1) {
7 open(TESTLIST, "TESTLIST") || die "can not open TESTLIST: $!\n";
8 $wanted = $ARGV[0];
9 #print "Searching for test case $wanted\n";
10 while(<TESTLIST>) {
11 #print "Processing $_\n";
12 next unless (/^$wanted/);
14 chop;
15 ($name,$input,$output,$options)=split(/\s+/,$_, 4);
16 last;
18 close(TESTLIST);
20 die "Can not find test $wanted\n" unless defined($input);
22 } elsif(@ARGV == 4) {
23 $name=$ARGV[0];
24 $input=$ARGV[1];
25 $output=$ARGV[2];
26 $options=$ARGV[3];
27 } else {
28 print "Usage: TESTonce name [input output options]\n";
29 exit 20;
32 print "Running $name. \n" if $debug;
33 print " Input: $input, OUTPUT: $output, OPTIONS: $options\n" if $debug;
35 print " ";
36 exec("../tcpdump 2>/dev/null -n -r $input $options | tee NEW/$output | diff -w - $output >DIFF/$output.diff");
37 @cores = glob("core*");
38 exit 10 if (@cores > 0);
39 exit 0;