aboutsummaryrefslogtreecommitdiff
path: root/cmake/RunUnittests.cmake
blob: 8c1992e0bf2c6c955a8cc791e903b65653d7cfa5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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})

execute_process(
  COMMAND ${BUSTED_PRG} -l ${LUAJIT_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()