test_requires 'Test::More' => '0.88';
# aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available
-if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.35_05')) {
- author_requires('Test::Aggregate', '0.35_05');
+if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.364')) {
+ author_requires('Test::Aggregate', '0.364');
author_requires('Test::Simple', '0.88');
+ open my $fh, '>', '.aggregating';
}
else {
+ unlink '.aggregating';
tests join q{ },
grep { $_ ne 't/aggregate.t' }
map { glob } qw[t/*.t t/aggregate/*.t];
use lib "$FindBin::Bin/lib";
BEGIN {
- unless (eval { require Test::Aggregate; Test::Aggregate->VERSION('0.35_05'); 1 }) {
+ unless (eval { require Test::Aggregate; Test::Aggregate->VERSION('0.364'); 1 }) {
require Test::More;
- Test::More::plan(skip_all => 'Test::Aggregate 0.35_05 required for test aggregation');
+ Test::More::plan(skip_all => 'Test::Aggregate 0.364 required for test aggregation');
}
}
# run the testsuite against the HTTP server
$ENV{CATALYST_SERVER} = "http://localhost:$port";
+chdir '..';
+
my $return;
if ( $single_test ) {
- $return = system( "$^X -I../lib/ $single_test" );
+ $return = system( "$^X -Ilib/ $single_test" );
}
else {
- $return = prove( ['../lib/'], [glob('../t/aggregate/live_*.t')] );
+ $return = prove( ['lib/'], [grep { $_ ne '..' } glob('t/aggregate/live_*.t')] );
}
# shut it down
unshift @INC, @{ $inc };
require TAP::Harness;
- my $harness = TAP::Harness->new;
- my $aggregator = $harness->runtests(@{ $tests });
+
+ my $aggr = -e '.aggregating';
+ my $harness = TAP::Harness->new({
+ ($aggr ? (test_args => $tests) : ())
+ });
+
+ my $aggregator = $aggr
+ ? $harness->runtests('t/aggregate.t')
+ : $harness->runtests(@{ $tests });
exit $aggregator->has_errors ? 1 : 0;
} else {