mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-15 17:31:56 +00:00
first step to use travis CI
This commit is contained in:
34
.travis.yml
Normal file
34
.travis.yml
Normal 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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user