2019-12-12 14:32:47 -05:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2019-12-31 13:32:09 -05:00
|
|
|
EMULDIR=../../emul
|
2019-12-31 13:07:05 -05:00
|
|
|
SHELL="${EMULDIR}/shell/shell"
|
2019-12-12 14:32:47 -05:00
|
|
|
|
|
|
|
replay() {
|
|
|
|
fn=$1
|
|
|
|
replayfn=${fn%.*}.expected
|
2019-12-31 15:17:22 -05:00
|
|
|
ACTUAL=$("${SHELL}" -f test.cfs < "${fn}" 2> /dev/null)
|
2019-12-12 14:32:47 -05:00
|
|
|
EXPECTED=$(cat ${replayfn})
|
|
|
|
if [ "$ACTUAL" = "$EXPECTED" ]; then
|
|
|
|
echo ok
|
|
|
|
else
|
|
|
|
echo different. Whole output:
|
|
|
|
echo "${ACTUAL}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -z $1 ]; then
|
|
|
|
replay $1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
for fn in *.replay; do
|
|
|
|
echo "Replaying ${fn}"
|
|
|
|
replay "${fn}"
|
|
|
|
done
|