1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #6317

Anthony Bilinski (1):
      chore(travis): Combine code coverage build with full build

Jamie Westell (1):
      chore(travis): add code coverage report generation
This commit is contained in:
Anthony Bilinski 2021-03-22 10:51:46 -07:00
commit d6dd44004c
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
3 changed files with 29 additions and 2 deletions

View File

@ -45,7 +45,18 @@ jobs:
- stage: Linux
os: linux
env: JOB=build-ubuntu-16-04
addons:
apt:
packages:
- lcov
script: "./.travis/$JOB.sh"
after_success:
# Create lcov report
- lcov --directory _build --capture --output-file coverage.info
# Filter out system headers and test sources
- lcov --remove coverage.info '/usr/*' '*/test/*' '*/*_autogen/*' --output-file coverage.info
# Upload report to codecov.io
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
- stage: "Windows Stage 1: Dependencies (OpenSSL, Qt)"
os: linux
# Makes the cache this job creates avaiable only to jobs with WINDOWS_BUILD_ARCH_CACHE_TRICK_VARIABLE=i686,

View File

@ -198,7 +198,8 @@ build_qtox() {
echo '*** BUILDING "FULL" VERSION ***'
cmake -H. -B"$BUILDDIR" \
-DUPDATE_CHECK=ON \
-DSTRICT_OPTIONS=ON
-DSTRICT_OPTIONS=ON \
-DCODE_COVERAGE=ON
bdir
}

View File

@ -579,6 +579,20 @@ MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
# the compiler flags for compiling C++ sources
MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
# Interface library to propagate code coverage flags if enabled
add_library(coverage_config INTERFACE)
option(CODE_COVERAGE "Enable coverage reporting" OFF)
if (CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(coverage_config INTERFACE -O0 -g --coverage)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
target_link_options(coverage_config INTERFACE --coverage)
else()
target_link_libraries(coverage_config INTERFACE --coverage)
endif()
endif()
link_libraries(coverage_config)
add_subdirectory(util)
add_subdirectory(audio)
add_subdirectory(translations)
@ -589,7 +603,8 @@ add_library(${PROJECT_NAME}_static
${${PROJECT_NAME}_SOURCES})
target_link_libraries(${PROJECT_NAME}_static
${CMAKE_REQUIRED_LIBRARIES}
${ALL_LIBRARIES})
${ALL_LIBRARIES}
coverage_config)
target_link_libraries(${PROJECT_NAME}_static util_library)
target_link_libraries(${PROJECT_NAME}_static audio_library)