1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-08 07:58:06 +11:00
collapseos/tests/shell/runtests.sh
Virgil Dupras eed67c4768 tests/shell: bring back the static test.cfs
I had forgotten about that ordering thing: depending on the platform
cfspack doesn't read files in a directory in the same order.
2019-12-31 15:17:22 -05:00

29 lines
487 B
Bash
Executable File

#!/bin/sh -e
EMULDIR=../../emul
SHELL="${EMULDIR}/shell/shell"
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