B::C v1.42 - Can't locate object method "___new_opt_obj" via package "Getopt::Long::Descriptive::Opts"

54 views
Skip to first unread message

Mark

unread,
Feb 15, 2012, 6:52:01 AM2/15/12
to perl-compiler
The following test fails with perl 5.14.2 and B::C 1.42 on x86_64/
Ubuntu 12.04.


# vim:set sw=4 ts=4 et ai smartindent fileformat=unix
fileencoding=utf-8 syntax=perl:
use Test::More tests => 7;

use B::C;

use File::Temp;
use File::Slurp qw(write_file);
use File::Spec;

my ($plvol,$pldir,$plbin) = File::Spec->splitpath($^X);
my $cc_harness_bin = File::Spec->catpath($plvol,$pldir,'cc_harness');
ok(-e $cc_harness_bin, 'cc_harness found');

my $tempdir = File::Temp->newdir;
my ($tvol,$tdir,$tfile) = File::Spec->splitpath($tempdir,1);
my $plsrcfn = File::Spec->catpath($tvol,$tdir,'test.pl');
my $cfn = File::Spec->catpath($tvol,$tdir,'test.c');
my $binfn = File::Spec->catpath($tvol,$tdir,'test');

write_file($plsrcfn, <<"EOF");
#!$^X
exit 123;
EOF
ok(system($^X, '-MO=C,-o'.$cfn, $plsrcfn)==0, 'C code generation');
ok(system($^X, $cc_harness_bin, '-o', $binfn, $cfn)==0, 'C code
compilation');
is(system($binfn), 123 << 8, 'binary execution');

# exit 0;

write_file($plsrcfn, <<"EOF");
#!$^X
use Getopt::Long::Descriptive;

my (\$opt, \$usage) = describe_options(
[ 'help', "print usage message and exit" ],
);

exit 124;
EOF
ok(system($^X, '-MO=C,-o'.$cfn, $plsrcfn)==0, 'C code generation');
ok(system($^X, $cc_harness_bin, '-o', $binfn, $cfn)==0, 'C code
compilation');
is(system($binfn), 124 << 8, 'binary execution');



rurban

unread,
Apr 3, 2012, 3:41:29 PM4/3/12
to perl-c...@googlegroups.com
use Getopt::Long::Descriptive;

my ($opt, $usage) = describe_options(
  [ 'help',       "print usage message and exit" ],
);  

Yes, this fails to work in 1.42 but works in git master. 
But the latest git code is still unstable.

Reply all
Reply to author
Forward
0 new messages