X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVPIT-TestHelpers.git;a=blobdiff_plain;f=t%2F44-threads-too-late.t;fp=t%2F44-threads-too-late.t;h=f5fa9f4a3751690d9aba0bdac9ad189f04cecee4;hp=5eea92a4bf68607e2d7ad9fbedeffa7e0cca68db;hb=c9ae9f1b1179b6241fed5883450f6a39a88ef5e7;hpb=ab33575c14a06487f6779b29ab3919291ce0c219 diff --git a/t/44-threads-too-late.t b/t/44-threads-too-late.t index 5eea92a..f5fa9f4 100644 --- a/t/44-threads-too-late.t +++ b/t/44-threads-too-late.t @@ -5,8 +5,25 @@ use warnings; BEGIN { $ENV{PERL_FORCE_TEST_THREADS} = 1 } -use Test::More tests => 1; +use Test::More; -local $@; -eval 'use VPIT::TestHelpers "threads";'; -like $@, qr/was loaded too soon/, 'cannot use the threads feature after Test::More was loaded'; +use Config; +plan skip_all => 'Cannot test late loading on a non threaded perl' + unless $Config::Config{useithreads}; + +plan tests => 2; + +{ + local $@; + eval 'use VPIT::TestHelpers "threads";'; + like $@, qr/^Test::More was loaded too soon/, + 'cannot use the threads feature after Test::More was loaded'; +} + +SKIP: { + local $@; + eval { require Test::Leaner; 1 } or skip 'No Test::Leaner available' => 1; + eval 'use VPIT::TestHelpers "threads";'; + like $@, qr/^Test::Leaner was loaded too soon/, + 'cannot use the threads feature after Test::Leaner was loaded'; +}