in reply to IPC::Open3 failure on Win32

What is in $command ? Most likely that's the reason why the open3 call is failing ... Win32 shell invocations are tricky and if calling Perl scripts you'll likely have to make sure to prepend a (properly quoted) $^X.

Replies are listed 'Best First'.
Re^2: IPC::Open3 failure on Win32
by Ovid (Cardinal) on Jan 09, 2007 at 19:28 UTC

    One example would be:

    /usr/local/bin/perl  t/010-regression.t

    I forgot to mention that apparently this is apparently only failing for my t/010-regression.t tests. The other tests all appear to be fine (and all use the same open3 command). The difference in the regression tests is that they run a bunch of tests in the t/sample-tests/ directory. So I have a test program, t/010-regression.t, which is run via the open3 command (apparently successfully), which in turn tries to run other tests via the open3 command (unsuccessfully) and generates the error above.

    I'll repost this bit in the root node as people sometimes don't notice the replies.

    Cheers,
    Ovid

    New address of my CGI Course.

      It's unlikely that, on Windows, there will be a perl in /usr/local/bin/perl. I can reproduce what you find locally with my Perl 5.8.5. I patched your module and made it output the strings and they look like the following:

      Spawning >>c:\perl\5826ED~1.5\bin\perl.exe -Ilib t\sample-tests\too_m +any<< at lib/TAPx/Parser/Source.pm line 103.

      I don't know who or what is unhappy with the whole being a string instead of being a list, but when I patch it to split the string on whitespace just to use it as a list, it works and I get failures due to whitespace issues in your tests (newlines look different on Win32):

      my @command = split / +/, $command; warn sprintf "Spawning >>%s<<", join "*", @command; if ( my $pid = open3( undef, $stdout_handle, undef, @command ) ) {

      So it looks like you have to rework your API so you pass around lists instead of strings to execute, and you'll have to rework your tests so newlines and trailing whitespace aren't significant anymore.

      ... Spawning >>c:\perl\5826ED~1.5\bin\perl.exe*-Ilib*t\sample-tests\too_ma +ny<< at lib/TAPx/Parser/Source .pm line 104. ok 2316 - too_many 1 We should have a result for 1..3 ok 2317 - ... and is_plan should return a reasonable value ok 2318 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::passed ok 2319 - ... and passed should return a reasonable value ok 2320 - ... and tests_planned should return the correct answer ok 2321 - ... and is_ok should return a reasonable value not ok 2322 - ... and raw should return the correct answer # Failed test '... and raw should return the correct answer' # in t\010-regression.t at line 2312. ' got: '1..3 # expected: '1..3' ok 2323 - too_many 2 We should have a result for ok 2324 - ... and has_skip should return a reasonable value ok 2325 - ... and is_test should return a reasonable value ok 2326 - ... and number should return the correct answer ok 2327 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::actual_passed ok 2328 - ... and actual_passed should return a reasonable value ok 2329 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::passed ok 2330 - ... and passed should return a reasonable value ok 2331 - ... and is_ok should return a reasonable value ok 2332 - ... and description should return the correct answer ok 2333 - ... and is_actual_ok should return a reasonable value ok 2334 - ... and has_todo should return a reasonable value ok 2335 - too_many 3 We should have a result for ok 2336 - ... and has_skip should return a reasonable value ok 2337 - ... and is_test should return a reasonable value ok 2338 - ... and number should return the correct answer ok 2339 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::actual_passed ok 2340 - ... and actual_passed should return a reasonable value ok 2341 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::passed ok 2342 - ... and passed should return a reasonable value ok 2343 - ... and description should return the correct answer ok 2344 - ... and is_ok should return a reasonable value ok 2345 - ... and is_actual_ok should return a reasonable value ok 2346 - ... and has_todo should return a reasonable value ok 2347 - too_many 4 We should have a result for ok 2348 - ... and has_skip should return a reasonable value ok 2349 - ... and is_test should return a reasonable value ok 2350 - ... and number should return the correct answer ok 2351 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::actual_passed ok 2352 - ... and actual_passed should return a reasonable value ok 2353 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::passed ok 2354 - ... and passed should return a reasonable value ok 2355 - ... and description should return the correct answer ok 2356 - ... and is_ok should return a reasonable value ok 2357 - ... and is_actual_ok should return a reasonable value ok 2358 - ... and has_todo should return a reasonable value ok 2359 - too_many 5 We should have a result for ok 2360 - ... and has_skip should return a reasonable value ok 2361 - ... and is_test should return a reasonable value ok 2362 - ... and number should return the correct answer ok 2363 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::actual_passed ok 2364 - ... and actual_passed should return a reasonable value ok 2365 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::passed ok 2366 - ... and passed should return a reasonable value ok 2367 - ... and description should return the correct answer ok 2368 - ... and is_ok should return a reasonable value ok 2369 - ... and is_actual_ok should return a reasonable value ok 2370 - ... and has_todo should return a reasonable value ok 2371 - too_many 6 We should have a result for ok 2372 - ... and has_skip should return a reasonable value ok 2373 - ... and is_test should return a reasonable value ok 2374 - ... and number should return the correct answer ok 2375 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::actual_passed ok 2376 - ... and actual_passed should return a reasonable value ok 2377 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::passed ok 2378 - ... and passed should return a reasonable value ok 2379 - ... and description should return the correct answer ok 2380 - ... and is_ok should return a reasonable value ok 2381 - ... and is_actual_ok should return a reasonable value ok 2382 - ... and has_todo should return a reasonable value ok 2383 - too_many 7 We should have a result for ok 2384 - ... and has_skip should return a reasonable value ok 2385 - ... and is_test should return a reasonable value ok 2386 - ... and number should return the correct answer ok 2387 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::actual_passed ok 2388 - ... and actual_passed should return a reasonable value ok 2389 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::passed ok 2390 - ... and passed should return a reasonable value ok 2391 - ... and description should return the correct answer ok 2392 - ... and is_ok should return a reasonable value ok 2393 - ... and is_actual_ok should return a reasonable value ok 2394 - ... and has_todo should return a reasonable value ok 2395 - too_many 8 We should have a result for ok 2396 - ... and has_skip should return a reasonable value ok 2397 - ... and is_test should return a reasonable value ok 2398 - ... and number should return the correct answer ok 2399 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::actual_passed ok 2400 - ... and actual_passed should return a reasonable value ok 2401 - ... we should get a deprecated warning for TAPx::Parser::Res +ults::Test::passed ok 2402 - ... and passed should return a reasonable value ok 2403 - ... and description should return the correct answer ok 2404 - ... and is_ok should return a reasonable value ok 2405 - ... and is_actual_ok should return a reasonable value ok 2406 - ... and has_todo should return a reasonable value ok 2407 - ... and we should have the correct number of results ok 2408 - 'too_many' should parse successfully ok 2409 - ... we should get a deprecated warning for TAPx::Parser::goo +d_plan ok 2410 - ... and good_plan should return a reasonable value ok 2411 - ... and parse_errors should be the correct amount ok 2412 - ...... and the correct values ok 2413 - ... and tests_run should equal 7 ok 2414 - ... and actual_passed should be the correct amount ok 2415 - ...... and the correct values ok 2416 - ... and todo_passed should be the correct amount ok 2417 - ...... and the correct values ok 2418 - ... and passed should be the correct amount ok 2419 - ...... and the correct values ok 2420 - ... and failed should be the correct amount ok 2421 - ...... and the correct values ok 2422 - ... and skipped should be the correct amount ok 2423 - ...... and the correct values ok 2424 - ... and actual_failed should be the correct amount ok 2425 - ...... and the correct values ok 2426 - ... and wait should return a reasonable value ok 2427 - ... and plan should equal 1..3 ok 2428 - ... and tests_planned should equal 3 ok 2429 - ... and todo should be the correct amount ok 2430 - ...... and the correct values 1..2430 # Looks like you failed 51 tests of 2430.

        You are a god and I worship you. I'll see what I can do to make this happen. I owe you beer (or your libation of choice).

        One thing which is curious is that the other tests seem to run fine with passing the open3 a string for the command (at least, no one else has reported problems with any of the other tests failing on Windows).

        I'll see what I can do to get started on this.

        Cheers,
        Ovid

        New address of my CGI Course.