File tree Expand file tree Collapse file tree 4 files changed +55
-2
lines changed
Expand file tree Collapse file tree 4 files changed +55
-2
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ jobs:
113113 env :
114114 BUILD_NAME : ${{ github.head_ref || github.ref_name }}.${{ matrix.os }}.${{ matrix.preset }}.${{ matrix.config }}
115115 CMAKE_OSX_ARCHITECTURES : arm64;x86_64
116- run : cmake --preset ${{ matrix.preset }} -D BENBOT_DOCS=OFF -D BUILDNAME=${{ env.BUILD_NAME }}
116+ run : cmake --preset ${{ matrix.preset }} -D BENBOT_DOCS=OFF -D BUILDNAME=${{ env.BUILD_NAME }} --log-level=VERBOSE
117117
118118 - name : Build and test
119119 run : |
Original file line number Diff line number Diff line change 1414
1515include_guard (GLOBAL )
1616
17+ include (FeatureSummary )
18+
19+ add_feature_info (
20+ coverage [[ CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT WIN32]]
21+ "Enabled coverage reporting flags for debug configurations"
22+ )
23+
1724if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT WIN32 )
1825 get_cmake_property (debug_configs DEBUG_CONFIGURATIONS )
1926
@@ -38,5 +45,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT WIN32)
3845 link_libraries ("$<${config_debug} :gcov >" )
3946 endif ()
4047
41- message (STATUS "Coverage enabled" )
48+ set (clean_script "${CMAKE_SOURCE_DIR} /scripts/CleanOldCoverageOutput.cmake" )
49+
50+ add_custom_target (
51+ coverage-clean
52+ COMMAND "${CMAKE_COMMAND} " -D "BUILD_DIR=${CMAKE_BINARY_DIR} " -P "${clean_script} "
53+ COMMENT "Cleaning old coverage output files..."
54+ VERBATIM USES_TERMINAL
55+ SOURCES "${clean_script} "
56+ )
4257endif ()
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ function (__add_build_config name flags linkerFlags)
6262 CMAKE_CXX_FLAGS_${name} CMAKE_C_FLAGS_${name} CMAKE_EXE_LINKER_FLAGS_${name}
6363 CMAKE_SHARED_LINKER_FLAGS_${name} CMAKE_MODULE_LINKER_FLAGS_${name}
6464 )
65+
66+ message (VERBOSE "Added build configuration ${name} " )
6567endfunction ()
6668
6769# ASAN
Original file line number Diff line number Diff line change 1+ # ======================================================================================
2+ #
3+ # ░▒▓███████▓▒░░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░
4+ # ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
5+ # ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
6+ # ░▒▓███████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
7+ # ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
8+ # ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
9+ # ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░
10+ #
11+ # ======================================================================================
12+
13+ #[[
14+ This script can be run to remove all old coverage files in a build directory.
15+
16+ Example usage (from repo root):
17+ cmake -D BUILD_DIR=$(pwd)/Builds/clang -P scripts/CleanOldCoverageOutput.cmake
18+ ]]
19+
20+ cmake_minimum_required (VERSION 4.0.0 FATAL_ERROR )
21+
22+ if (NOT DEFINED BUILD_DIR)
23+ message (FATAL_ERROR "BUILD_DIR not defined!" )
24+ endif ()
25+
26+ file (GLOB_RECURSE coverage_files LIST_DIRECTORIES false
27+ "${BUILD_DIR} /*.gcda" "${BUILD_DIR} /*.gcov" "${BUILD_DIR} /*.profraw"
28+ )
29+
30+ if (coverage_files)
31+ file (REMOVE ${coverage_files} )
32+ list (LENGTH coverage_files num_files)
33+ message (STATUS "Removed ${num_files} files." )
34+ else ()
35+ message (STATUS "No coverage files found." )
36+ endif ()
You can’t perform that action at this time.
0 commit comments