1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-27 21:48:05 +11:00
collapseos/tools/tests/shell/runtests.sh
Virgil Dupras c002c69208 Include tools/tests/shell/test.cfs in repo
The order in which cfspack includes its file depend on the platform. To have
tests that reliably pass, test.cfs has to be committed in.
2019-12-12 14:49:09 -05:00

29 lines
485 B
Bash
Executable File

#!/bin/sh -e
EMULDIR=../../emul
SHELL=../../emul/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