summaryrefslogtreecommitdiffstats
path: root/tests/fuzz.sh
blob: 5e21c3739556ff6169732916a18b7a2d82393d3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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