# # # patch "tests/spawn_redirected_hook_helper/__driver__.lua" # from [d7416130202dbb4f5098ae5b11f21ee21dd81edb] # to [a18aaf2dde1c2d1486530ebd9db67cef918e50a6] # # patch "tests/spawn_redirected_hook_helper/testhooks" # from [a855ebc6a55c7058367d741c1c0b66ad40d588a0] # to [e05dcc2ab12993f5f28127a806939c382d556803] # ============================================================ --- tests/spawn_redirected_hook_helper/__driver__.lua d7416130202dbb4f5098ae5b11f21ee21dd81edb +++ tests/spawn_redirected_hook_helper/__driver__.lua a18aaf2dde1c2d1486530ebd9db67cef918e50a6 @@ -1,19 +1,10 @@ -skip_if(ostype == "Windows") --- FIXME: this test broke on Windows when the change to running tests --- in parallel was made. There appears to be a race condition in --- waiting for the spawned test process; running under the debugger --- with breaks after the spawn but before the wait makes the test work. --- --- FIXME: on top of that, the Lua mechanisms can't handle the error; --- win32/tester-plaf.cc run_tests_in_children returns status -1 to --- test_cleaner; that eventually gets passed to ldo.cc --- luaD_seterrorobj, which doesn't handle a status of -1, and --- tester.exe just exits. So xfail won't work here either. - mtn_setup() check(get("testhooks")) check(raw_mtn("--rcfile=testhooks", "ls", "unknown"), 0, false, false) + skip_if(exists("skipfile")) check(exists("outfile")) +check(exists("errfile")) +check(exists("tofile")) ============================================================ --- tests/spawn_redirected_hook_helper/testhooks a855ebc6a55c7058367d741c1c0b66ad40d588a0 +++ tests/spawn_redirected_hook_helper/testhooks e05dcc2ab12993f5f28127a806939c382d556803 @@ -1,17 +1,23 @@ function ignore_file (name) function ignore_file (name) ok = true + if existsonpath("cp") == 0 then + pid = spawn_redirected ("", "", "errfile", + "cp", "testhooks", "tofile") + if pid == -1 then ok = false end + elseif existsonpath("xcopy") == 0 then + pid = spawn_redirected ("", "", "errfile", + "xcopy", "/q", "/y", "testhooks", "tofile") + if pid == -1 then ok = false end + else + ok = false + x = io.open("skipfile", "w") + x:close() + end if ok then - if existsonpath("touch") == 0 then - pid = spawn_redirected ("", "", "xyzzy", "touch", "foofile") - if pid == -1 then ok = false end - elseif existsonpath("xcopy") == 0 then - pid = spawn_redirected ("", "", "xyzzy", "xcopy") - if pid == -1 then ok = false end - else - x = io.open("skipfile", "w") - x:close() - end + res, ret = wait(pid) + if ret == -1 then ok = false end + if ret ~= 0 then ok = false end end if ok then @@ -20,5 +26,5 @@ function ignore_file (name) end ignore_file = function (name) return true end -return true + return true end