Skip Menu |

This queue is for tickets about the String-ShellQuote CPAN distribution.

Report information
The Basics
Id: 46445
Status: resolved
Priority: 0/
Queue: String-ShellQuote

People
Owner: ROSCH [...] cpan.org
Requestors: dolmen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.03
Fixed in: (no value)



Subject: Test failures on Win32
Tests involving 'via_shell' do not pass on Win32: "open PIPE, '-|'" fails. See also the CPAN Testers reports. http://www.cpantesters.org/distro/S/String-ShellQuote.html#String-ShellQuote-1.03 Here is the "dmake test TEST_VERBOSE=1" on strawberry Perl 5.10. -------8<------8------- 1..31 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok 8 ok 9 ok 10 ok 11 ok 12 ok 13 ok 14 ok 15 ok 16 ok 17 ok 18 ok 19 ok 20 ok 21 ok 22 ok 23 ok 24 ok 25 ok 26 ok 27 '-' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes. not ok 28 # line 104 # wanted [] # got [blib/script/shell-quote failed: non-zero exit 256 ] '-' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes. not ok 29 # line 105 # wanted [a ] # got [blib/script/shell-quote failed: non-zero exit 256 ] '-' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes. not ok 30 # line 106 # wanted ['' ] # got [blib/script/shell-quote failed: non-zero exit 256 ] '-' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes. not ok 31 # line 107 # wanted [foo 'bar baz' '*' ] # got [blib/script/shell-quote failed: non-zero exit 256 ] Failed 4/31 subtests Test Summary Report ------------------- test.t (Wstat: 0 Tests: 31 Failed: 4) Failed tests: 28-31 Files=1, Tests=31, 1 wallclock secs ( 0.03 usr + 0.02 sys = 0.05 CPU) Result: FAIL Failed 1/1 test programs. 4/31 subtests failed. dmake: Error code 255, while making 'test_dynamic' -------8<------8-------
Here is a patch that skip the failing tests on Win32: the failing tests are testing the shell-quote script in a way that will never work on Win32. Also it disables shell-quote script install as it currently does not escape for the Win32 shell (cmd.exe). Also attached a distropref to apply it automatically with CPAN.pm.
# RT46445-win32 # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # STEP 2: Run the 'patch' program with this file as input. # #### End of Preamble #### #### Patch data follows #### diff -urp --binary "String-ShellQuote-1.03\Makefile.PL" "String-ShellQuote-1.03.RT46445\Makefile.PL" Index: ./Makefile.PL Prereq: 1.4 --- ./Makefile.PL Tue May 3 12:44:03 2005 +++ ./Makefile.PL Thu May 28 19:11:53 2009 @@ -9,7 +9,11 @@ use ExtUtils::MakeMaker; WriteMakefile( NAME => 'String::ShellQuote', VERSION_FROM => 'ShellQuote.pm', - EXE_FILES => ['shell-quote'], + ( + $^O eq 'MSWin32' + ? () + : (EXE_FILES => ['shell-quote']) + ), dist => { PREOP => '$(MAKE) ci', CI => 'cvs commit', diff -urp --binary "String-ShellQuote-1.03\test.t" "String-ShellQuote-1.03.RT46445\test.t" Index: ./test.t Prereq: 1.4 --- ./test.t Tue May 3 12:53:33 2005 +++ ./test.t Thu May 28 19:03:24 2009 @@ -19,10 +19,10 @@ sub ok { my ($result, @info) = @_; $test_num++; if ($result) { - print "ok $test_num\n"; + print "ok $test_num\n"; } else { - print "not ok $test_num\n"; + print "not ok $test_num\n"; print "# ", @info, "\n" if @info; } } @@ -86,8 +86,8 @@ sub via_shell { defined $pid or return "can't fork: $!\n"; if (!$pid) { - if (!open STDERR, '>&STDOUT') { - print "$0: can't dup stdout: $!\n"; + if (!open STDERR, '>&STDOUT') { + print "$0: can't dup stdout: $!\n"; exit 1; } exec $cmd, @args @@ -100,8 +100,13 @@ sub via_shell { return $r; } -$testsub = \&via_shell; -test ''; -test qq{a\n}, 'a'; -test qq{''\n}, ''; -test qq{foo 'bar baz' '*'\n}, 'foo', 'bar baz', '*'; +if ($^O eq 'MSWin32') { + print "ok # Skip Not working on MSWin32\n" x 4; +} else { + + $testsub = \&via_shell; + test ''; + test qq{a\n}, 'a'; + test qq{''\n}, ''; + test qq{foo 'bar baz' '*'\n}, 'foo', 'bar baz', '*'; +} #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Thu May 28 19:16:18 2009 # Generated by : makepatch 2.03 # Recurse directories : Yes # Excluded files : (\A|/).*\~\Z # (\A|/).*\.a\Z # (\A|/).*\.bak\Z # (\A|/).*\.BAK\Z # (\A|/).*\.elc\Z # (\A|/).*\.exe\Z # (\A|/).*\.gz\Z # (\A|/).*\.ln\Z # (\A|/).*\.o\Z # (\A|/).*\.obj\Z # (\A|/).*\.olb\Z # (\A|/).*\.old\Z # (\A|/).*\.orig\Z # (\A|/).*\.rej\Z # (\A|/).*\.so\Z # (\A|/).*\.Z\Z # (\A|/)\.del\-.*\Z # (\A|/)\.make\.state\Z # (\A|/)\.nse_depinfo\Z # (\A|/)core\Z # (\A|/)tags\Z # (\A|/)TAGS\Z # p "Makefile.PL" 541 1243530713 0100666 # p "test.t" 2470 1243530204 0100666 #### End of ApplyPatch data #### #### End of Patch kit [created: Thu May 28 19:16:18 2009] #### #### Patch checksum: 101 3037 62263 #### #### Checksum: 119 3675 49202 ####
--- comment: "RT46445-win32" match: distribution: "^ROSCH/String-ShellQuote-1.03.tar.gz$" patches: - "DOLMEN/patches/String-ShellQuote-1.03-ROSCH-RT46445.patch"
Could you review the patch? -- Olivier Mengué - http://o.mengue.free.fr/
Le Dim 25 Avr 2010 18:27:25, DOLMEN a écrit : Show quoted text
> Could you review the patch?
This bug is blocking the distribution of String::ShellQuote on Windows platforms and on ActiveState automated PPM packaging in particular. So this is blocking distribution of modules that use it such as my new Parse::nm. Could you apply the patch? I would be ready to apply for co-maintainership if you need help. -- Olivier Mengué - http://o.mengue.free.fr/
Here is an ActiveState log output: http://ppm4.activestate.com/MSWin32-x86/5.8/825/R/RO/ROSCH/String-ShellQuote-1.03.d/log-20090914T215911.txt And your index page for all your ActiveState automated packaging reports: http://ppm4.activestate.com/author/ROSCH.html -- Olivier Mengué - http://o.mengue.free.fr/
Subject: Re: [rt.cpan.org #46445] [PATCH] script/shell-quote tests failures on Win32
Date: Mon, 7 Jun 2010 08:58:40 -0400
To: Olivier 'dolmen' Mengué via RT <bug-String-ShellQuote [...] rt.cpan.org>
From: Roderick Schertler <roderick [...] ibcinc.com>
Sorry I never responded to this. I'll try to upload it this morning. -- Roderick Schertler <roderick@ibcinc.com> +1-434-963-4034