Skip to content

Commit

Permalink
Try excluding typeRegistry.h from coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Darby Johnston <[email protected]>
  • Loading branch information
darbyjohnston committed Jan 16, 2025
1 parent 0d0d540 commit 0bce96f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
if: matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
run: |
cd ${{ env.OTIO_BUILD_DIR }}
lcov --capture -b . --directory . --output-file=coverage.info -q --ignore-errors gcov
lcov --capture -b . --directory . --output-file=coverage.info -q
cat coverage.info | sed "s/SF:.*src/SF:src/g" > coverage.filtered.info
lcov --remove coverage.filtered.info '*/usr/*' --output-file=coverage.filtered.info -q
lcov --remove coverage.filtered.info '*/deps/*' --output-file=coverage.filtered.info -q
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(OTIO_CXX_COVERAGE AND NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-exclude-files='rapidjson/*'")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-exclude-files='rapidjson/*' -fprofile-exclude-files=src/opentimelineio/typeRegistry.h")
# this causes cmake to produce file.gcno instead of file.cpp.gcno
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
message(STATUS "Building C++ with Coverage: ON")
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ ifndef OTIO_CXX_BUILD_TMP_DIR
not be found.)
endif
lcov --rc lcov_branch_coverage=1 --capture -b . --directory ${OTIO_CXX_BUILD_TMP_DIR} \
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.info -q \
--ignore-errors gcov
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.info -q
cat ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info | sed "s/SF:.*src/SF:src/g"\
> ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info
lcov --rc lcov_branch_coverage=1 --remove ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info '/usr/*' \
Expand Down

0 comments on commit 0bce96f

Please sign in to comment.