mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 01:08:20 +00:00

With this, you can now run a single unit test file using: TEST_FILE=/path/to/file make unittest For example, to just run the path unit tests, you can do: TEST_FILE=test/unit/path.moon make unittest
17 lines
471 B
CMake
17 lines
471 B
CMake
get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH)
|
|
set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}")
|
|
set(ENV{NVIM_TEST_LIB} ${NVIM_TEST_LIB})
|
|
set(ENV{TEST_INCLUDES} ${TEST_INCLUDES})
|
|
if(DEFINED ENV{TEST_FILE})
|
|
set(TEST_DIR $ENV{TEST_FILE})
|
|
endif()
|
|
|
|
execute_process(
|
|
COMMAND ${BUSTED_PRG} -o ${BUSTED_OUTPUT_TYPE} --pattern=.moon ${TEST_DIR}
|
|
WORKING_DIRECTORY ${WORKING_DIR}
|
|
RESULT_VARIABLE res)
|
|
|
|
if(NOT res EQUAL 0)
|
|
message(FATAL_ERROR "Unit tests failed.")
|
|
endif()
|