Files
astronomy/generate/unit_test_python
Don Cross f85025da31 Implemented astro_check in Python. Exercises major parts of the code.
There is still a slight discrepancy in calculations of altitude,azimuth
that is larger than between JS and C.
2019-06-26 21:12:27 -04:00

19 lines
657 B
Bash
Executable File

#!/bin/bash
Fail()
{
echo "ERROR($0): $1"
exit 1
}
python3 --version || Fail "Cannot print python version"
python3 test.py time || Fail "Failure reported by test.py (time)"
python3 test.py moon || Fail "Failure reported by test.py (moon)"
echo "$0: Generating Python test output."
time python3 test.py astro_check > temp/py_check.txt || Fail "Failure in Python astro_check"
./generate check temp/py_check.txt || Fail "Verification failure for Python unit test output."
if false; then
# For some reason (alt, az) calculations are a tiny bit off (8e-11) in Python.
./ctest diff temp/{py,js}_check.txt || Fail "Diff(py,js) failure."
fi
exit 0