diff options
author | dundargoc <gocdundar@gmail.com> | 2023-11-24 13:28:15 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-12-16 21:06:28 +0100 |
commit | 404fdb0f3683094c2d40e1ee7e41d5c491f41a06 (patch) | |
tree | 10902993f64a7e16d75217802d80eb8a091f0a49 /test | |
parent | 8fb7419d7c5e2df3b792d18fa56f973088e69be2 (diff) | |
download | rneovim-404fdb0f3683094c2d40e1ee7e41d5c491f41a06.tar.gz rneovim-404fdb0f3683094c2d40e1ee7e41d5c491f41a06.tar.bz2 rneovim-404fdb0f3683094c2d40e1ee7e41d5c491f41a06.zip |
build: cmake fixes
- add EXTERNALPROJECT_OPTIONS variable to main build
- use `REQUIRED` keyword for IWYU.
- remove check_c_compiler_flag checks when `ENABLE_COMPILER_SUGGESTIONS`
is `ON`. If we explicitly enable it then we probably want it to give
an error if it doesn't exist, rather than silently skip it.
- Move dependency interface libraries to their find module and use them
as a pseudo-imported target.
- Remove BUSTED_OUTPUT_TYPE. It's not used and we can reintroduce it
again if something similar is needed.
- Use LINK_OPTIONS intead of LINK_FLAGS when generating the `--version`
output.
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e9be79edc0..da6d3ea39e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,31 +1,25 @@ add_subdirectory(functional/fixtures) # compile test programs get_directory_property(GENERATED_HELP_TAGS DIRECTORY ${PROJECT_SOURCE_DIR}/runtime DEFINITION GENERATED_HELP_TAGS) -if(NOT BUSTED_OUTPUT_TYPE) - set(BUSTED_OUTPUT_TYPE "nvim") -endif() - get_target_property(TEST_INCLUDE_DIRS main_lib INTERFACE_INCLUDE_DIRECTORIES) -set(UNITTEST_PREREQS nvim) -set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test pwsh-test streams-test tty-test ${GENERATED_HELP_TAGS}) -set(BENCHMARK_PREREQS nvim tty-test) +set(TEST_OPTIONS + -D BUILD_DIR=${CMAKE_BINARY_DIR} + -D CIRRUS_CI=$ENV{CIRRUS_CI} + -D CI_BUILD=${CI_BUILD} + -D DEPS_INSTALL_DIR=${DEPS_INSTALL_DIR} + -D NVIM_PRG=$<TARGET_FILE:nvim> + -D TEST_DIR=${CMAKE_CURRENT_SOURCE_DIR} + -D WORKING_DIR=${PROJECT_SOURCE_DIR}) check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI) if(LUA_HAS_FFI) add_custom_target(unittest COMMAND ${CMAKE_COMMAND} - -D NVIM_PRG=$<TARGET_FILE:nvim> - -D WORKING_DIR=${PROJECT_SOURCE_DIR} - -D BUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE} - -D TEST_DIR=${CMAKE_CURRENT_SOURCE_DIR} - -D BUILD_DIR=${CMAKE_BINARY_DIR} - -D DEPS_INSTALL_DIR=${DEPS_INSTALL_DIR} -D TEST_TYPE=unit - -D CIRRUS_CI=$ENV{CIRRUS_CI} - -D CI_BUILD=${CI_BUILD} + ${TEST_OPTIONS} -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake - DEPENDS ${UNITTEST_PREREQS} + DEPENDS nvim USES_TERMINAL) add_dependencies(unittest lua-dev-deps) else() @@ -38,32 +32,18 @@ configure_file( add_custom_target(functionaltest COMMAND ${CMAKE_COMMAND} - -D NVIM_PRG=$<TARGET_FILE:nvim> - -D WORKING_DIR=${PROJECT_SOURCE_DIR} - -D BUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE} - -D TEST_DIR=${CMAKE_CURRENT_SOURCE_DIR} - -D BUILD_DIR=${CMAKE_BINARY_DIR} - -D DEPS_INSTALL_DIR=${DEPS_INSTALL_DIR} -D TEST_TYPE=functional - -D CIRRUS_CI=$ENV{CIRRUS_CI} - -D CI_BUILD=${CI_BUILD} + ${TEST_OPTIONS} -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake - DEPENDS ${FUNCTIONALTEST_PREREQS} + DEPENDS nvim printenv-test printargs-test shell-test pwsh-test streams-test tty-test ${GENERATED_HELP_TAGS} USES_TERMINAL) add_custom_target(benchmark COMMAND ${CMAKE_COMMAND} - -D NVIM_PRG=$<TARGET_FILE:nvim> - -D WORKING_DIR=${PROJECT_SOURCE_DIR} - -D BUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE} - -D TEST_DIR=${CMAKE_CURRENT_SOURCE_DIR} - -D BUILD_DIR=${CMAKE_BINARY_DIR} - -D DEPS_INSTALL_DIR=${DEPS_INSTALL_DIR} -D TEST_TYPE=benchmark - -D CIRRUS_CI=$ENV{CIRRUS_CI} - -D CI_BUILD=${CI_BUILD} + ${TEST_OPTIONS} -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake - DEPENDS ${BENCHMARK_PREREQS} + DEPENDS nvim tty-test USES_TERMINAL) add_dependencies(functionaltest lua-dev-deps) |