Work on better CI integration.

This commit is contained in:
Steffen Schuemann 2019-05-20 21:10:54 +02:00
parent d2ed3e5614
commit c782650f33
2 changed files with 14 additions and 13 deletions

View File

@ -53,7 +53,6 @@ install:
- | - |
if [ "${GHC_COVERAGE}" = "1" ]; then if [ "${GHC_COVERAGE}" = "1" ]; then
gem install coveralls-lcov gem install coveralls-lcov
#pip install --user cpp-coveralls
fi fi
- $CC --version - $CC --version
- $CXX --version - $CXX --version
@ -80,8 +79,8 @@ script:
after_success: after_success:
- | - |
if [ "${GHC_COVERAGE}" = "1" ]; then 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-lcov coverage.info
#coveralls --verbose --root .. -E ".*catch.*"
fi fi

View File

@ -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) set(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS ON)
include(ParseAndAddCatchTests) include(ParseAndAddCatchTests)
add_executable(filesystem_test filesystem_test.cpp catch.hpp) if(NOT DEFINED ENV{GHC_COVERAGE})
target_link_libraries(filesystem_test ghc_filesystem) add_executable(filesystem_test filesystem_test.cpp catch.hpp)
target_compile_options(filesystem_test PRIVATE target_link_libraries(filesystem_test ghc_filesystem)
target_compile_options(filesystem_test PRIVATE
$<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -Werror> $<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -Werror>
$<$<CXX_COMPILER_ID:GNU>:-Wall -Werror> $<$<CXX_COMPILER_ID:GNU>:-Wall -Werror>
$<$<CXX_COMPILER_ID:MSVC>:/WX>) $<$<CXX_COMPILER_ID:MSVC>:/WX>)
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
target_compile_definitions(filesystem_test PRIVATE _CRT_SECURE_NO_WARNINGS) target_compile_definitions(filesystem_test PRIVATE _CRT_SECURE_NO_WARNINGS)
endif() endif()
if(DEFINED ENV{GHC_COVERAGE}) 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") target_compile_options(filesystem_test PRIVATE "--coverage")
set_property(TARGET filesystem_test APPEND_STRING PROPERTY LINK_FLAGS " --coverage")
endif() 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) add_executable(multifile_test multi1.cpp multi2.cpp catch.hpp)
target_link_libraries(multifile_test ghc_filesystem) target_link_libraries(multifile_test ghc_filesystem)