Files
astronomy/generate/unit_test_python
Don Cross cd058ccd89 Refactored Python unit tests to be table driven.
Now I can run any Python unit test by name, or specify 'all'
to run them all. This way I don't have to update scripts
every time I add a new Python unit test.
2020-06-03 12:27:20 -04:00

22 lines
630 B
Bash
Executable File

#!/bin/bash
Fail()
{
echo "ERROR($0): $1"
exit 1
}
[[ "$1" == "" || "$1" == "-v" ]] || Fail "Invalid command line options."
python3 --version || Fail "Cannot print python version"
python3 test.py $1 all || Fail "Failed Python unit tests."
for file in temp/py_longitude_*.txt; do
./generate $1 check ${file} || Fail "Failed verification of file ${file}"
done
echo "$0: Generating Python test output."
time python3 test.py astro_check > temp/py_check.txt || Fail "Failure in Python astro_check"
./generate $1 check temp/py_check.txt || Fail "Verification failure for Python unit test output."
echo "$0: PASS"
exit 0