diff --git a/.travis.yml b/.travis.yml index a8cfa4c..6d9cecc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,11 +77,15 @@ script: if [ "${GHC_COVERAGE}" = "1" ]; then cmake --build . --config ${CONFIG} --target filesystem_test test/filesystem_test - lcov --compat-libtool --directory . --capture --output-file coverage_output.info - lcov --remove coverage_output.info '/usr/*' '*/c++/*' '*.h' '*/catch.hpp' -o coverage.info - coveralls-lcov coverage.info else cmake --build . --config ${CONFIG} ctest -C ${CONFIG} -E Windows fi +after_success: + - | + if [ "${GHC_COVERAGE}" = "1" ]; then + lcov --compat-libtool --directory . --capture --output-file coverage_output.info + lcov --remove coverage_output.info '/usr/*' '*/c++/*' '*.h' '*/catch.hpp' -o coverage.info + coveralls-lcov coverage.info + fi diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c030b2e..ebd01af 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,23 +4,23 @@ set(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS ON) include(ParseAndAddCatchTests) if(GHC_COVERAGE) + message("Generating test runner for coverage run...") + add_executable(filesystem_test filesystem_test.cpp catch.hpp) + target_compile_options(filesystem_test PUBLIC --coverage) + target_link_libraries(filesystem_test PUBLIC ghc_filesystem --coverage) +else() message("Generating test runner for normal test...") 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>) + $<$:-Wall -Wextra -Werror> + $<$:-Wall -Werror> + $<$:/WX>) 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() - message("Generating test runner for coverage run...") - add_executable(filesystem_test filesystem_test.cpp catch.hpp) - target_compile_options(filesystem_test PUBLIC --coverage) - target_link_libraries(filesystem_test PUBLIC ghc_filesystem --coverage) endif() add_executable(multifile_test multi1.cpp multi2.cpp catch.hpp)