Manuel Pégourié-Gonnard | 8511384 | 2015-07-08 21:20:03 +0100 | [diff] [blame] | 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use warnings; |
| 4 | use strict; |
| 5 | |
| 6 | use utf8; |
| 7 | use open qw(:std utf8); |
| 8 | |
Manuel Pégourié-Gonnard | e88b493 | 2015-07-15 12:31:12 +0200 | [diff] [blame] | 9 | my @suites = grep { ! /\.(?:c|gcno)$/ } glob 'test_suite_*'; |
Manuel Pégourié-Gonnard | 8511384 | 2015-07-08 21:20:03 +0100 | [diff] [blame] | 10 | die "$0: no test suite found\n" unless @suites; |
| 11 | |
| 12 | # in case test suites are linked dynamically |
| 13 | $ENV{'LD_LIBRARY_PATH'} = '../library'; |
| 14 | |
| 15 | my $prefix = $^O eq "MSWin32" ? '' : './'; |
| 16 | |
| 17 | my ($failed_suites, $total_tests_run); |
| 18 | for my $suite (@suites) |
| 19 | { |
| 20 | print "$suite ", "." x ( 72 - length($suite) - 2 - 4 ), " "; |
| 21 | my $result = `$prefix$suite`; |
| 22 | if( $result =~ /PASSED/ ) { |
| 23 | print "PASS\n"; |
| 24 | } else { |
| 25 | $failed_suites++; |
| 26 | print "FAIL\n"; |
| 27 | } |
| 28 | my ($tests, $skipped) = $result =~ /([0-9]*) tests.*?([0-9]*) skipped/; |
| 29 | $total_tests_run += $tests - $skipped; |
| 30 | } |
| 31 | |
| 32 | print "-" x 72, "\n"; |
| 33 | print $failed_suites ? "FAILED" : "PASSED"; |
| 34 | printf " (%d suites, %d tests run)\n", scalar @suites, $total_tests_run; |
| 35 | exit( $failed_suites ? 1 : 0 ); |