1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#!/usr/bin/perl -w
################################################################################
#
# Copyright (c) 2005-2024 Marcus Holland-Moritz. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
################################################################################
BEGIN {
$only_basic = $] < 5.005;
if ($only_basic) {
print STDERR <<ENDWARN;
--> WARNING: The version of perl you're using ($]) is very old.
-->
--> The complete test suite cannot be run with perl < 5.005.
-->
--> I will only run some very basic tests now.
ENDWARN
}
eval q{
use Test::Harness;
$Test::Harness::switches = "-w";
};
}
@tests = @ARGV ? @ARGV : find_tests();
die "*** Can't find any test files\n" unless @tests;
$ENV{PERL_DL_NONLAZY} = 1;
runtests(@tests);
sub find_tests
{
use File::Find;
my $fd = $only_basic ? '1' : $ENV{ONLY_FAST_TESTS} ? '[0123478]' : '\d';
my %t;
find(sub { -f and /^$fd\d{2}_\w+\.t$/ and $t{$File::Find::name}++ }, 'tests');
return sort keys %t;
}
|