]>
git.saurik.com Git - apple/dyld.git/blob - unit-tests/bin/result-filter.pl
8 $Data::Dumper
::Terse
= 1;
15 # first match "root: "
17 # a line starting with "cwd:" marks the beginning of a new test case
18 # call process_entry() on each test case
21 if(m/^root:\s+(.*?)$/)
25 elsif(m/^cwd:\s+(.*?)$/)
29 &process_entry
($root, $entry);
39 # don't forget last test case (no cwd: to mark end)
42 &process_entry
($root, $entry);
46 my $percentage = $pass_count * 100 / $total_count;
48 printf " * * * %d of %d unit-tests passed (%.1f percent) * * *\n", $pass_count, $total_count, $percentage;
53 my ($root, $lines) = @_;
55 # build an associative array of keys to value(s)
56 my $lines_seq = [split /\n/, $lines];
57 #print Dumper($lines_seq);
58 my $tbl = { 'root' => $root, 'stdout' => [], 'stderr' => [] };
60 foreach $line (@$lines_seq)
62 if($line =~ m/^(\w+):\s+(.*)$/)
66 if(!exists($$tbl{$key}))
69 if($key eq 'stdout' || $key eq 'stderr') # if type is @array
71 push @{$$tbl{$key}}, $val;
86 my $test_name = $$tbl{cwd
};
87 if ($test_name =~ m
|.*/([a-zA-Z0-9-
+_
]+)$|)
92 #if make failed (exit was non-zero), mark this as a failure
95 printf "%-40s FAIL Makefile failure\n", $test_name;
101 # scan all stdout looking for lines that start with PASS or FAIL
102 foreach $line (@{$$tbl{stdout
}})
104 if($line =~ m/^(PASS|XPASS|FAIL|XFAIL).+/)
106 printf "%-40s %s\n", $test_name, $line;
108 if($line =~ m/^PASS.+/)
117 printf "%-40s AMBIGIOUS missing [X]PASS/[X]FAIL\n", $test_name;