Skip to content

Commit 5d27ce5

Browse files
committed
rust coverage: remaps every rust subdirectory in fuzz
So that projects not using default fuzz_targets subdir get the good remap, and hence the good coverage report
1 parent 15953ac commit 5d27ce5

File tree

1 file changed

+5
-1
lines changed
  • infra/base-images/base-builder

1 file changed

+5
-1
lines changed

infra/base-images/base-builder/cargo

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ then
3535
# go into fuzz directory if not already the case
3636
cd fuzz || true
3737
fuzz_src_abspath=`pwd`
38-
export RUSTFLAGS="$RUSTFLAGS --remap-path-prefix fuzz_targets=$fuzz_src_abspath/fuzz_targets"
38+
# Default directory is fuzz_targets, but some projects like image-rs use fuzzers.
39+
while read i; do
40+
export RUSTFLAGS="$RUSTFLAGS --remap-path-prefix $i=$fuzz_src_abspath/$i"
41+
# Bash while syntax so that we modify RUSTFLAGS in main shell instead of a subshell.
42+
done <<< "$(ls */*.rs | cut -d/ -f1 | uniq)"
3943
# we do not want to trigger debug assertions and stops
4044
export RUSTFLAGS="$RUSTFLAGS -C debug-assertions=no"
4145
# do not optimize with --release, leading to Malformed instrumentation profile data

0 commit comments

Comments
 (0)