From: Rafael Garcia-Suarez Date: Tue, 10 Jul 2007 14:10:43 +0000 (+0000) Subject: Fix Digest::SHA test boilerplate. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=72aa8e26b7d5abe0ffc42e68207bbd69c420d3d1;p=p5sagit%2Fp5-mst-13.2.git Fix Digest::SHA test boilerplate. p4raw-id: //depot/perl@31579 --- diff --git a/ext/Digest/SHA/t/allfcns.t b/ext/Digest/SHA/t/allfcns.t index 309f730..0c4fccb 100644 --- a/ext/Digest/SHA/t/allfcns.t +++ b/ext/Digest/SHA/t/allfcns.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw( hmac_sha1 hmac_sha1_base64 hmac_sha1_hex diff --git a/ext/Digest/SHA/t/base64.t b/ext/Digest/SHA/t/base64.t index 52531df..35e784f 100644 --- a/ext/Digest/SHA/t/base64.t +++ b/ext/Digest/SHA/t/base64.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha1_base64 sha224_base64 sha256_base64 sha384_base64 sha512_base64)); diff --git a/ext/Digest/SHA/t/bitbuf.t b/ext/Digest/SHA/t/bitbuf.t index d49380e..30b45b3 100644 --- a/ext/Digest/SHA/t/bitbuf.t +++ b/ext/Digest/SHA/t/bitbuf.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/dumpload.t b/ext/Digest/SHA/t/dumpload.t index 27f7a7d..af23807 100644 --- a/ext/Digest/SHA/t/dumpload.t +++ b/ext/Digest/SHA/t/dumpload.t @@ -4,7 +4,7 @@ use FileHandle; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha384_hex sha512_hex)); } diff --git a/ext/Digest/SHA/t/fips198.t b/ext/Digest/SHA/t/fips198.t index 7eda6e7..26ce363 100644 --- a/ext/Digest/SHA/t/fips198.t +++ b/ext/Digest/SHA/t/fips198.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(hmac_sha1_hex)); } diff --git a/ext/Digest/SHA/t/gg.t b/ext/Digest/SHA/t/gg.t index c96156d..dc2bddf 100644 --- a/ext/Digest/SHA/t/gg.t +++ b/ext/Digest/SHA/t/gg.t @@ -7,7 +7,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/gglong.t b/ext/Digest/SHA/t/gglong.t index f53464c..8abc7e6 100644 --- a/ext/Digest/SHA/t/gglong.t +++ b/ext/Digest/SHA/t/gglong.t @@ -8,7 +8,7 @@ use FileHandle; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/hmacsha.t b/ext/Digest/SHA/t/hmacsha.t index d6ce6c0..fe68374 100644 --- a/ext/Digest/SHA/t/hmacsha.t +++ b/ext/Digest/SHA/t/hmacsha.t @@ -5,7 +5,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(hmac_sha256_hex)); } diff --git a/ext/Digest/SHA/t/ireland.t b/ext/Digest/SHA/t/ireland.t index 9063a6d..c11968f 100644 --- a/ext/Digest/SHA/t/ireland.t +++ b/ext/Digest/SHA/t/ireland.t @@ -4,7 +4,7 @@ use FileHandle; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/methods.t b/ext/Digest/SHA/t/methods.t index 2d6f26d..637fc28 100644 --- a/ext/Digest/SHA/t/methods.t +++ b/ext/Digest/SHA/t/methods.t @@ -4,7 +4,7 @@ use FileHandle; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/nistbit.t b/ext/Digest/SHA/t/nistbit.t index e64527d..e9325e0 100644 --- a/ext/Digest/SHA/t/nistbit.t +++ b/ext/Digest/SHA/t/nistbit.t @@ -7,7 +7,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/nistbyte.t b/ext/Digest/SHA/t/nistbyte.t index 84ce722..3265bfa 100644 --- a/ext/Digest/SHA/t/nistbyte.t +++ b/ext/Digest/SHA/t/nistbyte.t @@ -7,7 +7,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw()); } diff --git a/ext/Digest/SHA/t/rfc2202.t b/ext/Digest/SHA/t/rfc2202.t index 2837ab6..adbd26f 100644 --- a/ext/Digest/SHA/t/rfc2202.t +++ b/ext/Digest/SHA/t/rfc2202.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(hmac_sha1_hex)); } diff --git a/ext/Digest/SHA/t/sha1.t b/ext/Digest/SHA/t/sha1.t index b3984b7..a9cb603 100644 --- a/ext/Digest/SHA/t/sha1.t +++ b/ext/Digest/SHA/t/sha1.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha1_hex)); } diff --git a/ext/Digest/SHA/t/sha224.t b/ext/Digest/SHA/t/sha224.t index 1b6abe3..ca327be 100644 --- a/ext/Digest/SHA/t/sha224.t +++ b/ext/Digest/SHA/t/sha224.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha224_hex)); } diff --git a/ext/Digest/SHA/t/sha256.t b/ext/Digest/SHA/t/sha256.t index 91f4457..3651f0c 100644 --- a/ext/Digest/SHA/t/sha256.t +++ b/ext/Digest/SHA/t/sha256.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha256_hex)); } diff --git a/ext/Digest/SHA/t/sha384.t b/ext/Digest/SHA/t/sha384.t index 4d1f6f3..7cf328f 100644 --- a/ext/Digest/SHA/t/sha384.t +++ b/ext/Digest/SHA/t/sha384.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha384_hex)); } diff --git a/ext/Digest/SHA/t/sha512.t b/ext/Digest/SHA/t/sha512.t index f491703..33e585d 100644 --- a/ext/Digest/SHA/t/sha512.t +++ b/ext/Digest/SHA/t/sha512.t @@ -3,7 +3,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(sha512_hex)); } diff --git a/ext/Digest/SHA/t/woodbury.t b/ext/Digest/SHA/t/woodbury.t index b8a9145..fab98b4 100644 --- a/ext/Digest/SHA/t/woodbury.t +++ b/ext/Digest/SHA/t/woodbury.t @@ -7,7 +7,7 @@ use strict; my $MODULE; BEGIN { - $MODULE = (-e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; + $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl"; eval "require $MODULE" || die $@; $MODULE->import(qw(hmac_sha256_hex hmac_sha384_hex hmac_sha512_hex)); }