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