Revision 742f62b9
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
t/test.pl | ||
---|---|---|
5 | 5 |
use Data::Dumper; |
6 | 6 |
use File::Find (); |
7 | 7 |
use Test::Harness qw(runtests execute_tests); |
8 |
use Getopt::Long; |
|
8 | 9 |
|
9 | 10 |
BEGIN { |
10 | 11 |
$ENV{HARNESS_OPTIONS} = 'c'; |
... | ... | |
12 | 13 |
push @INC, 'modules/fallback'; |
13 | 14 |
} |
14 | 15 |
|
16 |
my @exclude_for_fast = ( |
|
17 |
't/001compile.t', |
|
18 |
't/003safesys.t', |
|
19 |
); |
|
20 |
|
|
15 | 21 |
sub find_files_to_test { |
16 | 22 |
my @files; |
17 | 23 |
File::Find::find(sub { push @files, $File::Find::name if (-f $_) && m/\.t$/ }, 't'); |
... | ... | |
20 | 26 |
|
21 | 27 |
my (@tests_to_run, @tests_to_run_first); |
22 | 28 |
|
29 |
GetOptions( |
|
30 |
'f|fast' => \ my $fast, |
|
31 |
); |
|
32 |
|
|
23 | 33 |
if (@ARGV) { |
24 | 34 |
@tests_to_run = @ARGV; |
25 | 35 |
|
26 | 36 |
} else { |
27 | 37 |
@tests_to_run_first = qw(t/000setup_database.t); |
28 |
my %exclude = map { ($_ => 1) } @tests_to_run_first; |
|
38 |
my %exclude = map { ($_ => 1) } @tests_to_run_first, (@exclude_for_fast)x!!$fast;
|
|
29 | 39 |
@tests_to_run = grep { !$exclude{$_} } sort(find_files_to_test()); |
30 | 40 |
} |
31 | 41 |
|
Auch abrufbar als: Unified diff
test.pl: --fast switch, skippt 001compile und 003safesys