@@ -104,21 +104,36 @@ fuzz_report:
104104 fi ; \
105105 done
106106
107- # Generate HTML coverage report
107+ # Generate unified HTML coverage report for all fuzzers
108108.PHONY : fuzz_report_html
109109fuzz_report_html :
110+ @# Check coverage directory exists and has data
110111 @if [ ! -d " $( FUZZ_COVERAGE_DIR) " ] || [ -z " $$ (ls -A $( FUZZ_COVERAGE_DIR) 2>/dev/null)" ]; then \
111112 echo " Error: Coverage directory is empty. Please run the fuzzer with ENABLE_COVERAGE flag ON" ; \
112113 exit 1; \
113114 fi
115+ @# Merge all profraw files into a single profdata file
114116 @llvm-profdata merge -sparse $(FUZZ_COVERAGE_DIR ) /* .profraw -o $(FUZZ_COVERAGE_DIR ) /coverage.profdata
115- @for fuzzer in $(FUZZ_BUILD_DIR ) /fuzz-* ; do \
116- if [ -x " $$ fuzzer" ]; then \
117- llvm-cov show $$ fuzzer -instr-profile=$(FUZZ_COVERAGE_DIR ) /coverage.profdata \
118- -format=html -output-dir=$(FUZZ_COVERAGE_DIR ) /report_html_$$(basename $$fuzzer) ; \
119- fi ; \
120- done
121- @echo " HTML coverage reports generated in $( FUZZ_COVERAGE_DIR) /report_html_*"
117+ @echo " Generating unified coverage report for all fuzzers..."
118+ @rm -rf $(FUZZ_COVERAGE_DIR ) /report_html_unified
119+ @# Generate HTML report with all fuzzer binaries
120+ @llvm-cov show \
121+ $(FUZZ_BUILD_DIR ) /fuzz-base58 \
122+ -object $(FUZZ_BUILD_DIR ) /fuzz-base64 \
123+ -object $(FUZZ_BUILD_DIR ) /fuzz-bech32 \
124+ -object $(FUZZ_BUILD_DIR ) /fuzz-hexutils \
125+ -object $(FUZZ_BUILD_DIR ) /fuzz-segwit_addr \
126+ -instr-profile=$(FUZZ_COVERAGE_DIR ) /coverage.profdata \
127+ -format=html \
128+ -output-dir=$(FUZZ_COVERAGE_DIR ) /report_html_unified \
129+ -show-line-counts-or-regions \
130+ -show-instantiations \
131+ -show-expansions
132+ @echo " Unified HTML coverage report generated in $( FUZZ_COVERAGE_DIR) /report_html_unified"
133+ @# Open report in default browser (cross-platform)
134+ @open $(FUZZ_COVERAGE_DIR ) /report_html_unified/index.html 2> /dev/null || \
135+ xdg-open $(FUZZ_COVERAGE_DIR ) /report_html_unified/index.html 2> /dev/null || \
136+ echo " Please open manually: $( FUZZ_COVERAGE_DIR) /report_html_unified/index.html"
122137
123138# === PYTHON FORMATTING TARGETS ===
124139
0 commit comments