From fb87165051aa5942f5cef2bb26652d5b3fcbbced Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 24 Feb 2017 11:14:25 -0500 Subject: [PATCH] cmake add check --- .travis.yml | 4 +--- CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6afc49c8f9..e92e7a7613 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,7 @@ install: - pip install --user cpp-coveralls script: - cmake -DCMAKE_BUILD_TYPE=Profile -DTESTING=ON -DFORMAT=ON . - - make - - make check_format - - ctest -V + - make check after_success: - cpp-coveralls -i matrix env: diff --git a/CMakeLists.txt b/CMakeLists.txt index e08762f53e..f21b56fe09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,11 @@ if(FORMAT) ) endif() +if(TESTING AND FORMAT) + add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure) + add_dependencies(check test_build check_format) +endif() + set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})