Skip to content

Commit

Permalink
build: don't check environment variable to detect CI (neovim#22234)
Browse files Browse the repository at this point in the history
Instead use the cmake option, which should act as the definitive source
to determine whether we use CI or not.
  • Loading branch information
dundargoc authored Feb 12, 2023
1 parent c099836 commit f573fcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 1 addition & 9 deletions cmake/RunTests.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Set LC_ALL to meet expectations of some locale-sensitive tests.
set(ENV{LC_ALL} "en_US.UTF-8")

if(POLICY CMP0012)
# Avoid policy warning due to CI=true. This is needed even if the main
# project has already set this policy as project settings aren't inherited
# when using cmake script mode (-P).
cmake_policy(SET CMP0012 NEW)
endif()

set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest)
set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config)
Expand Down Expand Up @@ -99,7 +91,7 @@ if(NOT res EQUAL 0)
endif()

# Dump the logfile on CI (if not displayed and moved already).
if($ENV{CI})
if(CI_BUILD)
if(EXISTS $ENV{NVIM_LOG_FILE} AND NOT EXISTS $ENV{NVIM_LOG_FILE}.displayed)
file(READ $ENV{NVIM_LOG_FILE} out)
message(STATUS "$NVIM_LOG_FILE: $ENV{NVIM_LOG_FILE}\n${out}")
Expand Down
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if(BUSTED_PRG)
-D BUILD_DIR=${CMAKE_BINARY_DIR}
-D TEST_TYPE=unit
-D CIRRUS_CI=$ENV{CIRRUS_CI}
-D CI_BUILD=${CI_BUILD}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${UNITTEST_PREREQS}
USES_TERMINAL)
Expand All @@ -50,6 +51,7 @@ if(BUSTED_PRG)
-D DEPS_PREFIX=${DEPS_PREFIX}
-D TEST_TYPE=functional
-D CIRRUS_CI=$ENV{CIRRUS_CI}
-D CI_BUILD=${CI_BUILD}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS}
USES_TERMINAL)
Expand All @@ -66,6 +68,7 @@ if(BUSTED_PRG)
-D BUILD_DIR=${CMAKE_BINARY_DIR}
-D TEST_TYPE=benchmark
-D CIRRUS_CI=$ENV{CIRRUS_CI}
-D CI_BUILD=${CI_BUILD}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${BENCHMARK_PREREQS}
USES_TERMINAL)
Expand All @@ -85,6 +88,7 @@ if(BUSTED_LUA_PRG)
-D BUILD_DIR=${CMAKE_BINARY_DIR}
-D TEST_TYPE=functional
-D CIRRUS_CI=$ENV{CIRRUS_CI}
-D CI_BUILD=${CI_BUILD}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS}
USES_TERMINAL)
Expand Down

0 comments on commit f573fcb

Please sign in to comment.