Commit | Line | Data |
24f50a79 |
1 | use strict; |
2 | use warnings; |
3 | |
356a8ce3 |
4 | use Test::More; |
a31b59ba |
5 | use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; |
2b637511 |
6 | |
7 | plan skip_all => 'B::C required for testing perlcc -O3' |
88134f62 |
8 | unless eval { +require B::C; }; |
2b637511 |
9 | |
99bf1609 |
10 | plan skip_all => 'B::C is too old (require 1.48, have ' . ($B::C::VERSION || 'undef') . ')' |
2b637511 |
11 | unless eval { B::C->VERSION('1.48') }; |
24f50a79 |
12 | |
b099984f |
13 | plan skip_all => 'Devel::CheckBin required for looking for a perlcc executable' |
88134f62 |
14 | unless eval { +require Devel::CheckBin }; |
b099984f |
15 | |
16 | plan skip_all => 'perlcc required' unless Devel::CheckBin::can_run('perlcc'); |
c44463c5 |
17 | |
24f50a79 |
18 | my $f = "t/rt96893x.pl"; |
3aaa8d18 |
19 | open my $fh, ">", $f; END { unlink $f if $f } |
79187d26 |
20 | print $fh 'use Sub::Name; subname("main::bar", sub{42}); print "# successfully ran subname() with perlcc\n";'; |
24f50a79 |
21 | close $fh; |
22 | |
23 | system($^X, qw(-Mblib -S perlcc -O3 -UCarp -UConfig -r), $f); |
24 | |
79187d26 |
25 | local $TODO = 'experimental, for informational purposes only'; |
26 | is($? >> 8, 0, 'executable completed successfully'); |
27 | |
24f50a79 |
28 | unlink "t/rt96893x", "t/rt96893x.exe"; |
a31b59ba |
29 | |
30 | done_testing; |
24f50a79 |
31 | # vim: ft=perl |