summaryrefslogtreecommitdiffstats
path: root/tests/fuzz.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fuzz.sh')
-rwxr-xr-xtests/fuzz.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/fuzz.sh b/tests/fuzz.sh
new file mode 100755
index 0000000..5e21c37
--- /dev/null
+++ b/tests/fuzz.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+TESTDIR=${abs_top_testdir:-$(dirname "$0")}
+DIR=${PWD}
+
+MAXLINES=128
+l=1
+
+corpus=$(ls "$TESTDIR/corpus-execute-command/"*)
+
+while :; do
+ echo "Passing test cases $l to $((l + MAXLINES))"
+ tmp=$(echo "${corpus}" | sed -n "${l},$((l + MAXLINES))p")
+ [ -z "${tmp}" ] && exit 0
+ ${DIR}/fuzz ${tmp}
+ rc=$?
+ [ $rc -ne 0 ] && exit $rc
+ l=$((l + MAXLINES))
+done