From b20f27d27b5f9618e7fecba95b43874c3c80b1a1 Mon Sep 17 00:00:00 2001 From: "Evgeniy A. Dushistov" Date: Thu, 2 Jun 2016 14:42:44 +0300 Subject: [PATCH] first step to use travis CI --- .travis.yml | 34 ++++++++++++++++++++++++++++++++++ CMakeLists.txt | 9 +++------ 2 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8b77086 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 904ea8e..0ce3269 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}" $ "${CMAKE_CURRENT_SOURCE_DIR}/tests") endmacro() add_sdcv_shell_test(t_list)