Files
astronomy/generate/unit_test_python
Don Cross b686b6185c Escalated mypy to use --strict option.
Use --strict in mypy to perform maximum type checking.
Fixed the remaining errors.
2023-02-21 15:34:52 -05:00

33 lines
1.1 KiB
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"
echo "$0: running pylint"
python3 -m pylint --init-hook="import sys; sys.setrecursionlimit(2000)" ../source/python/astronomy/astronomy.py || Fail "pylint detected problems"
echo "$0: running mypy"
cd ../source/python/astronomy || Fail "error changing to Python source directory"
mypy --strict --module astronomy || Fail "error checking types using mypy"
cd ../../../generate || Fail "error changing back to generate directory"
echo ""
echo "$0: running unit tests"
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