shrub/sh/test
Benjamin Summers e2765f3d2d CI cleanup.
2019-12-10 23:39:52 -08:00

43 lines
606 B
Bash
Executable File

#!/usr/bin/env bash
set -e
stack test king --fast
pkg=$(nix-build nix/ops -A test --no-out-link "$@")
hdr () {
echo =====$(sed 's/./=/g' <<< "$1")=====
echo ==== $1 ====
echo =====$(sed 's/./=/g' <<< "$1")=====
}
for f in $(find $pkg/ -type f)
do
hdr $(basename $f)
cat $f
done
fail=0
for f in $(find "$pkg/" -type f)
do
if egrep "((FAILED|CRASHED)|(ford|warn):) " $f >/dev/null
then
if [[ $fail -eq 0 ]]
then
hdr "Test Failures"
fi
echo "ERROR Test failure in $(basename $f)"
((fail++))
fi
done
if [[ $fail -eq 0 ]]
then
hdr "Success"
fi
exit "$fail"