mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-03-23 00:43:34 -04:00
41 lines
1.9 KiB
Bash
Executable File
41 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
Fail()
|
|
{
|
|
echo "FATAL($0): $1"
|
|
exit 1
|
|
}
|
|
rm -rf exe
|
|
rm -f test/{moonphase,positions,riseset,seasons,culminate,horizon,lunar_eclipse}.txt
|
|
dotnet build --output ${PWD}/exe || Fail "Error building ${PWD}/demo.sln"
|
|
|
|
echo "Testing example: moonphase.cs"
|
|
dotnet exe/moonphase.dll 2019-06-15T09:15:32.987Z > test/moonphase.txt || Fail "Error testing moonphase.cs"
|
|
diff test/moonphase.txt test/moonphase_correct.txt || Fail "Error comparing moonphase.cs output."
|
|
|
|
echo "Testing example: positions.cs"
|
|
dotnet exe/positions.dll +45.6 -90.7 2018-11-30T17:55:07.234Z > test/positions.txt || Fail "Error testing positions.cs"
|
|
diff test/positions.txt test/positions_correct.txt || Fail "Error comparing positions.cs output."
|
|
|
|
echo "Testing example: riseset.cs"
|
|
dotnet exe/riseset.dll 45 -90 2019-06-14T21:45:25Z > test/riseset.txt || Fail "Error testing riseset.cs"
|
|
diff test/riseset.txt test/riseset_correct.txt || Fail "Error comparing riseset.cs output."
|
|
|
|
echo "Testing example: seasons.cs"
|
|
dotnet exe/seasons.dll 2020 > test/seasons.txt || Fail "Error testing seasons.cs"
|
|
diff test/seasons.txt test/seasons_correct.txt || Fail "Error comparing seasons.cs output."
|
|
|
|
echo "Testing example: culminate.cs"
|
|
dotnet exe/culminate.dll +30 -90 2015-02-28T00:00:00Z > test/culminate.txt || Fail "Error testing culminate.cs."
|
|
diff test/culminate.txt test/culminate_correct.txt || Fail "Error comparing culminate.cs output."
|
|
|
|
echo "Testing example: horizon.cs"
|
|
dotnet exe/horizon.dll +25.5 -85.3 2016-12-25T12:30:45Z > test/horizon.txt || Fail "Error testing horizon.cs"
|
|
diff test/horizon.txt test/horizon_correct.txt || Fail "Error comparing horizon.cs output."
|
|
|
|
echo "Testing example: lunar_eclipse.cs"
|
|
dotnet exe/lunar_eclipse.dll 1988-01-01T00:00:00Z > test/lunar_eclipse.txt || Fail "Error running lunar_eclipse.cs."
|
|
diff test/lunar_eclipse.txt test/lunar_eclipse_correct.txt || Fail "Error comparing lunar_eclipse.cs output."
|
|
|
|
echo "PASS: C# examples"
|
|
exit 0
|