This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit ebdd0eacc20b3537ee187724677c5a5729f14a0b Author: wangmingrong1 <[email protected]> AuthorDate: Mon Nov 2 16:08:35 2026 +0800 tools/gcov: export lcov info unconditionally in clang pipeline Move the lcov-format .info export to run unconditionally before HTML generation, instead of only inside the genhtml fallback path. This ensures downstream tools (e.g. cross-toolchain merge with gcc coverage via lcov --add-tracefile) can consume the .info file regardless of whether the HTML report succeeded. Signed-off-by: wangmingrong1 <[email protected]> --- tools/gcov.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/gcov.py b/tools/gcov.py index 32dbf114d18..2085a7f2f24 100755 --- a/tools/gcov.py +++ b/tools/gcov.py @@ -1094,6 +1094,15 @@ def run_clang_pipeline( log("\n=== Coverage Summary ===") clang_run_report(tools, profdata, cov_binary, path_map) + # Always export lcov .info so downstream tools (e.g. cross-toolchain merge + # with gcc coverage via lcov --add-tracefile) can consume it regardless of + # whether the HTML report succeeded. + cov_info = os.path.join(result_dir, "coverage.info") + try: + clang_run_export_lcov(tools, profdata, cov_binary, cov_info, path_map) + except subprocess.CalledProcessError as e: + warn(f"llvm-cov export (lcov format) failed: {e}") + # HTML: prefer llvm-cov show; fall back to genhtml(lcov-format export). try: clang_run_show_html(tools, profdata, cov_binary, report_dir, path_map) @@ -1107,8 +1116,6 @@ def run_clang_pipeline( if genhtml is None: die("HTML generation failed and genhtml is not available.") try: - cov_info = os.path.join(data_dir, "coverage.info") - clang_run_export_lcov(tools, profdata, cov_binary, cov_info, path_map) run_cmd( [ genhtml,
