BUILD_TESTS condition
This commit is contained in:
parent
cb5a727a4a
commit
81fc825a5b
@ -13,7 +13,7 @@ install:
|
||||
|
||||
before_script:
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
- cmake -H. -BBuild -DCMAKE_BUILD_TYPE=Release -Wdev
|
||||
- cmake -H. -BBuild -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -Wdev
|
||||
- cd Build
|
||||
|
||||
script:
|
||||
|
@ -7,7 +7,9 @@ include_directories(${CMAKE_SOURCE_DIR}/catch)
|
||||
file(GLOB headers ${CMAKE_SOURCE_DIR}/include/*.h)
|
||||
file(GLOB SOURCES "test/*.cpp" "include/*.cpp")
|
||||
|
||||
include(CTest)
|
||||
if(BUILD_TESTS)
|
||||
include(CTest)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
message(status "Setting MSVC flags")
|
||||
@ -39,15 +41,17 @@ endif()
|
||||
|
||||
message(status "** CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
enable_testing()
|
||||
if(BUILD_TESTS)
|
||||
enable_testing()
|
||||
|
||||
add_test(NAME "test_uuid" COMMAND "test_uuid" "-r compact")
|
||||
set_tests_properties("test_uuid"
|
||||
add_test(NAME "test_uuid" COMMAND "test_uuid" "-r compact")
|
||||
set_tests_properties("test_uuid"
|
||||
PROPERTIES
|
||||
PASS_REGULAR_EXPRESSION "Passed all.*")
|
||||
set_tests_properties("test_uuid"
|
||||
set_tests_properties("test_uuid"
|
||||
PROPERTIES
|
||||
FAIL_REGULAR_EXPRESSION "Failed \\d+ test cases")
|
||||
set_tests_properties("test_uuid"
|
||||
set_tests_properties("test_uuid"
|
||||
PROPERTIES
|
||||
TIMEOUT 120)
|
||||
endif()
|
@ -19,7 +19,7 @@ init:
|
||||
before_build:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake .. -G "%GENERATOR%" -DCMAKE_CXX_FLAGS="%FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin"
|
||||
- cmake .. -G "%GENERATOR%" -DBUILD_TESTS=ON -DCMAKE_CXX_FLAGS="%FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin"
|
||||
|
||||
build_script:
|
||||
- cmake --build . --config Release
|
||||
|
Loading…
Reference in New Issue
Block a user