Skip to content

Commit

Permalink
[Coverage] Make script more robust.
Browse files Browse the repository at this point in the history
- Erase coverage files of previous runs.  This is necessary if a source
  file was removed or renamed.
- Always do a clean build to regenerate coverage files.
  • Loading branch information
ImmanuelHaffner committed Apr 26, 2023
1 parent 7252fde commit f2ff37b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ LCOV_FLAGS="\
--no-external \
--rc lcov_branch_coverage=1"

# cleanup old files
find build/coverage \( -iname '*.gcno' -or -iname '*.gcda' \) -exec rm {} +

env CFLAGS=--coverage CXXFLAGS=--coverage \
cmake -S . -B build/coverage \
--fresh \
Expand All @@ -41,8 +44,11 @@ env CFLAGS=--coverage CXXFLAGS=--coverage \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++
-DENABLE_SANITIZERS=OFF \
-DENABLE_SANITY_FIELDS=OFF \
-DUSE_LLD=ON

cmake --build build/coverage -t clean
cmake --build build/coverage

cd build/coverage
Expand Down

0 comments on commit f2ff37b

Please sign in to comment.