diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2021-09-10 11:54:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-10 11:54:36 -0700 |
commit | 5e22fdd9ccdd894d4c6e165438ca314ed2cd3b9e (patch) | |
tree | 46bbcfe7286a9cda4ef625ee7f96ed18001cc336 | |
parent | 7525052270c4c5e62b9b5bc7dbc20b851f986900 (diff) | |
parent | 7b822d4b4b71ef0e9ed6a39ef50a5a2cbf8660c5 (diff) | |
download | rneovim-5e22fdd9ccdd894d4c6e165438ca314ed2cd3b9e.tar.gz rneovim-5e22fdd9ccdd894d4c6e165438ca314ed2cd3b9e.tar.bz2 rneovim-5e22fdd9ccdd894d4c6e165438ca314ed2cd3b9e.zip |
test: avoid writing ~/.bash_history #15621
Problem:
- If I run 'make test' on Linux (Fedora), a few lines like
/path/to/neovim/build/bin/shell-test REP 31 line
/path/to/neovim/build/bin/shell-test REP 41 line
are written to my ~/.bash_history.
These comes from from test/functional/terminal/scrollback_spec.lua.
- If $HISTFILE is unset, shell will not write to history file.
But bash sets $HISTFILE to default value (~/.bash_history) if it is unset.
- Unknown how to set an env var to empty string in CMake. These do NOT work:
set(HISTFILE "")
set(ENV{HISTFILE} "")
unset(ENV{HISTFILE})
Solution:
Set HISTFILE=/dev/null
-rw-r--r-- | cmake/RunTests.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index e2096dc06c..0c48a77b9a 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -49,6 +49,9 @@ endif() set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir/${TEST_PATH}") execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR}) +# HISTFILE: do not write into user's ~/.bash_history +set(ENV{HISTFILE} "/dev/null") + if(NOT DEFINED ENV{TEST_TIMEOUT} OR "$ENV{TEST_TIMEOUT}" STREQUAL "") set(ENV{TEST_TIMEOUT} 1200) endif() |