From: Jarkko Hietaniemi Date: Sun, 17 Jun 2001 22:24:53 +0000 (+0000) Subject: Protect the (original) thread tests against testing if no 5.005 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0fcb073ca17b7658c8a82f28d44643e63d8c0a69;p=p5sagit%2Fp5-mst-13.2.git Protect the (original) thread tests against testing if no 5.005 threads have been configured. p4raw-id: //depot/perl@10673 --- diff --git a/ext/Thread/create.t b/ext/Thread/create.t index df8fc77..7cc8334 100644 --- a/ext/Thread/create.t +++ b/ext/Thread/create.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread 'async'; use Config; use Tie::Hash; diff --git a/ext/Thread/die.t b/ext/Thread/die.t index 6239405..1a65f14 100644 --- a/ext/Thread/die.t +++ b/ext/Thread/die.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread 'async'; $t = async { diff --git a/ext/Thread/die2.t b/ext/Thread/die2.t index f6b6955..4bc611a 100644 --- a/ext/Thread/die2.t +++ b/ext/Thread/die2.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread 'async'; $t = async { diff --git a/ext/Thread/io.t b/ext/Thread/io.t index 6012008..693d910 100644 --- a/ext/Thread/io.t +++ b/ext/Thread/io.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; sub counter { diff --git a/ext/Thread/join.t b/ext/Thread/join.t index cba2c1c..d24473f 100644 --- a/ext/Thread/join.t +++ b/ext/Thread/join.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; sub foo { print "In foo with args: @_\n"; diff --git a/ext/Thread/join2.t b/ext/Thread/join2.t index 99b43a5..04f244d 100644 --- a/ext/Thread/join2.t +++ b/ext/Thread/join2.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; sub foo { print "In foo with args: @_\n"; diff --git a/ext/Thread/list.t b/ext/Thread/list.t index f13f4b2..f03fa06 100644 --- a/ext/Thread/list.t +++ b/ext/Thread/list.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread qw(async); use Thread::Semaphore; diff --git a/ext/Thread/lock.t b/ext/Thread/lock.t index fefb129..b888787 100644 --- a/ext/Thread/lock.t +++ b/ext/Thread/lock.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; $level = 0; diff --git a/ext/Thread/queue.t b/ext/Thread/queue.t index 4672ba6..5c1a7e7 100644 --- a/ext/Thread/queue.t +++ b/ext/Thread/queue.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; use Thread::Queue; diff --git a/ext/Thread/specific.t b/ext/Thread/specific.t index da130b1..c2bf1a1 100644 --- a/ext/Thread/specific.t +++ b/ext/Thread/specific.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; use Thread::Specific qw(foo); diff --git a/ext/Thread/sync.t b/ext/Thread/sync.t index 6445b55..c5cf1a7 100644 --- a/ext/Thread/sync.t +++ b/ext/Thread/sync.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; $level = 0; diff --git a/ext/Thread/sync2.t b/ext/Thread/sync2.t index ffc74b4..ace0cbd 100644 --- a/ext/Thread/sync2.t +++ b/ext/Thread/sync2.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; $global = undef; diff --git a/ext/Thread/unsync.t b/ext/Thread/unsync.t index f0a51ef..51faa8c 100644 --- a/ext/Thread/unsync.t +++ b/ext/Thread/unsync.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; $| = 1; diff --git a/ext/Thread/unsync2.t b/ext/Thread/unsync2.t index fb955ac..0016646 100644 --- a/ext/Thread/unsync2.t +++ b/ext/Thread/unsync2.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; $| = 1; diff --git a/ext/Thread/unsync3.t b/ext/Thread/unsync3.t index e03e9c8..a1d2c56 100644 --- a/ext/Thread/unsync3.t +++ b/ext/Thread/unsync3.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; $| = 1; diff --git a/ext/Thread/unsync4.t b/ext/Thread/unsync4.t index 494ad2b..1186fc0 100644 --- a/ext/Thread/unsync4.t +++ b/ext/Thread/unsync4.t @@ -1,3 +1,15 @@ +BEGIN { + eval { require Config; import Config }; + if ($@) { + print "1..0 # Skip: no Config\n"; + exit(0); + } + if ($Config{extensions} !~ /\bThread\b/) { + print "1..0 # Skip: no use5005threads\n"; + exit(0); + } +} + use Thread; $| = 1;