summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-09-23 16:55:20 +0200
committerNicholas Clark <nick@ccl4.org>2011-09-24 09:23:30 +0200
commit208c2b5928c11c67c439adf62318358f0c010e16 (patch)
treeb03f49c222398ea9c3042641bee9f4789748964d /t
parentac9d8485fb211e8475e02d8564e9e64ac8fcbc25 (diff)
downloadperl-208c2b5928c11c67c439adf62318358f0c010e16.tar.gz
Refactor t/porting/regen.t to use TestInit q(T A);
Previously it had custom code to change directory to the top of the source tree, and to convert the library paths to absolute. TestInit has common code for this.
Diffstat (limited to 't')
-rw-r--r--t/porting/regen.t15
1 files changed, 2 insertions, 13 deletions
diff --git a/t/porting/regen.t b/t/porting/regen.t
index b644d700ad..a1483820e9 100644
--- a/t/porting/regen.t
+++ b/t/porting/regen.t
@@ -2,23 +2,12 @@
# Verify that all files generated by perl scripts are up to date.
-my ($in_t, $lib);
-
BEGIN {
- $in_t = -f 'TEST' && -f '../regen.pl';
- $lib = $in_t ? '../lib' : 'lib';
- unshift @INC, $lib;
+ @INC = '..' if -f '../TestInit.pm';
}
-
+use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
use strict;
-use File::Spec::Functions 'rel2abs';
-$^X = rel2abs($^X);
-$ENV{PERL5LIB} = rel2abs($lib);
-
-chdir '..' if $in_t;
-
-$INC[0] = 'lib';
require 'regen/regen_lib.pl';
require 't/test.pl';
$::NO_ENDING = $::NO_ENDING = 1;