nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

Using Test::Simple or Test::More produces BEGIN block file handle errors #336

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Try to compile the following with no special perlcc flags:

-- snip --
#! /usr/bin/perl

use Test::More ('tests' => 1);

ok(1, 'Test::More works');
-- snip --

perlcc invocation and output:

-- snip --
$ /usr/local/perl-5.14d-nt/bin/perlcc test.pl
/usr/local/perl-5.14.4d-nt/bin/perlcc: Unexpected compiler output
Warning: Write BEGIN-block Test::Builder::$Testout to FileHandle > &6
 Warning: Write BEGIN-block Test::Builder::$Testerr to FileHandle > &7
-- snip --

Expected output from perlcc: Nothing.

Compiled output invocation and output:

-- snip --
$ ./test
print() on unopened filehandle $Testout at 
/usr/local/perl-5.14.4d-nt/lib/5.14.4/Test/Builder.pm line 1759.
-- snip --

Expected test program output: 

-- snip --
1..1
ok 1 - Test::More works
-- snip --

The problem also occurs with Test::Simple.

Using perlcc 1.45_11, mainline c517916, built under a non-threaded debugging 
Perl 5.14.4.  Same results under a non-debugging, non-threaded Perl 5.14.4.

Original issue reported on code.google.com by erin.schoenhals on 9 May 2014 at 11:01

GoogleCodeExporter commented 9 years ago
Read the docs. There's a special perlcc flag to overcome this Test::Harness 
problem

--testsuite
           Tries be nice to Test:: modules, like preallocating the file
           handles 4 and 5, and munge the output of BEGIN.

             perlcc -r --testsuite t/harness

Original comment by reini.urban on 9 May 2014 at 11:12