first step to use travis CI

This commit is contained in:
Evgeniy A. Dushistov
2016-06-02 14:42:44 +03:00
parent 6aaab5e075
commit b20f27d27b
2 changed files with 37 additions and 6 deletions

View File

@@ -125,19 +125,16 @@ if (ENABLE_NLS)
endif ()
option(BUILD_TESTS "Enable automatic testing" False)
if (BUILD_TESTS)
find_program(SHELL_CMD NAMES sh bash
DOC "Shell scripts interpretator command")
message(STATUS "Build tests")
enable_testing()# Force "make test" to works
get_target_property(sdcv_path sdcv LOCATION)
message(STATUS "path ${sdcv_path}")
string(REGEX REPLACE "\\$\\(.*\\)" "\${CTEST_CONFIGURATION_TYPE}"
sdcv_path "${sdcv_path}")
macro(add_sdcv_shell_test test_name)
add_test(${test_name} "${SHELL_CMD}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/${test_name}" "${sdcv_path}" "${CMAKE_CURRENT_SOURCE_DIR}/tests")
add_test(NAME ${test_name}
COMMAND "${SHELL_CMD}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/${test_name}" $<TARGET_FILE:sdcv> "${CMAKE_CURRENT_SOURCE_DIR}/tests")
endmacro()
add_sdcv_shell_test(t_list)