#!/bin/sh input=$1 input=${input#*/tests/scripts/} expected=${input%%/*} ext=${input##*.} check() { status=$1 case $status in 0|1) ;; *) exit 99 ;; esac case $expected in bad) [ "$status" -eq 1 ] ;; *) [ "$status" -eq 0 ] ;; esac if [ "$?" -ne 0 ]; then exit 1 fi } case $expected in good) export APLWC_FAILSIM_STRICT=1 ;; bad) export APLWC_FAILSIM_STRICT=0 ;; esac if [ -x "$1" ] then "$1" check $? fi case "$ext" in aplwc) aplwc -x "$1" check $? if [ -f "$1.output" ] then aplwc -x "$1" 2>&1 | cmp - "$1.output" if [ "$?" -ne 0 ] then exit 1 fi fi ;; esac case $expected in *) "$srcdir/tests/scripts/simfail.sh" "$1" check $? esac