From: Jarkko Hietaniemi Date: Sun, 4 Nov 2001 17:44:41 +0000 (+0000) Subject: Math::Big* test tweaks to work better with core: X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c986521fa3f17b71e39da3c3e4acebb736334697;p=p5sagit%2Fp5-mst-13.2.git Math::Big* test tweaks to work better with core: but the coast still not clear. p4raw-id: //depot/perl@12847 --- diff --git a/lib/Math/BigInt/t/bigfltpm.t b/lib/Math/BigInt/t/bigfltpm.t index d02caa6..6aa7181 100755 --- a/lib/Math/BigInt/t/bigfltpm.t +++ b/lib/Math/BigInt/t/bigfltpm.t @@ -1,15 +1,33 @@ #!/usr/bin/perl -w +BEGIN { + $| = 1; + my $location = $0; + # to locate the testing files + $location =~ s/bigfltpm.t//i; + if ($ENV{PERL_CORE}) { + # testing with the core distribution + @INC = qw(../lib); + if (-d 't') { + chdir 't'; + require File::Spec; + unshift @INC, File::Spec->catdir(File::Spec->updir, $location); + } else { + unshift @INC, $location; + } + } else { + # for running manually with the CPAN distribution + unshift @INC, '../lib'; + $location =~ s/bigfltpm.t//; + } + print "# INC = @INC\n"; +} + use Test; use strict; BEGIN { - $| = 1; - unshift @INC, '../lib'; # for running manually - my $location = $0; $location =~ s/bigfltpm.t//; - unshift @INC, $location; # to locate the testing files - # chdir 't' if -d 't'; plan tests => 1277; } diff --git a/lib/Math/BigInt/t/bigintpm.t b/lib/Math/BigInt/t/bigintpm.t index eb1b43f..6a8e68e 100755 --- a/lib/Math/BigInt/t/bigintpm.t +++ b/lib/Math/BigInt/t/bigintpm.t @@ -1,15 +1,25 @@ #!/usr/bin/perl -w +BEGIN { + $| = 1; + if ($ENV{PERL_CORE}) { + @INC = qw(../lib); + chdir 't' if -d 't'; + } else { + # for running manually with the CPAN distribution + unshift @INC, '../lib'; + } + print "# INC = @INC\n"; +} + use strict; use Test; BEGIN { - $| = 1; - # chdir 't' if -d 't'; - unshift @INC, '../lib'; # for running manually plan tests => 1457; } + my $version = '1.43'; # for $VERSION tests, match current release (by hand!) ############################################################################## diff --git a/lib/Math/BigInt/t/sub_mbf.t b/lib/Math/BigInt/t/sub_mbf.t index 946222c..0695ef2 100755 --- a/lib/Math/BigInt/t/sub_mbf.t +++ b/lib/Math/BigInt/t/sub_mbf.t @@ -1,15 +1,33 @@ #!/usr/bin/perl -w +BEGIN { + $| = 1; + my $location = $0; + # to locate the testing files + $location =~ s/sub_mbf.t//i; + if ($ENV{PERL_CORE}) { + # testing with the core distribution + @INC = qw(../lib); + if (-d 't') { + chdir 't'; + require File::Spec; + unshift @INC, File::Spec->catdir(File::Spec->updir, $location); + } else { + unshift @INC, $location; + } + } else { + # for running manually with the CPAN distribution + unshift @INC, '../lib'; + $location =~ s/bigfltpm.t//; + } + print "# INC = @INC\n"; +} + use Test; use strict; BEGIN { - $| = 1; - unshift @INC, '../lib'; # for running manually - my $location = $0; $location =~ s/sub_mbf.t//; - unshift @INC, $location; # to locate the testing files - chdir 't' if -d 't'; plan tests => 1277 + 4; # + 4 own tests } diff --git a/lib/Math/BigInt/t/sub_mbi.t b/lib/Math/BigInt/t/sub_mbi.t index cb85a02..20b8b8d 100755 --- a/lib/Math/BigInt/t/sub_mbi.t +++ b/lib/Math/BigInt/t/sub_mbi.t @@ -1,15 +1,33 @@ #!/usr/bin/perl -w +BEGIN { + $| = 1; + my $location = $0; + # to locate the testing files + $location =~ s/sub_mbi.t//i; + if ($ENV{PERL_CORE}) { + # testing with the core distribution + @INC = qw(../lib); + if (-d 't') { + chdir 't'; + require File::Spec; + unshift @INC, File::Spec->catdir(File::Spec->updir, $location); + } else { + unshift @INC, $location; + } + } else { + # for running manually with the CPAN distribution + unshift @INC, '../lib'; + $location =~ s/bigfltpm.t//; + } + print "# INC = @INC\n"; +} + use Test; use strict; BEGIN { - $| = 1; - unshift @INC, '../lib'; # for running manually - my $location = $0; $location =~ s/sub_mbi.t//; - unshift @INC, $location; # to locate the testing files - chdir 't' if -d 't'; plan tests => 1608 + 4; # +4 own tests }