Skip to content
Snippets Groups Projects
Commit 0f148470 authored by trinity-1686a's avatar trinity-1686a
Browse files

update comments in coverage_fuzz_corpora

parent b380c25e
No related branches found
No related tags found
No related merge requests found
......@@ -12,32 +12,22 @@ coverage_dir=$(dirname "$LLVM_PROFILE_FILE")
TOPDIR=$(realpath "$(dirname "$0")/..")
cd "$TOPDIR"
# for some reason, compiling with coverage is very slow, especially for curve25519-dalek,
# and mixing normal runs and coverage runs trash the cache. Here we set an alternative
# target directory so it's possible to reuse cached artifacts between coverage runs.
# set an alternative target directory so it's possible to reuse cached artifacts between coverage
# runs of coverage and fuzzing.
export CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-target-coverage}
# remove comments starting with #@ to run in parallel. This makes output very messy, uses a lot more
# ram and make the load average go crazy, but it's also way faster both to compile (due to
# curve25519-dalek compilation being so slow, and it using a single core), and to run because it's
# essentially monothreaded too.
for d in ./crates/*/fuzz; do
#@{
pushd "$(dirname "$d")"
crate=$(basename "$(dirname "$d")")
mkdir -p "$TOPDIR/target/debug/$crate"
mkdir -p "$coverage_dir/$crate"
for fuzzer in $(cargo fuzz list); do
cargo fuzz coverage "$fuzzer" --sanitizer=none
# we copy binary and coverage data where with_coverage expect it to be
cp "target-coverage/x86_64-unknown-linux-gnu/release/$fuzzer" "$TOPDIR/target/debug/$crate/$fuzzer"
mv "fuzz/coverage/$fuzzer/raw" "$coverage_dir/$crate/$fuzzer"
done
popd
#@}&
pushd "$(dirname "$d")"
crate=$(basename "$(dirname "$d")")
mkdir -p "$TOPDIR/target/debug/$crate"
mkdir -p "$coverage_dir/$crate"
for fuzzer in $(cargo fuzz list); do
# disable sanitizer to work in stable. Also make curve25519-dalek compilation much faster
cargo fuzz coverage "$fuzzer" --sanitizer=none
# we copy binary and coverage data where with_coverage expect it to be
cp "target-coverage/x86_64-unknown-linux-gnu/release/$fuzzer" "$TOPDIR/target/debug/$crate/$fuzzer"
mv "fuzz/coverage/$fuzzer/raw" "$coverage_dir/$crate/$fuzzer"
done
popd
done
#@for d in ./crates/*/fuzz; do
#@ wait
#@done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment