7 use Test::Harness qw(runtests execute_tests);
13 unshift(@INC, $FindBin::Bin . '/../modules/override'); # Use our own versions of various modules (e.g. YAML).
14 push (@INC, $FindBin::Bin . '/..'); # '.' will be removed from @INC soon.
16 $ENV{HARNESS_OPTIONS} = 'c';
18 chdir($FindBin::Bin . '/..');
21 my @exclude_for_fast = (
26 sub find_files_to_test {
28 File::Find::find(sub { push @files, $File::Find::name if (-f $_) && m/\.t$/ }, 't');
32 my (@tests_to_run, @tests_to_run_first);
35 'f|fast' => \ my $fast,
39 @tests_to_run = @ARGV;
42 @tests_to_run_first = qw(t/000setup_database.t);
43 my %exclude = map { ($_ => 1) } @tests_to_run_first, (@exclude_for_fast)x!!$fast;
44 @tests_to_run = grep { !$exclude{$_} } sort(find_files_to_test());
47 if (@tests_to_run_first) {
48 my ($total, $failed) = execute_tests(tests => \@tests_to_run_first);
49 exit(1) unless !$total->{bad} && (0 < $total->{max});
52 runtests(@tests_to_run);