#!/usr/bin/env bash # FIFA 17 squad-adapter mutation battery. # # Each mutation injects a specific WRONG behaviour into the committed source, # runs the one test that defends the invariant, and requires that test to FAIL # (non-zero exit) — i.e. the mutant is killed. The source is reverted via # `git checkout` after every mutation, so the tree is left untouched. # # A mutant that SURVIVES (its guard test still passes) means the invariant is # not actually defended; the battery then exits non-zero. # # Run from the adapter crate root: bash mutation-battery.sh set -u cd "$(dirname "$0")" FUT=src/fut PASS=0 FAIL=0 declare -a SURVIVORS=() # mutate (literal, multiline-safe) mutate() { OLD="$2" NEW="$3" perl -0777 -pi -e \ 's/\Q$ENV{OLD}\E/$ENV{NEW}/g or die "MUTATION PATTERN NOT FOUND in '"$1"'\n"' "$1" } # kill