Work on better CI integration.

This commit is contained in:
Steffen Schuemann 2019-05-21 08:07:43 +02:00
parent 2a15f1833f
commit 8b37292acb
2 changed files with 15 additions and 11 deletions

View File

@ -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

View File

@ -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
$<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -Werror>
$<$<CXX_COMPILER_ID:GNU>:-Wall -Werror>
$<$<CXX_COMPILER_ID:MSVC>:/WX>)
$<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -Werror>
$<$<CXX_COMPILER_ID:GNU>:-Wall -Werror>
$<$<CXX_COMPILER_ID:MSVC>:/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)