File: fuzz.sh

package info (click to toggle)
libtpms 0.10.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,188 kB
  • sloc: ansic: 120,340; makefile: 829; sh: 336; cpp: 125
file content (19 lines) | stat: -rwxr-xr-x 382 bytes parent folder | download | duplicates (3)
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