Files
astronomy/generate/unit_test_js
Don Cross 84d6aff35a JS: Added function DefineStar.
I'm starting to implement the ability to define
up to 8 distinct points in the sky as "stars"
that will be allowed as a `body` parameter to
some Astronomy Engine functions, to be determined.
2022-11-21 12:53:45 -05:00

28 lines
736 B
Bash
Executable File

#!/bin/bash
Fail()
{
echo "ERROR($0): $1"
exit 1
}
[[ "$1" == "" || "$1" == "-v" ]] || Fail "Invalid command line options."
time node --trace-uncaught test.js astro_check > temp/js_check.txt || Fail "Problem running JavaScript astro_check."
./generate $1 check temp/js_check.txt || Fail "Verification failure for JavaScript unit test output."
echo ""
echo "$0: Running check against JPL Horizons data."
./jplcheck || Fail "Error in JPL check."
node --trace-uncaught test.js $1 all || Fail "Failed JavaScript unit tests."
echo ""
echo "$0: Verifying elongation output."
for file in temp/js_longitude_*.txt; do
./generate $1 check ${file} || Fail "Failed verification of ${file}"
done
echo ""
echo "$0: SUCCESS."
exit 0