]>
git.saurik.com Git - apple/dyld.git/blob - unit-tests/bin/build-results-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;
47 printf " * * * %d of %d unit-tests passed (%.1f percent) * * *\n", $pass_count, $total_count, $percentage;
52 my ($root, $lines) = @_;
54 # build an associative array of keys to value(s)
55 my $lines_seq = [split /\n/, $lines];
56 #print Dumper($lines_seq);
57 my $tbl = { 'root' => $root, 'stdout' => [], 'stderr' => [] };
59 foreach $line (@$lines_seq)
61 if($line =~ m/^(\w+):\s+(.*)$/)
65 if(!exists($$tbl{$key}))
68 if($key eq 'stdout' || $key eq 'stderr') # if type is @array
70 push @{$$tbl{$key}}, $val;
85 my $test_name = $$tbl{cwd
};
86 if ($test_name =~ m
|.*/([a-zA-Z0-9-
+_
]+)$|)
91 #if there was any output to stderr, mark this as a failure
93 foreach $line (@{$$tbl{stderr
}})
95 printf "%-40s FAIL spurious stderr failure: %s\n", $test_name, $line;
104 #if make failed (exit was non-zero), mark this as a failure
107 printf "%-40s FAIL Makefile failure\n", $test_name;