Skip Menu |
 

This queue is for tickets about the Perl6-Builtins CPAN distribution.

Report information
The Basics
Id: 17653
Status: open
Priority: 0/
Queue: Perl6-Builtins

People
Owner: Nobody in particular
Requestors: gsimmons [...] iinet.net.au
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.0.2
  • 0.0.3
Fixed in: (no value)



Subject: system.t: Closing *STDOUT fails testing of 'ls'
Test failure (t/system.t): On two tested Linux systems, closing the *STDOUT typeglob prior to executing 'ls' via system() results in a write error from 'ls' ("Bad File Descriptor"). As 'ls' cannot output to STDOUT, it consequently fails this test: gsimmons@nougat:~/Perl6-Builtins-0.0.3$ perl -Iblib/lib t/system.t ls: write error: Bad file descriptor not ok 1 - successful system command # Failed test 'successful system command' # in t/system.t at line 6. Can't exec "PAY_NO_ATTENTION_TO_THIS": No such file or directory at blib/lib/Perl6/Builtins.pm line 26. ok 2 - unsuccessful system command ls: write error: Bad file descriptor not ok 3 - successful deferred system command # Failed test 'successful deferred system command' # in t/system.t at line 10. ok 4 - successful value system command Can't exec "PAY_NO_ATTENTION_TO_THIS": No such file or directory at blib/lib/Perl6/Builtins.pm line 26. ok 5 - unsuccessful deferred system command ok 6 - unsuccessful value system command 1..6 # Looks like you failed 2 tests of 6. Commenting out close() or redirecting the output of 'ls' (eg. to /dev/null) results in a successful test. Test results with 'close *STDOUT' commented shown below: gsimmons@nougat:~/Perl6-Builtins-0.0.3$ perl -Iblib/lib t/system.t Build.PL Changes MANIFEST META.yml Makefile Makefile.PL README blib lib pm_to_blib t ok 1 - successful system command Can't exec "PAY_NO_ATTENTION_TO_THIS": No such file or directory at blib/lib/Perl6/Builtins.pm line 26. ok 2 - unsuccessful system command Build.PL Changes MANIFEST META.yml Makefile Makefile.PL README blib lib pm_to_blib t ok 3 - successful deferred system command ok 4 - successful value system command Can't exec "PAY_NO_ATTENTION_TO_THIS": No such file or directory at blib/lib/Perl6/Builtins.pm line 26. ok 5 - unsuccessful deferred system command ok 6 - unsuccessful value system command 1..6 Tested against Perl6::Builtins v0.0.3 and v0.0.2. Test environments: Linux: SUSE Enterprise Server 9 - kernel 2.6.5-7.191-smp - perl 5.8.3 Linux: Debian 3.1 - kernel 2.4.31 - perl 5.8.4
Subject: Re: [rt.cpan.org #17653] system.t: Closing *STDOUT fails testing of 'ls'
Date: Wed, 15 Feb 2006 22:51:24 +1100
To: bug-Perl6-Builtins [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Guest via RT wrote: Show quoted text
> On two tested Linux systems, closing the *STDOUT typeglob prior to > executing 'ls' via system() results in a write error from 'ls' ("Bad > File Descriptor").
Could you please test the following revision to t/system.t on the two systems? -----cut----------cut----------cut----------cut----------cut----- use Perl6::Builtins qw( system ); use Test::More qw( no_plan ); my $dummy; close *STDOUT; open *STDOUT, '>', \$dummy; close *STDERR; open *STDOUT, '>', \$dummy; ok system('ls') => 'successful system command'; ok !system('PAY_NO_ATTENTION_TO_THIS') => 'unsuccessful system command'; my $good = system('ls'); ok $good => 'successful deferred system command'; ok !length $good => 'successful value system command'; my $bad = system('PAY_NO_ATTENTION_TO_THIS'); ok !$bad => 'unsuccessful deferred system command'; ok length $bad => 'unsuccessful value system command'; -----cut----------cut----------cut----------cut----------cut----- Thanks, Damian
From: Geoff Simmons
Download (untitled) / with headers
text/plain 781b
On Wed Feb 15 06:52:33 2006, damian@conway.org wrote: Show quoted text
> Could you please test the following revision to t/system.t on the two > systems?
Sure thing. On both systems, two of the six system.t tests fail as before, with the "Bad file descriptor" message no longer present: gsimmons@nougat:~/Perl6-Builtins-0.0.3$ perl -Iblib/lib t/system.t not ok 1 - successful system command # Failed test 'successful system command' # in t/system.t at line 8. ok 2 - unsuccessful system command not ok 3 - successful deferred system command # Failed test 'successful deferred system command' # in t/system.t at line 12. ok 4 - successful value system command ok 5 - unsuccessful deferred system command ok 6 - unsuccessful value system command 1..6 # Looks like you failed 2 tests of 6.
Subject: Re: [rt.cpan.org #17653] system.t: Closing *STDOUT fails testing of 'ls'
Date: Thu, 16 Feb 2006 09:49:43 +1100
To: bug-Perl6-Builtins [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
>>Could you please test the following revision to t/system.t on the two >>systems?
> > Sure thing. On both systems, two of the six system.t tests fail as > before, with the "Bad file descriptor" message no longer present
Thanks. How about this version? -----cut----------cut----------cut----------cut----------cut----- use Perl6::Builtins qw( system ); use Test::More qw( no_plan ); my $dummy; close *STDERR; open *STDOUT, '>', \$dummy; ok system('cat /dev/null') => 'successful system command'; ok !system('PAY_NO_ATTENTION_TO_THIS') => 'unsuccessful system command'; my $good = system('cat /dev/null'); ok $good => 'successful deferred system command'; ok !length $good => 'successful value system command'; my $bad = system('PAY_NO_ATTENTION_TO_THIS'); ok !$bad => 'unsuccessful deferred system command'; ok length $bad => 'unsuccessful value system command'; -----cut----------cut----------cut----------cut----------cut-----
From: Geoff Simmons
Download (untitled) / with headers
text/plain 2.6k
On Wed Feb 15 17:50:42 2006, damian@conway.org wrote: Show quoted text
> Thanks. How about this version?
All system.t tests now pass (on both Linux systems): gsimmons@nougat:~/Perl6-Builtins-0.0.3$ perl -Iblib/lib t/system.t ok 1 - successful system command ok 2 - unsuccessful system command ok 3 - successful deferred system command ok 4 - successful value system command ok 5 - unsuccessful deferred system command ok 6 - unsuccessful value system command 1..6 Unfortunately, this breaks on Win32, owing to the absence of the '/dev/null' bitbucket and 'cat' command: C:\Perl6-Builtins-0.0.3>perl -Iblib/lib t/system.t not ok 1 - successful system command # Failed test (t/system.t at line 7) ok 2 - unsuccessful system command not ok 3 - successful deferred system command # Failed test (t/system.t at line 11) not ok 4 - successful value system command # Failed test (t/system.t at line 12) ok 5 - unsuccessful deferred system command ok 6 - unsuccessful value system command 1..6 # Looks like you failed 3 tests of 6. The original system.t tests (as supplied in Perl6::Builtins 0.0.3) all pass on Win32, but with the 'ls' output shown: C:\Perl6-Builtins-0.0.3>perl -Iblib/lib t/system.t . .. blib build.pl changes lib makefile makefile.pl manifest meta.yml pm_to_~1 readme t ok 1 - successful system command 'PAY_NO_ATTENTION_TO_THIS' is not recognized as an internal or external command, operable program or batch file. ok 2 - unsuccessful system command . .. blib build.pl changes lib makefile makefile.pl manifest meta.yml pm_to_~1 readme t ok 3 - successful deferred system command ok 4 - successful value system command 'PAY_NO_ATTENTION_TO_THIS' is not recognized as an internal or external command, operable program or batch file. ok 5 - unsuccessful deferred system command ok 6 - unsuccessful value system command 1..6 Attached is a patch that uses 'type NUL' for the null command, when executed on Win32 systems. This revised system.t still fails test number 4 however ("system value command"): C:\Perl6-Builtins-0.0.3>perl -Iblib/lib t/system.t ok 1 - successful system command ok 2 - unsuccessful system command ok 3 - successful deferred system command not ok 4 - successful value system command # Failed test (t/system.t at line 14) ok 5 - unsuccessful deferred system command ok 6 - unsuccessful value system command 1..6 # Looks like you failed 1 test of 6. New test environment: Windows 2000 - 5.00.2195 (Service Pack 4) - perl 5.8.7 (ActiveState ActivePerl build 813)
Download system.t-patch
application/octet-stream 625b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #17653] system.t: Closing *STDOUT fails testing of 'ls'
Date: Fri, 17 Feb 2006 10:39:06 +1100
To: bug-Perl6-Builtins [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Download (untitled) / with headers
text/plain 1.1k
Show quoted text
> All system.t tests now pass (on both Linux systems): > > Unfortunately, this breaks on Win32, owing to the absence of the > '/dev/null' bitbucket and 'cat' command
Hmmmmmmm. Tricky. But I *will* solve this! ;-) How about this version instead? -----cut----------cut----------cut----------cut----------cut----- BEGIN { exit if @ARGV } use Perl6::Builtins qw( system ); use Test::More qw( no_plan ); my $dummy; close *STDERR; open *STDERR, '>', \$dummy; my $GOOD_CMD = "perl $0 run silent"; my $BAD_CMD = "PAY_NO_ATTENTION_TO_THIS"; ok system($GOOD_CMD) => 'successful system command'; ok !system($BAD_CMD) => 'unsuccessful system command'; my $good = system($GOOD_CMD); ok $good => 'successful deferred system command'; ok !length $good => 'successful value system command'; my $bad = system($BAD_CMD); ok !$bad => 'unsuccessful deferred system command'; ok length $bad => 'unsuccessful value system command'; -----cut----------cut----------cut----------cut----------cut----- Thanks for continuing to work with me on this. Damian
From: Geoff Simmons
Download (untitled) / with headers
text/plain 937b
On Thu Feb 16 18:40:08 2006, damian@conway.org wrote: Show quoted text
> Hmmmmmmm. Tricky. But I *will* solve this! ;-) > How about this version instead?
All tests pass on Win32: C:\Perl6-Builtins-0.0.3>perl -Iblib/lib t/system.t ok 1 - successful system command ok 2 - unsuccessful system command ok 3 - successful deferred system command ok 4 - successful value system command ok 5 - unsuccessful deferred system command ok 6 - unsuccessful value system command 1..6 ... and continue to pass on the Linux systems: gsimmons@nougat:~/Perl6-Builtins-0.0.3$ perl -Iblib/lib t/system.t ok 1 - successful system command ok 2 - unsuccessful system command ok 3 - successful deferred system command ok 4 - successful value system command ok 5 - unsuccessful deferred system command ok 6 - unsuccessful value system command 1..6 I think you have a winner. :) Show quoted text
> Thanks for continuing to work with me on this.
Not a problem, thank you for your help. Geoff
Subject: Re: [rt.cpan.org #17653] system.t: Closing *STDOUT fails testing of 'ls'
Date: Tue, 21 Feb 2006 11:22:13 +1100
To: bug-Perl6-Builtins [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Download (untitled) / with headers
text/plain 235b
Show quoted text
> I think you have a winner. :)
Awesome. Thanks, Geoff. I'm extending the module at the moment and updating it to track changes in the Perl 6 design, so it'll be a short while before the update hits the CPAN. All the best, Damian


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.