From c782650f338101b069e1e0c9efa7dcb0a638d7e7 Mon Sep 17 00:00:00 2001 From: Steffen Schuemann Date: Mon, 20 May 2019 21:10:54 +0200 Subject: [PATCH] Work on better CI integration. --- .travis.yml | 5 ++--- test/CMakeLists.txt | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 37e723f..519b83b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,6 @@ install: - | if [ "${GHC_COVERAGE}" = "1" ]; then gem install coveralls-lcov - #pip install --user cpp-coveralls fi - $CC --version - $CXX --version @@ -80,8 +79,8 @@ script: after_success: - | if [ "${GHC_COVERAGE}" = "1" ]; then - lcov --compat-libtool --directory . --capture --output-file coverage.info + lcov --compat-libtool --directory . --capture --output-file coverage_output.info + lcov --remove coverage_output.info '/usr/*' '*/c++/*' '*/catch.hpp' -o coverage.info coveralls-lcov coverage.info - #coveralls --verbose --root .. -E ".*catch.*" fi diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index abbf00c..e452039 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,21 +3,23 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") set(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS ON) include(ParseAndAddCatchTests) -add_executable(filesystem_test filesystem_test.cpp catch.hpp) -target_link_libraries(filesystem_test ghc_filesystem) -target_compile_options(filesystem_test PRIVATE +if(NOT DEFINED ENV{GHC_COVERAGE}) + add_executable(filesystem_test filesystem_test.cpp catch.hpp) + target_link_libraries(filesystem_test ghc_filesystem) + target_compile_options(filesystem_test PRIVATE $<$:-Wall -Wextra -Werror> $<$:-Wall -Werror> $<$:/WX>) -if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) - target_compile_definitions(filesystem_test PRIVATE _CRT_SECURE_NO_WARNINGS) -endif() -if(DEFINED ENV{GHC_COVERAGE}) + if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) + target_compile_definitions(filesystem_test PRIVATE _CRT_SECURE_NO_WARNINGS) + endif() + ParseAndAddCatchTests(filesystem_test filesystem_test) + AddExecutableWithStdFS(std_filesystem_test filesystem_test.cpp catch.hpp) +else() + add_executable(filesystem_test filesystem_test.cpp catch.hpp) + target_link_libraries(filesystem_test ghc_filesystem --coverage) target_compile_options(filesystem_test PRIVATE "--coverage") - set_property(TARGET filesystem_test APPEND_STRING PROPERTY LINK_FLAGS " --coverage") endif() -ParseAndAddCatchTests(filesystem_test filesystem_test) -AddExecutableWithStdFS(std_filesystem_test filesystem_test.cpp catch.hpp) add_executable(multifile_test multi1.cpp multi2.cpp catch.hpp) target_link_libraries(multifile_test ghc_filesystem)