From: Peter Rabbitson Date: Sat, 31 Mar 2012 16:03:02 +0000 (+0200) Subject: Add a thread test (just runs the basic one in a thread) X-Git-Tag: Devel-GlobalDestruction-0.05~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=844f240882884d54202db803d8521f6d8652eabf;p=p5sagit%2FDevel-GlobalDestruction.git Add a thread test (just runs the basic one in a thread) --- diff --git a/t/basic.t b/t/01_basic.t similarity index 97% rename from t/basic.t rename to t/01_basic.t index 84db72a..8584247 100644 --- a/t/basic.t +++ b/t/01_basic.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl - use strict; use warnings; @@ -29,5 +27,3 @@ ok( defined &in_global_destruction, "exported" ); ok( !in_global_destruction(), "not in GD" ); our $sg = Test::Scope::Guard->new(sub { ok( in_global_destruction(), "in GD" ) }); - - diff --git a/t/02_thread.t b/t/02_thread.t new file mode 100644 index 0000000..0f26b0a --- /dev/null +++ b/t/02_thread.t @@ -0,0 +1,23 @@ +use Config; +BEGIN { + unless ($Config{useithreads}) { + print "1..0 # SKIP your perl does not support ithreads\n"; + exit 0; + } +} + +BEGIN { + unless (eval { require threads }) { + print "1..0 # SKIP threads.pm not installed\n"; + exit 0; + } +} + +use threads; +use warnings; +use strict; + +my $t = threads->create(sub { do 't/01_basic.t' }); +$t->join; + +exit 0;