fuzz: adds support for minimization via wasm-tools shrink (#1844)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
@@ -80,6 +80,16 @@ Minimize test case with:
|
||||
and you can use that command to "minimize" the input binary while keeping the same error.
|
||||
|
||||
|
||||
Alternatively, you can use the following command to minimize the arbitrary input binary:
|
||||
|
||||
```
|
||||
go test -c ./wazerolib -o nodiff.test && wasm-tools shrink ./predicate.sh original.{wasm,wat} -o shrinken.wasm --attempts 4294967295
|
||||
```
|
||||
|
||||
which uses `wasm-tools shrinken` command to minimize the input binary. Internally, the `predicate.sh` is invoked for each input binary
|
||||
where it executes the `nodiff.test` binary which runs `TestReRunFailedRequireNoDiffCase`.
|
||||
|
||||
|
||||
### Run fuzzing on wazevo
|
||||
|
||||
Until we replace the existing compiler with the new optimizing compiler `wazevo`,
|
||||
|
||||
12
internal/integration_test/fuzz/predicate.sh
Executable file
12
internal/integration_test/fuzz/predicate.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The Wasm file is given as the first and only argument to the script.
|
||||
WASM=$1
|
||||
|
||||
echo "Testing $WASM"
|
||||
|
||||
export WASM_BINARY_PATH=$WASM
|
||||
|
||||
# Run the test and reverse the exit code so that a non-zero exit code indicates interesting case.
|
||||
./nodiff.test
|
||||
exit $((! $?))
|
||||
Reference in New Issue
Block a user