File: quickchick

package info (click to toggle)
coq-quickchick 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,432 kB
  • sloc: ml: 4,367; ansic: 789; makefile: 388; sh: 27; python: 4; perl: 2; lisp: 2
file content (27 lines) | stat: -rwxr-xr-x 628 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
set -e

# Test mutated QuickChick test executable ($1)
# quickchick-expectfailure must be findable in PATH

QC_OUT_DIR=qc-out
mkdir -p $QC_OUT_DIR/

QC_ALL_MUTANTS_FILE=$QC_OUT_DIR/qc-mutants

# Dynamic mutant discovery
# TODO: allow mutants to be found via other means
QC_MUTANT=DISCOVERY ./"$1"

# Test each mutant
xargs -n 1 -I {} quickchick-expectfailure ./"$1" {} < $QC_ALL_MUTANTS_FILE

if [ "$2" != "" ]
then
  N_MUTANTS=$(wc -l $QC_ALL_MUTANTS_FILE|egrep -o "[0-9]+")
  if [ -z "$N_MUTANTS" ] || [ $2 -ne $N_MUTANTS ]
  then
    echo "Unexpected number of mutants: $N_MUTANTS (expected $2)"
    exit 1
  fi
fi