4 fuzzer-find-diff.pl reference_binary new_binary [number_of_tests_to_run]
6 The first two input arguments are the commands to run the test programs
7 based on fuzzer_test_main() function from 'util.c' (preferably they should
8 be statically compiled, this can be achieved via '--disable-shared' pixman
9 configure option). The third optional argument is the number of test rounds
10 to run (if not specified, then testing runs infinitely or until some problem
14 fuzzer-find-diff.pl ./blitters-test-with-sse-disabled ./blitters-test 9000000
15 fuzzer-find-diff.pl ./blitters-test \"ssh ppc64_host /path/to/blitters-test\"
18 $#ARGV >= 1 or die $usage;
23 $number_of_tests = int($ARGV[2]);
32 if (`$ARGV[0] $min $max 2>/dev/null` eq `$ARGV[1] $min $max 2>/dev/null`) {
36 while ($max != $min + 1) {
37 my $avg = int(($min + $max) / 2);
38 my $res1 = `$ARGV[0] $min $avg 2>/dev/null`;
39 my $res2 = `$ARGV[1] $min $avg 2>/dev/null`;
50 while ($number_of_tests <= 0 || $base <= $number_of_tests) {
51 printf("testing %-12d\r", $base + $batch_size - 1);
52 my $res = test_range($base, $base + $batch_size - 1);
54 printf("Failure: results are different for test %d:\n", $res);
56 printf("\n-- ref --\n");
57 print `$ARGV[0] $res`;
58 printf("-- new --\n");
59 print `$ARGV[1] $res`;
61 printf("The problematic conditions can be reproduced by running:\n");
62 printf("$ARGV[1] %d\n", $res);
68 printf("Success: %d tests finished\n", $base - 1);