Skip to content

Commit

Permalink
ignore deprecated code from coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Jan 27, 2025
1 parent 18c23fb commit 6215cc7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/generate-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ for TEST_BUNDLE in $TEST_BUNDLES; do
xcrun llvm-cov export \
-format=lcov \
-instr-profile "$PROFDATA_FILE" \
-ignore-filename-regex "Tests/|.build|DerivedData|.derivedData" \
-ignore-filename-regex "Tests/|.build|DerivedData|.derivedData|Deprecated/|Deprecated.swift" \
"$BINARY_PATH" > "$TEMP_COVERAGE_DIR/$BINARY_NAME.info"

if [ $? -ne 0 ]; then
Expand All @@ -58,7 +58,10 @@ rm -f "$OUTPUT_FILE" # Ensure the output file doesn't already exist

for INFO_FILE in "$TEMP_COVERAGE_DIR"/*.info; do
if [ -f "$INFO_FILE" ]; then
lcov --add-tracefile "$INFO_FILE" --output-file "$OUTPUT_FILE"
lcov \
--ignore-errors inconsistent \
--add-tracefile "$INFO_FILE" \
--output-file "$OUTPUT_FILE"
if [ $? -ne 0 ]; then
echo "Failed to merge $INFO_FILE into $OUTPUT_FILE. Exiting."
exit 1
Expand Down

0 comments on commit 6215cc7

Please sign in to comment.