From 9183dde4074a1439c082243c3db81aa5c53698b5 Mon Sep 17 00:00:00 2001 From: Florian Ragwitz Date: Tue, 25 Jan 2011 17:16:06 +0100 Subject: [PATCH] Allow Devel::DProf's tests to run without text.pl This allows us to run the tests outside of the core. --- ext/Devel-DProf/t/DProf.t | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ext/Devel-DProf/t/DProf.t b/ext/Devel-DProf/t/DProf.t index 7d3a170..c5e1d7b 100644 --- a/ext/Devel-DProf/t/DProf.t +++ b/ext/Devel-DProf/t/DProf.t @@ -1,11 +1,17 @@ #!perl BEGIN { - require 'test.pl'; # for which_perl() etc - require Config; import Config; - if ($Config{'extensions'} !~ /\bDevel\/DProf\b/){ - print "1..0 # Skip: Devel::DProf was not built\n"; - exit 0; + if ($ENV{PERL_CORE}) { + require 'test.pl'; # for which_perl() etc + require Config; import Config; + if ($Config{'extensions'} !~ /\bDevel\/DProf\b/){ + print "1..0 # Skip: Devel::DProf was not built\n"; + exit 0; + } + $perl = which_perl(); + } + else { + $perl = $^X; } } @@ -26,7 +32,7 @@ getopts('vI:p:'); $path_sep = $Config{path_sep} || ':'; $perl5lib = $opt_I || join( $path_sep, @INC ); -$perl = $opt_p || which_perl(); +$perl = $opt_p if $opt_p; if( $opt_v ){ print "tests: @tests\n"; -- 2.7.4