mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-03 16:47:47 +08:00
updated coverage option
This commit is contained in:
@@ -88,11 +88,12 @@ jobs:
|
||||
else
|
||||
GCOV_TOOL="gcov"
|
||||
fi
|
||||
LCOV_IGNORE=(--ignore-errors gcov,source,graph)
|
||||
LCOV_IGNORE=(--ignore-errors gcov,source,graph,mismatch)
|
||||
|
||||
lcov --gcov-tool "$GCOV_TOOL" "${LCOV_IGNORE[@]}" \
|
||||
--capture \
|
||||
--directory ${{ github.workspace }}/build \
|
||||
--directory ${{ github.workspace }}/build/corelib/src \
|
||||
--directory ${{ github.workspace }}/build/utilite/src \
|
||||
--output-file lcov.info
|
||||
|
||||
lcov "${LCOV_IGNORE[@]}" --extract lcov.info \
|
||||
@@ -109,7 +110,7 @@ jobs:
|
||||
lcov --summary lcov.info
|
||||
|
||||
- name: HTML coverage report
|
||||
run: genhtml lcov.info --output-directory coverage-html --legend --demangle-cpp
|
||||
run: genhtml --ignore-errors source,mismatch lcov.info --output-directory coverage-html --legend --demangle-cpp
|
||||
|
||||
- name: Upload HTML coverage artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
+6
-3
@@ -32,7 +32,7 @@ detect_gcov_tool() {
|
||||
fi
|
||||
}
|
||||
GCOV_TOOL="$(detect_gcov_tool)"
|
||||
LCOV_IGNORE=(--ignore-errors gcov,source,graph)
|
||||
LCOV_IGNORE=(--ignore-errors gcov,source,graph,mismatch)
|
||||
|
||||
configure_coverage_build() {
|
||||
local -a gtest_args=()
|
||||
@@ -94,7 +94,10 @@ echo "Running tests..."
|
||||
|
||||
echo "Capturing coverage..."
|
||||
lcov --gcov-tool "$GCOV_TOOL" "${LCOV_IGNORE[@]}" \
|
||||
--capture --directory "$BUILD_DIR" --output-file "$INFO_FILE"
|
||||
--capture \
|
||||
--directory "$BUILD_DIR/corelib/src" \
|
||||
--directory "$BUILD_DIR/utilite/src" \
|
||||
--output-file "$INFO_FILE"
|
||||
|
||||
echo "Filtering coverage data (repo sources only)..."
|
||||
lcov "${LCOV_IGNORE[@]}" --extract "$INFO_FILE" \
|
||||
@@ -110,7 +113,7 @@ lcov "${LCOV_IGNORE[@]}" --remove "$INFO_FILE" \
|
||||
|
||||
echo "Generating HTML..."
|
||||
rm -rf "$HTML_DIR"
|
||||
genhtml "$INFO_FILE" --output-directory "$HTML_DIR" --legend --demangle-cpp
|
||||
genhtml --ignore-errors source,mismatch "$INFO_FILE" --output-directory "$HTML_DIR" --legend --demangle-cpp
|
||||
|
||||
echo ""
|
||||
echo "Done: $HTML_DIR/index.html"
|
||||
|
||||
Reference in New Issue
Block a user