summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/charnames.t1
-rw-r--r--lib/feature.t9
-rw-r--r--lib/strict.t8
-rw-r--r--lib/subs.t8
-rw-r--r--lib/warnings.t8
-rw-r--r--t/lib/common.pl4
6 files changed, 11 insertions, 27 deletions
diff --git a/lib/charnames.t b/lib/charnames.t
index f50076cf68..50c983726b 100644
--- a/lib/charnames.t
+++ b/lib/charnames.t
@@ -11,7 +11,6 @@ BEGIN {
$SIG{__WARN__} = sub { push @WARN, @_ };
}
-our $pragma_name = "charnames";
our $local_tests = 58;
# ---- For the alias extensions
diff --git a/lib/feature.t b/lib/feature.t
index a60644f442..0818f37c34 100644
--- a/lib/feature.t
+++ b/lib/feature.t
@@ -1,10 +1,5 @@
#!./perl
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
- $ENV{PERL5LIB} = '../lib';
-}
-
-our $pragma_name = "feature";
+chdir 't' if -d 't';
+@INC = '../lib';
require "../t/lib/common.pl";
diff --git a/lib/strict.t b/lib/strict.t
index 51e9b7387c..e067793b82 100644
--- a/lib/strict.t
+++ b/lib/strict.t
@@ -1,12 +1,8 @@
#!./perl
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
- $ENV{PERL5LIB} = '../lib';
-}
+chdir 't' if -d 't';
+@INC = '../lib';
-our $pragma_name = "strict";
our $local_tests = 4;
require "../t/lib/common.pl";
diff --git a/lib/subs.t b/lib/subs.t
index 1f719c7b78..4ad4f8f6ca 100644
--- a/lib/subs.t
+++ b/lib/subs.t
@@ -1,10 +1,6 @@
#!./perl
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
- $ENV{PERL5LIB} = '../lib';
-}
+chdir 't' if -d 't';
+@INC = '../lib';
-our $pragma_name = "subs";
require "../t/lib/common.pl";
diff --git a/lib/warnings.t b/lib/warnings.t
index d03b8c52c7..ee696fe2a1 100644
--- a/lib/warnings.t
+++ b/lib/warnings.t
@@ -1,11 +1,7 @@
#!./perl
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
- $ENV{PERL5LIB} = '../lib';
-}
+chdir 't' if -d 't';
+@INC = '../lib';
-our $pragma_name = "warnings";
our $UTF8 = (${^OPEN} || "") =~ /:utf8/;
require "../t/lib/common.pl";
diff --git a/t/lib/common.pl b/t/lib/common.pl
index d3bf149788..e5c9af4928 100644
--- a/t/lib/common.pl
+++ b/t/lib/common.pl
@@ -11,7 +11,9 @@ use File::Spec::Functions;
use strict;
use warnings;
-our $pragma_name;
+my (undef, $file) = caller;
+my ($pragma_name) = $file =~ /([A-Za-z_0-9]+)\.t$/
+ or die "Can't identify pragama to test from file name '$file'";
$| = 1;