File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,22 @@ jobs:
4545 echo "FortCov binary not found in build tree" >&2
4646 exit 2
4747 fi
48- # Ensure FortCov uses real gcov instead of synthesized .gcov files
49- export FORTCOV_USE_REAL_GCOV=1
50- # Enable auto-gcov generation to produce .gcov files in CI
51- set +e
52- "${FORTCOV_BIN}" --gcov --output=coverage.md
53- rc=$?
54- set -e
48+ # Generate .gcov from existing .gcda without invoking FortCov's bridge
49+ mapfile -t dirs < <(find . -type f -name '*.gcda' -printf '%h\n' 2>/dev/null | sort -u)
50+ for d in "${dirs[@]:-}"; do
51+ [ -n "$d" ] || continue
52+ ( cd "$d" && gcov -b -c . >/dev/null 2>&1 || true ) || true
53+ done
54+ # Run FortCov directly on discovered .gcov files to produce coverage.md
55+ GCOV_LIST=$(find . -type f -name '*.gcov' | tr '\n' ' ')
56+ if [ -n "$GCOV_LIST" ]; then
57+ set +e
58+ ${FORTCOV_BIN} --source=src $GCOV_LIST --output=coverage.md
59+ rc=$?
60+ set -e
61+ else
62+ rc=3
63+ fi
5564 # Fallback: if FortCov failed to produce coverage.md, synthesize a minimal
5665 # markdown with TOTAL row from Cobertura XML so comparison can proceed.
5766 if [ ! -f coverage.md ]; then
You can’t perform that action at this time.
0 commit comments