diff --git a/cmake/RunUnittests.cmake b/cmake/RunUnittests.cmake index ce419fa68d..8c1992e0bf 100644 --- a/cmake/RunUnittests.cmake +++ b/cmake/RunUnittests.cmake @@ -6,4 +6,9 @@ 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}) + WORKING_DIRECTORY ${WORKING_DIR} + RESULT_VARIABLE res) + +if(NOT res EQUAL 0) + message(FATAL_ERROR "Unit tests failed.") +endif()