collapseos/tests/shell/runtests.sh

29 lines
487 B
Bash
Raw Normal View History

2019-12-13 06:32:47 +11:00
#!/bin/sh -e
2020-01-01 05:32:09 +11:00
EMULDIR=../../emul
2020-01-01 05:07:05 +11:00
SHELL="${EMULDIR}/shell/shell"
2019-12-13 06:32:47 +11:00
replay() {
fn=$1
replayfn=${fn%.*}.expected
ACTUAL=$("${SHELL}" -f test.cfs < "${fn}" 2> /dev/null)
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