Subject: | Windows shell hardcoded to obsoleted 'command.com' (t/run test 19 fails on XP x64) |
t/run test 19 fails on XP x64 complaining that it can't find 'command'.
This is because the Windows shell has changed from command.com to
cmd.exe. In earlier versions of XP 32-bit both were available, but in
the 64-bit version command.com has been removed. This probably also
applies to later versions of the OS. I haven't found authoritative
documentation on which versions of Windows no longer have command.com.
The problem occurs due to this code (in 0.82 at line 1653 of lib/Run.pm):
if ( Win32_MODE ) {
@args = ( [ qw( command /c ), win32_parse_cmd_line $_[0] ] );
}
If this is changed to:
if ( Win32_MODE ) {
@args = ( [ qw( cmd /c ), win32_parse_cmd_line $_[0] ] );
}
Then the test will pass. However, this is not an acceptable patch
because it would break older OS which do not have cmd.exe. The OS
version needs to be checked before deciding whether to use command.com
or cmd.exe. With this change, all tests pass.
Without this change:
C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,
'blib\lib',
'blib\arch')" t/*.t
t/adopt............skipped
all skipped: adopt not implemented yet
t/binmode..........ok
t/bogus............ok
1/2 skipped: Can't really exec() MSWin32
t/filter...........ok
t/harness..........ok
t/io...............ok
9/14 skipped: MSWin32 does not allow select() on non-sockets
t/kill_kill........skipped
all skipped: Temporarily ignoring test failure on Win32
t/parallel.........ok
t/pty..............skipped
all skipped: IO::Pty not installed
t/pump.............ok
t/run..............ok 1/266Command 'command' not found in
C:\Perl\site\bin, C:\P
erl\bin, C:\Perl64\site\bin, C:\Perl64\bin, C:\WINDOWS\system32,
C:\WINDOWS, C:\
WINDOWS\System32\Wbem at t/run.t line 38
# Looks like you planned 266 tests but only ran 19.
# Looks like your test died just after 19.
t/run..............dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 20-266
Failed 247/266 tests, 7.14% okay
t/signal...........skipped
all skipped: Skipping on Win32
t/timeout..........ok
t/timer............ok
t/win32_compile....ok
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/run.t 255 65280 266 494 185.71% 20-266
4 tests and 10 subtests skipped.
Failed 1/15 test scripts, 93.33% okay. 247/637 subtests failed, 61.22% okay.
dmake: Error code 255, while making 'test_dynamic'