This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move the special-case logic for $qr_embed_thr to regexp_qr_embed_thr.t
authorNicholas Clark <nick@ccl4.org>
Tue, 8 Mar 2011 09:02:31 +0000 (09:02 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 8 Mar 2011 09:02:31 +0000 (09:02 +0000)
t/re/regexp_qr_embed_thr.t is the only place that sets $::qr_embed_thr, so move
the special-case startup logic related to it from t/re/regexp.t to
t/re/regexp_qr_embed_thr.t. Use the skip_all_*() functions from test.pl

t/re/regexp.t
t/re/regexp_qr_embed_thr.t

index 5cb5186..9c430ad 100644 (file)
@@ -57,18 +57,6 @@ BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
 
-    if ($qr_embed_thr) {
-       require Config;
-       if (!$Config::Config{useithreads}) {
-           print "1..0 # Skip: no ithreads\n";
-               exit 0;
-       }
-       if ($ENV{PERL_CORE_MINITEST}) {
-           print "1..0 # Skip: no dynamic loading on miniperl, no threads\n";
-               exit 0;
-       }
-       require threads;
-    }
 }
 
 use strict;
index db89c1a..9c90c03 100644 (file)
@@ -1,11 +1,13 @@
 #!./perl
 
-$qr = 1;
-$qr_embed_thr = 1;
-for $file ('./re/regexp.t', './t/re/regexp.t', ':re:regexp.t') {
-    if (-r $file) {
-       do $file or die $@;
-       exit;
-    }
-}
-die "Cannot find ./re/regexp.t or ./t/re/regexp.t\n";
+chdir 't' if -d 't';
+require './test.pl';
+
+skip_all_without_config(useithreads);
+skip_all_if_miniperl("no dynamic loading on miniperl, no threads");
+require threads;
+
+$::qr = 1;
+$::qr_embed_thr = 1;
+
+require './re/regexp.t';