#!/bin/sh # test a health binary if [ "$1" = "" ]; then echo "usage: $0 ./health.exe" exit fi # all of health's output is to stderr echo "running: $1 5 500 1 1 2>output" if ! $1 5 500 1 1 2>output; then echo "$1 failed directly" exit 2 fi if ! diff out.orig output >out.diff 2>&1 ; then if ! diff out.orig.msvc output >/dev/null ; then echo "$1 got the wrong answer. See out.diff" exit 4 fi fi echo "$1 seems to work" rm -f out.diff