File tree Expand file tree Collapse file tree 2 files changed +39
-2
lines changed Expand file tree Collapse file tree 2 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -137,3 +137,15 @@ RUSTFLAGS="--cfg=splicing" cargo test --verbose --color always -p lightning
137137RUSTFLAGS=" --cfg=async_payments" cargo test --verbose --color always -p lightning
138138[ " $CI_MINIMIZE_DISK_USAGE " != " " ] && cargo clean
139139RUSTFLAGS=" --cfg=lsps1_service" cargo test --verbose --color always -p lightning-liquidity
140+
141+ # Generate fuzz coverage report
142+ echo -e " \n\nGenerating fuzz coverage report"
143+ if [ -n " $CI " ]; then
144+ # In CI, store coverage in a specific directory for artifact collection
145+ COVERAGE_DIR=" coverage-report"
146+ mkdir -p " $COVERAGE_DIR "
147+ ./contrib/generate_fuzz_coverage.sh --output-dir " $COVERAGE_DIR "
148+ else
149+ # Local development
150+ ./contrib/generate_fuzz_coverage.sh
151+ fi
Original file line number Diff line number Diff line change 22set -e
33set -x
44
5+ # Parse command line arguments
6+ OUTPUT_DIR=" target/llvm-cov/html"
7+ while [[ $# -gt 0 ]]; do
8+ case $1 in
9+ --output-dir)
10+ OUTPUT_DIR=" $2 "
11+ shift 2
12+ ;;
13+ * )
14+ echo " Unknown option: $1 "
15+ echo " Usage: $0 [--output-dir OUTPUT_DIRECTORY]"
16+ exit 1
17+ ;;
18+ esac
19+ done
20+
521# Check if we're in the root directory, if so change to fuzz
622if [ -d " fuzz" ]; then
723 cd fuzz
@@ -32,11 +48,20 @@ if [ "$show_corpus_message" = true ]; then
3248 echo " "
3349fi
3450
51+ # Create output directory if it doesn't exist
52+ mkdir -p " $OUTPUT_DIR "
53+
3554export RUSTFLAGS=" --cfg=fuzzing --cfg=secp256k1_fuzz --cfg=hashes_fuzz"
3655# ignore anything in fuzz directory since we don't want coverage of targets
37- cargo llvm-cov --html --ignore-filename-regex " fuzz/"
56+ cargo llvm-cov --html --ignore-filename-regex " fuzz/" --output-dir " $OUTPUT_DIR "
57+
58+ # Check if coverage report was generated successfully
59+ if [ ! -f " $OUTPUT_DIR /index.html" ]; then
60+ echo " Error: Failed to generate coverage report"
61+ exit 1
62+ fi
3863
3964echo " "
40- echo " Coverage report generated in target/llvm-cov/html /index.html"
65+ echo " Coverage report generated in $OUTPUT_DIR /index.html"
4166
4267
You can’t perform that action at this time.
0 commit comments