Files
astronomy/generate/unit_test_js
Don Cross e9503bc202 Made 'generate check' output less verbose unless -v is specified.
This completes my initial pass for making unit test less verbose.
2020-05-26 12:23:40 -04:00

66 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
Fail()
{
echo "ERROR($0): $1"
exit 1
}
[[ "$1" == "" || "$1" == "-v" ]] || Fail "Invalid command line options."
time node astro_check.js > 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."
echo ""
echo "$0: Running test of moon phase search."
node moon_phase_test.js $1 || Fail "Failed moon phase test."
echo ""
echo "$0: Running lunar apsis tests."
node lunar_apsis_test.js || Fail "Failed lunar apsis test."
echo ""
echo "$0: Running lunar eclipse test."
node lunar_eclipse_test.js || Fail "Failed lunar eclipse test."
echo ""
echo "$0: Running planet apsis tests."
node planet_apsis_test.js || Fail "Failed planet apsis test."
echo ""
echo "$0: Running longitude tests."
node elong_test.js $1 || Fail "Failed longitude tests."
echo ""
echo "$0: Verifying elong_test output."
for file in temp/js_longitude_*.txt; do
./generate $1 check ${file} || Fail "Failed verification of ${file}"
done
echo ""
echo "$0: Running seasons test."
node seasons_test.js || Fail "Failed seasons test."
echo ""
echo "$0: Running rise/set test."
node rise_set_test.js || Fail "Failed rise/set test."
echo ""
echo "$0: Running magnitude tests."
node mag_test.js $1 || Fail "Failed magnitude tests."
echo ""
echo "$0: Running rotation tests."
node rotation.js $1 || Fail "Failed rotation tests."
echo ""
echo "$0: Running constellation tests."
node constellation.js || Fail "Failed constellation tests."
echo ""
echo "$0: SUCCESS."
exit 0