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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
#!/usr/bin/perl -w
################################################################################
#
# $Project: /Convert-Binary-C $
# $Author: mhx $
# $Date: 2009/03/16 09:45:48 +0100 $
# $Revision: 10 $
# $Source: /test.pl $
#
################################################################################
#
# Copyright (c) 2005-2009 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";
};
}
else {
eval { $thv = `$^X -MTest::Harness -le'print \$Test::Harness::VERSION'` };
eval q{ use lib './support' } unless defined $thv && $thv >= 2.62;
eval q{
use File::Spec;
use Test::Harness;
use Cwd;
$lib = File::Spec->catfile(getcwd, 'support');
$lib = qq["$lib"] if $lib =~ /\s/;
$Test::Harness::switches = "-I$lib -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;
}
|