Projekt

Allgemein

Profil

Herunterladen (1010 Bytes) Statistiken
| Zweig: | Markierung: | Revision:
8317b7aa Moritz Bunkus
#!/usr/bin/perl -X

use strict;

use Data::Dumper;
use File::Find ();
use Test::Harness qw(runtests execute_tests);
742f62b9 Sven Schöling
use Getopt::Long;
8317b7aa Moritz Bunkus
BEGIN {
6fd52dd5 Sven Schöling
$ENV{HARNESS_OPTIONS} = 'c';
8317b7aa Moritz Bunkus
unshift @INC, 'modules/override';
push @INC, 'modules/fallback';
}

742f62b9 Sven Schöling
my @exclude_for_fast = (
't/001compile.t',
't/003safesys.t',
);

8317b7aa Moritz Bunkus
sub find_files_to_test {
my @files;
931c8a63 Sven Schöling
File::Find::find(sub { push @files, $File::Find::name if (-f $_) && m/\.t$/ }, 't');
8317b7aa Moritz Bunkus
return @files;
}

my (@tests_to_run, @tests_to_run_first);

742f62b9 Sven Schöling
GetOptions(
'f|fast' => \ my $fast,
);

8317b7aa Moritz Bunkus
if (@ARGV) {
@tests_to_run = @ARGV;

} else {
@tests_to_run_first = qw(t/000setup_database.t);
742f62b9 Sven Schöling
my %exclude = map { ($_ => 1) } @tests_to_run_first, (@exclude_for_fast)x!!$fast;
8317b7aa Moritz Bunkus
@tests_to_run = grep { !$exclude{$_} } sort(find_files_to_test());
}

if (@tests_to_run_first) {
my ($total, $failed) = execute_tests(tests => \@tests_to_run_first);
exit(1) unless !$total->{bad} && (0 < $total->{max});
}

runtests(@tests_to_run);