X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2FRT96893_perlcc.t;h=53bb53a50c8fd1d4f51f3c0f069b0746b810e50a;hb=ether%2F5.6-scalar-util-weaken;hp=71e6404a9705e7e50eaeccf80756a263adbf8b14;hpb=cc891d20415522014bad117e2ba3c32f44b1c641;p=p5sagit%2FSub-Name.git diff --git a/t/RT96893_perlcc.t b/t/RT96893_perlcc.t index 71e6404..53bb53a 100644 --- a/t/RT96893_perlcc.t +++ b/t/RT96893_perlcc.t @@ -1,23 +1,30 @@ use strict; use warnings; -eval "use B::C;"; -if ($@) { - print "1..0 # SKIP B::C required for testing perlcc -O3\n"; - exit; -} elsif ($B::C::VERSION lt '1.48') { - print "1..0 # SKIP testing too old B-C-$B::C::VERSION\n"; - exit; -} else { - print "1..1\n"; -} +use Test::More; + +plan skip_all => 'B::C required for testing perlcc -O3' + unless eval { +require B::C; }; + +plan skip_all => 'B::C is too old (require 1.48, have ' . ($B::C::VERSION || 'undef') . ')' + unless eval { B::C->VERSION('1.48') }; + +plan skip_all => 'Devel::CheckBin required for looking for a perlcc executable' + unless eval { +require Devel::CheckBin }; + +plan skip_all => 'perlcc required' unless Devel::CheckBin::can_run('perlcc'); + +plan tests => 1; my $f = "t/rt96893x.pl"; open my $fh, ">", $f; END { unlink $f if $f } -print $fh 'use Sub::Name; subname("main::bar", sub{42}); print "ok 1\n";'; +print $fh 'use Sub::Name; subname("main::bar", sub{42}); print "# successfully ran subname() with perlcc\n";'; close $fh; system($^X, qw(-Mblib -S perlcc -O3 -UCarp -UConfig -r), $f); +local $TODO = 'experimental, for informational purposes only'; +is($? >> 8, 0, 'executable completed successfully'); + unlink "t/rt96893x", "t/rt96893x.exe"; # vim: ft=perl