From 86a1707b75e97ab9c15a5f986b2220a66fd19230 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Mon, 21 Sep 2015 23:26:47 +0200 Subject: [PATCH] Added cmake option to turn on/off tests (off by default) --- .travis.yml | 1 + CMakeLists.txt | 3 +++ appveyor.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index d9a7c9a..83c8647 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ script: - > cmake -Wno-dev + -DTESTS=ON -DCOVERALLS=${COVERAGE} -DCMAKE_BUILD_TYPE=${CONFIGURATION} -DCMAKE_INSTALL_PREFIX=criterion-${TRAVIS_TAG} diff --git a/CMakeLists.txt b/CMakeLists.txt index 73c0455..3ee09e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ endif() # Setup coveralls +option(TESTS "Turn on the samples and test" OFF) option(COVERALLS "Turn on coveralls support" OFF) option(COVERALLS_UPLOAD "Upload the generated coveralls json" ON) @@ -192,6 +193,8 @@ add_custom_target(gcov -P "${CMAKE_MODULE_PATH}/Gcov.cmake" ) +if (TESTS) enable_testing() add_subdirectory(samples) add_subdirectory(test) +endif () diff --git a/appveyor.yml b/appveyor.yml index 46eb294..869d5ca 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -38,6 +38,7 @@ install: - > cmake -Wno-dev + -DTESTS=ON -DCMAKE_INSTALL_PREFIX="criterion-%RELEASE_NAME%" -DCMAKE_BUILD_TYPE="%CONFIGURATION%" -G "%GENERATOR%"