X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Ftest.pl;h=ccdab4077abc3f491dd0aabbb616e5ce0c172d8d;hb=af0847405bd1a45eda7897a8bbfcb5b73a032580;hp=da10840a55cad3d294b402f232372783d3c442bd;hpb=931c8a6320097b9c0f6e7e098d2533b3a70d15db;p=kivitendo-erp.git diff --git a/t/test.pl b/t/test.pl index da10840a5..ccdab4077 100755 --- a/t/test.pl +++ b/t/test.pl @@ -5,13 +5,24 @@ use strict; use Data::Dumper; use File::Find (); use Test::Harness qw(runtests execute_tests); +use Getopt::Long; BEGIN { - $ENV{HARNESS_OPTIONS} = 'j:c'; - unshift @INC, 'modules/override'; - push @INC, 'modules/fallback'; + use FindBin; + + unshift(@INC, $FindBin::Bin . '/../modules/override'); # Use our own versions of various modules (e.g. YAML). + push (@INC, $FindBin::Bin . '/..'); # '.' will be removed from @INC soon. + + $ENV{HARNESS_OPTIONS} = 'c'; + + chdir($FindBin::Bin . '/..'); } +my @exclude_for_fast = ( + 't/001compile.t', + 't/003safesys.t', +); + sub find_files_to_test { my @files; File::Find::find(sub { push @files, $File::Find::name if (-f $_) && m/\.t$/ }, 't'); @@ -20,12 +31,16 @@ sub find_files_to_test { my (@tests_to_run, @tests_to_run_first); +GetOptions( + 'f|fast' => \ my $fast, +); + if (@ARGV) { @tests_to_run = @ARGV; } else { @tests_to_run_first = qw(t/000setup_database.t); - my %exclude = map { ($_ => 1) } @tests_to_run_first; + my %exclude = map { ($_ => 1) } @tests_to_run_first, (@exclude_for_fast)x!!$fast; @tests_to_run = grep { !$exclude{$_} } sort(find_files_to_test()); }