diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index d470793a27..8d5b0d2402 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -64,6 +64,11 @@ endif() set(ENV{SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_NAME}) # used by test/helpers.lua. +if(NOT WIN32) + # Tests assume POSIX "sh" and may fail if SHELL=fish. #24941 #6172 + set(ENV{SHELL} sh) +endif() + execute_process( # Note: because of "-ll" (low-level interpreter mode), some modules like # _editor.lua are not loaded. diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua index 762e8877ce..90aab48d61 100644 --- a/test/functional/vimscript/system_spec.lua +++ b/test/functional/vimscript/system_spec.lua @@ -335,12 +335,12 @@ describe('system()', function() if is_os('win') then eq("echoed\n", eval('system("echo echoed")')) else - eq("echoed", eval('system("echo -n echoed")')) + eq("echoed", eval('system("printf echoed")')) end end) it('to backgrounded command does not crash', function() -- This is indeterminate, just exercise the codepath. May get E5677. - feed_command('call system(has("win32") ? "start /b /wait cmd /c echo echoed" : "echo -n echoed &")') + feed_command('call system(has("win32") ? "start /b /wait cmd /c echo echoed" : "printf echoed &")') local v_errnum = string.match(eval("v:errmsg"), "^E%d*:") if v_errnum then eq("E5677:", v_errnum)