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

34
.travis.yml Normal file
View File

@@ -0,0 +1,34 @@
#
# Available repositories are listed here:
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
#
sudo: false
language:
- cpp
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- kalakris-cmake
- ubuntu-sdk-team
packages:
- g++-4.8
- cmake
- libglib2.0-dev
env:
- COMPILER_VERSION=4.8
before_script:
- mkdir build
- cd build
- CC=$CC-${COMPILER_VERSION} CXX=$CXX-${COMPILER_VERSION} cmake -DBUILD_TESTS=True ..
- cd ..
script:
- cd build
- make -k -j2 VERBOSE=1
- ctest --output-on-failure

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)