#!/usr/bin/env bash set -euo pipefail cabal build prog="$(cabal exec -- sh -c 'echo "$PATH" | cut -d: -f1')/lisp" ok=1 for f in tests/*.lisp; do outf="$(sed 's/\.lisp$/.out/' <<<"$f")" echo "- $f" if [[ ! -f $outf ]]; then echo "WARNING: $outf not found" else diff -u <("$prog" "$f") "$outf" || ok=0 fi done if [[ $ok -eq 1 ]]; then echo "All OK" else echo "Some tests failed!" exit 1 fi