From: Steve Peters Date: Mon, 9 Jan 2006 14:27:07 +0000 (+0000) Subject: Added standard core header to test cases for Digest::SHA X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=41c686de0da47eeb5df94342ffc739979e9aa57d;p=p5sagit%2Fp5-mst-13.2.git Added standard core header to test cases for Digest::SHA p4raw-id: //depot/perl@26755 --- diff --git a/ext/Digest/SHA/t/0-pod-coverage.t b/ext/Digest/SHA/t/0-pod-coverage.t index f979796..6059400 100644 --- a/ext/Digest/SHA/t/0-pod-coverage.t +++ b/ext/Digest/SHA/t/0-pod-coverage.t @@ -1,4 +1,8 @@ BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } eval "use Test::More"; if ($@) { print "1..0 # Skipped: Test::More not installed\n"; diff --git a/ext/Digest/SHA/t/0-pod.t b/ext/Digest/SHA/t/0-pod.t index 1ec6bff..cb640fa 100644 --- a/ext/Digest/SHA/t/0-pod.t +++ b/ext/Digest/SHA/t/0-pod.t @@ -1,4 +1,9 @@ BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } + eval "use Test::More"; if ($@) { print "1..0 # Skipped: Test::More not installed\n"; diff --git a/ext/Digest/SHA/t/1-exist.t b/ext/Digest/SHA/t/1-exist.t index 07ced0e..82c9d20 100644 --- a/ext/Digest/SHA/t/1-exist.t +++ b/ext/Digest/SHA/t/1-exist.t @@ -1,5 +1,12 @@ use Test; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 1 } use Digest::SHA qw( diff --git a/ext/Digest/SHA/t/1-hello-world.t b/ext/Digest/SHA/t/1-hello-world.t index 6e5a0e6..4bf2392 100644 --- a/ext/Digest/SHA/t/1-hello-world.t +++ b/ext/Digest/SHA/t/1-hello-world.t @@ -2,6 +2,12 @@ use Test; use Digest::SHA qw(sha1); use strict; use integer; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} my(@vec, @rsp); diff --git a/ext/Digest/SHA/t/2-nist-sha-1.t b/ext/Digest/SHA/t/2-nist-sha-1.t index 18165bc..a91080e 100644 --- a/ext/Digest/SHA/t/2-nist-sha-1.t +++ b/ext/Digest/SHA/t/2-nist-sha-1.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha1_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-224.t b/ext/Digest/SHA/t/2-nist-sha-224.t index a1d4d8c..7dc5a18 100644 --- a/ext/Digest/SHA/t/2-nist-sha-224.t +++ b/ext/Digest/SHA/t/2-nist-sha-224.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha224_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-256.t b/ext/Digest/SHA/t/2-nist-sha-256.t index b4eeb67..a7d5d0c 100644 --- a/ext/Digest/SHA/t/2-nist-sha-256.t +++ b/ext/Digest/SHA/t/2-nist-sha-256.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha256_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-384.t b/ext/Digest/SHA/t/2-nist-sha-384.t index b993ca2..2ffd737 100644 --- a/ext/Digest/SHA/t/2-nist-sha-384.t +++ b/ext/Digest/SHA/t/2-nist-sha-384.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha384_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-512.t b/ext/Digest/SHA/t/2-nist-sha-512.t index b3317b8..f5fd311 100644 --- a/ext/Digest/SHA/t/2-nist-sha-512.t +++ b/ext/Digest/SHA/t/2-nist-sha-512.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha512_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-base64.t b/ext/Digest/SHA/t/2-nist-sha-base64.t index e3e9cda..8eccb80 100644 --- a/ext/Digest/SHA/t/2-nist-sha-base64.t +++ b/ext/Digest/SHA/t/2-nist-sha-base64.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha1_base64 sha224_base64 sha256_base64 sha384_base64 sha512_base64); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, $data); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-oo.t b/ext/Digest/SHA/t/2-nist-sha-oo.t index 72f6243..7af2edb 100644 --- a/ext/Digest/SHA/t/2-nist-sha-oo.t +++ b/ext/Digest/SHA/t/2-nist-sha-oo.t @@ -5,6 +5,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-vectors-bit.t b/ext/Digest/SHA/t/2-nist-vectors-bit.t index dfa133d..b17ad12 100644 --- a/ext/Digest/SHA/t/2-nist-vectors-bit.t +++ b/ext/Digest/SHA/t/2-nist-vectors-bit.t @@ -12,6 +12,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my @hashes; BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-vectors-byte.t b/ext/Digest/SHA/t/2-nist-vectors-byte.t index 8c817c0..51bae67 100644 --- a/ext/Digest/SHA/t/2-nist-vectors-byte.t +++ b/ext/Digest/SHA/t/2-nist-vectors-byte.t @@ -12,6 +12,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my @hashes; BEGIN { diff --git a/ext/Digest/SHA/t/3-gillogly-easy.t b/ext/Digest/SHA/t/3-gillogly-easy.t index 603c7ec..4a47363 100644 --- a/ext/Digest/SHA/t/3-gillogly-easy.t +++ b/ext/Digest/SHA/t/3-gillogly-easy.t @@ -7,6 +7,13 @@ use strict; use integer; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + # SHA-1 Test Vectors # # In the following we use the notation bitstring#n to mean a bitstring diff --git a/ext/Digest/SHA/t/3-gillogly-hard.t b/ext/Digest/SHA/t/3-gillogly-hard.t index db10a94..372f7c1 100644 --- a/ext/Digest/SHA/t/3-gillogly-hard.t +++ b/ext/Digest/SHA/t/3-gillogly-hard.t @@ -9,6 +9,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + # SHA-1 Test Vectors # # In the following we use the notation bitstring#n to mean a bitstring diff --git a/ext/Digest/SHA/t/4-bitstr-increasing.t b/ext/Digest/SHA/t/4-bitstr-increasing.t index 160a344..de39d79 100644 --- a/ext/Digest/SHA/t/4-bitstr-increasing.t +++ b/ext/Digest/SHA/t/4-bitstr-increasing.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 1 } my $i; diff --git a/ext/Digest/SHA/t/4-bitstr-large.t b/ext/Digest/SHA/t/4-bitstr-large.t index e1220ad..7ccc7a6 100644 --- a/ext/Digest/SHA/t/4-bitstr-large.t +++ b/ext/Digest/SHA/t/4-bitstr-large.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 1 } my $i; diff --git a/ext/Digest/SHA/t/4-bitstr-random.t b/ext/Digest/SHA/t/4-bitstr-random.t index 8c71c5a..cf4be92 100644 --- a/ext/Digest/SHA/t/4-bitstr-random.t +++ b/ext/Digest/SHA/t/4-bitstr-random.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 1 } my $reps = 8000000; diff --git a/ext/Digest/SHA/t/5-hmac-fips198.t b/ext/Digest/SHA/t/5-hmac-fips198.t index a6af342..422f485 100644 --- a/ext/Digest/SHA/t/5-hmac-fips198.t +++ b/ext/Digest/SHA/t/5-hmac-fips198.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(hmac_sha1_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec); BEGIN { diff --git a/ext/Digest/SHA/t/5-hmac-rfc2202.t b/ext/Digest/SHA/t/5-hmac-rfc2202.t index 6e77f3d..a3cc281 100644 --- a/ext/Digest/SHA/t/5-hmac-rfc2202.t +++ b/ext/Digest/SHA/t/5-hmac-rfc2202.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(hmac_sha1_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec); BEGIN { diff --git a/ext/Digest/SHA/t/5-hmac-sha-256.t b/ext/Digest/SHA/t/5-hmac-sha-256.t index 55731c8..619ce0c 100644 --- a/ext/Digest/SHA/t/5-hmac-sha-256.t +++ b/ext/Digest/SHA/t/5-hmac-sha-256.t @@ -5,6 +5,13 @@ use strict; use integer; use Digest::SHA qw(hmac_sha256_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@data); BEGIN { diff --git a/ext/Digest/SHA/t/5-hmac-woodbury.t b/ext/Digest/SHA/t/5-hmac-woodbury.t index d71af92..a9b9628 100644 --- a/ext/Digest/SHA/t/5-hmac-woodbury.t +++ b/ext/Digest/SHA/t/5-hmac-woodbury.t @@ -7,6 +7,13 @@ use strict; use integer; use Digest::SHA qw(hmac_sha256_hex hmac_sha384_hex hmac_sha512_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 21 } # Use RFC 2202 data/key values for 512-bit blocks diff --git a/ext/Digest/SHA/t/6-dump-load.t b/ext/Digest/SHA/t/6-dump-load.t index c369ac1..07d4774 100644 --- a/ext/Digest/SHA/t/6-dump-load.t +++ b/ext/Digest/SHA/t/6-dump-load.t @@ -5,6 +5,13 @@ use Digest::SHA qw(sha384_hex sha512_hex); use File::Basename qw(dirname); use File::Spec; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@sharsp); BEGIN { diff --git a/ext/Digest/SHA/t/7-ireland.t b/ext/Digest/SHA/t/7-ireland.t index 76ca9e2..5ddbcfd 100644 --- a/ext/Digest/SHA/t/7-ireland.t +++ b/ext/Digest/SHA/t/7-ireland.t @@ -4,6 +4,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + # David Ireland's test vector - SHA-256 digest of "a" x 536870912 # Adapted from Julius Duque's original script (t/24-ireland.tmp)