VolksForth/8080/CPM/tests/evaluate-test.sh
Philip Zembrod 20a2715203 First properly evaluated CPM test: log-test, with golden file,
evaluate script and script to cut off CPM text files at ctrl-z (EOF)
2023-07-02 00:11:52 +02:00

17 lines
474 B
Bash
Executable File

#!/bin/bash
testsdir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")"
basedir="$(realpath --relative-to="$PWD" "${testsdir}/..")"
testname="$1"
diff --ignore-trailing-space "${basedir}/${testname}.golden" \
"${basedir}/${testname}.log" > tmp.result
exitcode=$?
test $exitcode -eq 0 \
&& echo "PASS: ${testname}" >> tmp.result \
|| echo "FAIL: ${testname}" >> tmp.result
cat tmp.result
mv tmp.result "${basedir}/${testname}.result"
exit $exitcode