aboutsummaryrefslogtreecommitdiff
path: root/scripts/fuzz.sh
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-10-19 21:35:22 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-10-19 21:35:22 +0200
commit51f8583447a97fbd913ef961bf85a22a925395cc (patch)
treeadb25827f65e3780c2e673a3f9c2b324e402dc90 /scripts/fuzz.sh
parent84be0dea9d3e32785f786fe40af1adbad24ce9e0 (diff)
downloadtools.nes-51f8583447a97fbd913ef961bf85a22a925395cc.tar.gz
tools.nes-51f8583447a97fbd913ef961bf85a22a925395cc.zip
vnf: add fuzzy testing
This takes advantage of the fact that fuzzy testing happens after building all the ROM files. With that, we can use these files so libfuzzer can take them as the corpus. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'scripts/fuzz.sh')
-rwxr-xr-xscripts/fuzz.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/fuzz.sh b/scripts/fuzz.sh
index d2fd00a..fb13e49 100755
--- a/scripts/fuzz.sh
+++ b/scripts/fuzz.sh
@@ -10,3 +10,12 @@ popd
pushd lib/header
cargo +nightly fuzz run fuzz-target-header -- -max_total_time=180
popd
+
+# For vnf, we want to give it some ROM files as a corpus so it does a better job
+# at fuzzing, otherwise vnf would just return a super early normal error and
+# quit.
+mkdir -p lib/vnf/fuzz/corpus/fuzz-target-vnf
+cp tests/out/*.nes lib/vnf/fuzz/corpus/fuzz-target-vnf/
+pushd lib/vnf
+cargo +nightly fuzz run fuzz-target-vnf -- -max_total_time=180
+popd