Skip to content

Commit f0e0146

Browse files
committed
[infra/command] Add ignore-error condition in lcov report
This commit adds `--ignore-errors` options to skip error message by lcov bug or acceptable condition. ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
1 parent 8dcde9f commit f0e0146

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

infra/command/gen-coverage-report

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,33 @@ do
5252
done
5353

5454
# Capture initial zero coverage data
55-
"${LCOV_PATH}" -c -i -d "${BUILD_WORKSPACE_PATH}" --gcov-tool ${GCOV_PATH} -o "${RAW_BASE_COVERAGE_INFO_PATH}"
55+
# --ignore-errors mismatch: lcov bug in gcc 13, 14
56+
"${LCOV_PATH}" -c -i -d "${BUILD_WORKSPACE_PATH}" --gcov-tool ${GCOV_PATH} \
57+
-o "${RAW_BASE_COVERAGE_INFO_PATH}" \
58+
--ignore-errors mismatch
5659

5760
# Capture tests coverage data
58-
"${LCOV_PATH}" -c -d "${BUILD_WORKSPACE_PATH}" --gcov-tool ${GCOV_PATH} -o "${RAW_TEST_COVERAGE_INFO_PATH}"
61+
# --ignore-errors mismatch --ignore-errors negative: lcov bug in gcc 13, 14
62+
"${LCOV_PATH}" -c -d "${BUILD_WORKSPACE_PATH}" --gcov-tool ${GCOV_PATH} \
63+
-o "${RAW_TEST_COVERAGE_INFO_PATH}" \
64+
--ignore-errors mismatch --ignore-errors negative
5965

6066
# Append zero coverage data and tests coverage data
6167
"${LCOV_PATH}" -o "${RAW_COVERAGE_INFO_PATH}" \
6268
-a "${RAW_BASE_COVERAGE_INFO_PATH}" \
6369
-a "${RAW_TEST_COVERAGE_INFO_PATH}"
6470

6571
# Extract data for particular pathes
66-
"${LCOV_PATH}" -e "${RAW_COVERAGE_INFO_PATH}" -o "${EXTRACTED_COVERAGE_INFO_PATH}" \
72+
"${LCOV_PATH}" -e "${RAW_COVERAGE_INFO_PATH}" \
73+
-o "${EXTRACTED_COVERAGE_INFO_PATH}" \
6774
"${CANDIDATES[@]}"
6875

6976
# Exclude test files from coverage report
7077
# Exclude flatbuffer generated files from coverage report
7178
# Exclude external source from coverage report
72-
"${LCOV_PATH}" -r "${EXTRACTED_COVERAGE_INFO_PATH}" -o "${EXCLUDED_COVERAGE_INFO_PATH}" \
79+
# --ignore-errors unused: skip unused file/directory pattern error for generalization
80+
"${LCOV_PATH}" -r "${EXTRACTED_COVERAGE_INFO_PATH}" --ignore-errors unused \
81+
-o "${EXCLUDED_COVERAGE_INFO_PATH}" \
7382
'*.test.cpp' '*.test.cc' '*/test/*' '*/tests/*' '.test.h' '*/test_models/*' \
7483
'*_generated.h' \
7584
'*/externals/*' '*/3rdparty/*'

0 commit comments

Comments
 (0)