diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-09-30 18:00:20 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-09-30 18:00:20 -0300 |
commit | afe7ba1e71f0fe43817ae9abac56c721c99f95c6 (patch) | |
tree | 187b69d95e4efc3d87c07c2ce9a4016bc0495114 /cmake/RunTests.cmake | |
parent | 4b0f524915ee0e94bf9ca24fb1c1014921e610d5 (diff) | |
parent | 911acd22d8e8d6c3ef2341c604ecf820f8e322dd (diff) | |
download | rneovim-afe7ba1e71f0fe43817ae9abac56c721c99f95c6.tar.gz rneovim-afe7ba1e71f0fe43817ae9abac56c721c99f95c6.tar.bz2 rneovim-afe7ba1e71f0fe43817ae9abac56c721c99f95c6.zip |
Merge PR #1258 'Replace vroom by lua/busted for functional tests'
Diffstat (limited to 'cmake/RunTests.cmake')
-rw-r--r-- | cmake/RunTests.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake new file mode 100644 index 0000000000..dc02ce5400 --- /dev/null +++ b/cmake/RunTests.cmake @@ -0,0 +1,23 @@ +get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH) +set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}") +if(DEFINED ENV{TEST_FILE}) + set(TEST_DIR $ENV{TEST_FILE}) +endif() + +if(TEST_TYPE STREQUAL "functional") + execute_process( + COMMAND python ${BUSTED_PRG} ${BUSTED_REAL_PRG} -v -o + ${BUSTED_OUTPUT_TYPE} --lpath=${BUILD_DIR}/?.lua ${TEST_DIR}/legacy + WORKING_DIRECTORY ${WORKING_DIR} + RESULT_VARIABLE res) +else() + execute_process( + COMMAND ${BUSTED_PRG} -v -o ${BUSTED_OUTPUT_TYPE} + --lpath=${BUILD_DIR}/?.lua ${TEST_DIR}/unit + WORKING_DIRECTORY ${WORKING_DIR} + RESULT_VARIABLE res) +endif() + +if(NOT res EQUAL 0) + message(FATAL_ERROR "Unit tests failed.") +endif() |