blob: ab9db82558fef64f8333807b094e78564498f66a [file] [log] [blame]
Manuel Pégourié-Gonnard85113842015-07-08 21:20:03 +01001#!/usr/bin/perl
2
3use warnings;
4use strict;
5
6use utf8;
7use open qw(:std utf8);
8
Manuel Pégourié-Gonnarde88b4932015-07-15 12:31:12 +02009my @suites = grep { ! /\.(?:c|gcno)$/ } glob 'test_suite_*';
Manuel Pégourié-Gonnard85113842015-07-08 21:20:03 +010010die "$0: no test suite found\n" unless @suites;
11
12# in case test suites are linked dynamically
13$ENV{'LD_LIBRARY_PATH'} = '../library';
14
15my $prefix = $^O eq "MSWin32" ? '' : './';
16
17my ($failed_suites, $total_tests_run);
18for 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
32print "-" x 72, "\n";
33print $failed_suites ? "FAILED" : "PASSED";
34printf " (%d suites, %d tests run)\n", scalar @suites, $total_tests_run;
35exit( $failed_suites ? 1 : 0 );