mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-02-25 03:07:19 -05:00
36 lines
1.5 KiB
Bash
Executable File
36 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
Fail()
|
|
{
|
|
echo "FATAL($(realpath $0)): $1"
|
|
exit 1
|
|
}
|
|
|
|
rm -f test/{moonphase,positions,riseset,seasons,culminate}.txt
|
|
|
|
echo "Testing example: moonphase.py"
|
|
./moonphase.py 2019-06-15T09:15:32.987Z > test/moonphase.txt || Fail "Error running moonphase.py."
|
|
diff test/moonphase.txt test/moonphase_correct.txt || Fail "Error comparing moonphase.py output."
|
|
|
|
echo "Testing example: riseset.py"
|
|
./riseset.py +45.6 -90.7 2018-11-30T17:55:07.234Z > test/riseset.txt || Fail "Error running riseset.py."
|
|
diff test/riseset.txt test/riseset_correct.txt || Fail "Error comparing riseset.py output."
|
|
|
|
echo "Testing example: positions.py"
|
|
./positions.py +45.6 -90.7 2018-11-30T17:55:07.234Z > test/positions.txt || Fail "Error running positions.py."
|
|
diff test/positions.txt test/positions_correct.txt || Fail "Error comparing positions.py output."
|
|
|
|
echo "Testing example: seasons.py"
|
|
./seasons.py 2019 > test/seasons.txt || Fail "Error running seasons.py."
|
|
diff test/seasons.txt test/seasons_correct.txt || Fail "Error comparing seasons.py output."
|
|
|
|
echo "Testing example: culminate.py"
|
|
./culminate.py +30 -90 2015-02-28T00:00:00Z > test/culminate.txt || Fail "Error running culminate.py."
|
|
diff test/culminate.txt test/culminate_correct.txt || Fail "Error comparing culminate.py output."
|
|
|
|
echo "Testing example: horizon.py"
|
|
./horizon.py +25.5 -85.3 2016-12-25T12:30:45Z > test/horizon.txt || Fail "Error running horizon.py."
|
|
diff test/horizon.txt test/horizon_correct.txt || Fail "Error comparing horizon.py output."
|
|
|
|
echo "PASS: Python examples"
|
|
exit 0
|