This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactor t/thread_it.pl to use test.pl's skip_all_*() functions.
authorNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 21:03:20 +0000 (21:03 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 21:03:20 +0000 (21:03 +0000)
t/thread_it.pl

index feec254..cbe979f 100644 (file)
@@ -2,15 +2,14 @@
 use strict;
 use warnings;
 
-use Config;
-if (!$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;
-}
+# As perlfunc.pod says:
+# Note that the file will not be included twice under the same specified name.
+# So ensure that this, textually, is the same name as all the loaded tests use.
+# Otherwise if we require 'test.pl' and they require './test.pl', it is loaded
+# twice.
+require './test.pl';
+skip_all_without_config('useithreads');
+skip_all_if_miniperl("no dynamic loading on miniperl, no threads");
 
 require threads;