7 use Test::Harness qw(runtests execute_tests);
10 $ENV{HARNESS_OPTIONS} = 'j:c';
11 unshift @INC, 'modules/override';
12 push @INC, 'modules/fallback';
15 sub find_files_to_test {
17 File::Find::find(sub { push @files, $File::Find::name if (-f _) && m/\.t$/ }, 't');
21 my (@tests_to_run, @tests_to_run_first);
24 @tests_to_run = @ARGV;
27 @tests_to_run_first = qw(t/000setup_database.t);
28 my %exclude = map { ($_ => 1) } @tests_to_run_first;
29 @tests_to_run = grep { !$exclude{$_} } sort(find_files_to_test());
32 if (@tests_to_run_first) {
33 my ($total, $failed) = execute_tests(tests => \@tests_to_run_first);
34 exit(1) unless !$total->{bad} && (0 < $total->{max});
37 runtests(@tests_to_run);