blob: d53bedc5bb79f7dae7ae34e5e44564161ad4ffe4 [file] [log] [blame]
fbrosson06202062018-04-04 22:29:58 +00001#!/usr/bin/env perl
Manuel Pégourié-Gonnard85113842015-07-08 21:20:03 +01002
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';
Andres Amaya Garciaaa3ff982018-03-27 19:57:58 +010014$ENV{'DYLD_LIBRARY_PATH'} = '../library';
Manuel Pégourié-Gonnard85113842015-07-08 21:20:03 +010015
16my $prefix = $^O eq "MSWin32" ? '' : './';
17
18my ($failed_suites, $total_tests_run);
19for my $suite (@suites)
20{
21 print "$suite ", "." x ( 72 - length($suite) - 2 - 4 ), " ";
22 my $result = `$prefix$suite`;
23 if( $result =~ /PASSED/ ) {
24 print "PASS\n";
Manuel Pégourié-Gonnardc4cbc942015-10-20 16:59:20 +020025 my ($tests, $skipped) = $result =~ /([0-9]*) tests.*?([0-9]*) skipped/;
26 $total_tests_run += $tests - $skipped;
Manuel Pégourié-Gonnard85113842015-07-08 21:20:03 +010027 } else {
28 $failed_suites++;
29 print "FAIL\n";
30 }
Manuel Pégourié-Gonnard85113842015-07-08 21:20:03 +010031}
32
33print "-" x 72, "\n";
34print $failed_suites ? "FAILED" : "PASSED";
35printf " (%d suites, %d tests run)\n", scalar @suites, $total_tests_run;
36exit( $failed_suites ? 1 : 0 );