Files
astronomy/generate/unit_test_c
Don Cross 3d38890aaf Merge branch 'master' into csharp.
Includes coordinate transform logic support in
C, JavaScript, and Python.
Will start porting to C# soon.
2019-12-19 14:28:09 -05:00

30 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
Fail()
{
echo "ERROR($0): $1"
exit 1
}
./ctbuild $1 || exit 1
./ctest refraction || Fail "Failure in ctest refraction"
./ctest rotation || Fail "Failure in ctest rotation"
./ctest moon || Fail "Failure in ctest moon"
time ./ctest || Fail "Failure reported by ctest."
./generate check temp/c_check.txt || Fail "Verification failure for C unit test output."
./ctest diff temp/c_check.txt temp/js_check.txt || Fail "Diff(C,JS) failure."
./ctest diff temp/c_check.txt dotnet/csharp_test/csharp_check.txt || Fail "Diff(C,C#) failure."
./ctest seasons seasons/seasons.txt || Fail "Failed C seasons test."
./ctest moonphase moonphase/moonphases.txt || Fail "Failed C moon phase test."
./ctest elongation || Fail "Failed C elongation tests."
for file in temp/c_longitude_*.txt; do
./generate check ${file} || Fail "Failed verification of file ${file}"
echo ""
done
./ctest riseset riseset/riseset.txt || Fail "Failed C rise/set tests."
./ctest magnitude || Fail "Failed C magnitude tests."
./ctest apsis apsides/moon.txt || Fail "Failed C apsis tests."
echo "unit_test_c: success"
exit 0