aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSergey Slipchenko <faergeek@gmail.com>2023-09-11 21:01:00 +0400
committerGitHub <noreply@github.com>2023-09-11 10:01:00 -0700
commitf859d16aea0d58e572edc9aaf1de3542569e10a9 (patch)
treeb421db6c7cfd4e913f2da7f5fbc116e05a79a04e /cmake
parent676e1d490066a5289ba05df128c8710253fc1cf9 (diff)
downloadrneovim-f859d16aea0d58e572edc9aaf1de3542569e10a9.tar.gz
rneovim-f859d16aea0d58e572edc9aaf1de3542569e10a9.tar.bz2
rneovim-f859d16aea0d58e572edc9aaf1de3542569e10a9.zip
fix(tests): set SHELL=sh #24941
Problem: Some tests fail with $SHELL=fish #6172 Related: https://github.com/neovim/neovim/pull/6176 Solution: Replace "echo -n" with "printf", because "echo" in sh may be provided as a shell builtin, which does not accept an "-n" flag to avoid a trailing newline (e.g. on macos). "printf" is more portable (defined by POSIX) and it does not output a trailing newline by itself. Fixes #6172 TODO: Other test failures may be related to "session leader" issue: https://github.com/neovim/neovim/issues/2354 Checked by running `:terminal ./build/bin/tty-test` from Nvim with `shell=/bin/fish` (inherited from `$SHELL`) and it indeed complains about "process does not own the terminal". With `shell=sh` it doesn't complain. And unsetting `$SHELL` seems to make `nvim` to fall back to `shell=sh`. FAILED test/functional/terminal/tui_spec.lua @ 1017: TUI paste: terminal mode test/functional/terminal/tui_spec.lua:1024: Row 1 did not match. Expected: |*tty ready | |*{1: } | |* | | | |{5:^^^^^^^ }| |{3:-- TERMINAL --} | |{3:-- TERMINAL --} | Actual: |*process does not own the terminal | |* | |*[Process exited 2]{1: } | | | |{5:^^^^^^^ }| |{3:-- TERMINAL --} | |{3:-- TERMINAL --} | To print the expect() call that would assert the current screen state, use screen:snapshot_util(). In case of non-deterministic failures, use screen:redraw_debug() to show all intermediate screen states. stack traceback: test/functional/ui/screen.lua:622: in function '_wait' test/functional/ui/screen.lua:352: in function 'expect' test/functional/terminal/tui_spec.lua:1024: in function <test/functional/terminal/tui_spec.lua:1017> FAILED test/functional/terminal/tui_spec.lua @ 1551: TUI forwards :term palette colors with termguicolors test/functional/terminal/tui_spec.lua:1567: Row 1 did not match. Expected: |*{1:t}ty ready | | | |* | | | |{2:^^^^^^^ }| | | |{3:-- TERMINAL --} | Actual: |*{1:p}rocess does not own the terminal | | | |*[Process exited 2] | | | |{2:^^^^^^^ }| | | |{3:-- TERMINAL --} | To print the expect() call that would assert the current screen state, use screen:snapshot_util(). In case of non-deterministic failures, use screen:redraw_debug() to show all intermediate screen states. stack traceback: test/functional/ui/screen.lua:622: in function '_wait' test/functional/ui/screen.lua:352: in function 'expect' test/functional/terminal/tui_spec.lua:1567: in function <test/functional/terminal/tui_spec.lua:1551>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/RunTests.cmake5
1 files changed, 5 insertions, 0 deletions
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.