Files
astronomy/generate/unit_test_python
Don Cross 9c4b6e9f87 Fixed pylint problems on Raspberry Pi.
The current Raspbian uses an older version of pylint
that suffers from a recursion overflow. Hacked a deeper
recursion limit to work around this issue.
Also directly calling 'pylint' does not work in Raspbian.
Instead of trying to figure out why, I just use 'python3 -m'
to invoke pylint.
2021-09-26 19:30:55 -04:00

23 lines
768 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 -m pylint --init-hook="import sys; sys.setrecursionlimit(2000)" ../source/python/astronomy.py || Fail "pylint detected problems"
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