diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 21:41:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 21:41:43 +0000 |
commit | 92cccad89d1c12b39165d5f0ed7ccd2d44965a1a (patch) | |
tree | f59a2764cd8c50959050a428bd8fc935138df750 /tests/fuzz.sh | |
parent | Initial commit. (diff) | |
download | libtpms-92cccad89d1c12b39165d5f0ed7ccd2d44965a1a.tar.xz libtpms-92cccad89d1c12b39165d5f0ed7ccd2d44965a1a.zip |
Adding upstream version 0.9.2.upstream/0.9.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/fuzz.sh')
-rwxr-xr-x | tests/fuzz.sh | 19 |
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 |