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
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;
#!./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';