In many of my Windows batch files, I used the following
construct to detect failures:
do_something
if errorlevel 1 (
echo.An error occurred in do_something
exit /b 1
)
I discovered that it is possible for a Windows program
to exit with a negative integer error code.
This causes the above construct to miss the failure
and the batch file blithely continues.
So I have replaced that construct with
do_something || (
echo.An error occurred in do_something
exit /b 1
)
This way, if the command exits with any nonzero error,
we correctly detect it as a failure.
Added Java demo to search for rise/set/culmination
of the Sun and Moon.
Also added the missing entry for the Kotlin
rise/set/culmination demo that I had forgotten.
Added Kotlin and Java demos for calculating Jupiter's moons.
Illustrates correcting for light travel time.
I added named getters for the 4 moons in `JupiterMoonsInfo`,
because in Java it was really ugly to write
`jm.getMoon()[0]`, etc.
I found that it is possible to use the "||" operator
in Windows batch files, and it works the same as the
"||" operator in bash scripts.
This inspired me to rework the bash scripts and
Windows batch files for running the Java/Kotlin demo
tests to be much more compact using functions/subroutines.
The best part is, the new approach will make it much
easier to add more demo tests in the future.
Removed the "now" test from Java demos, because it
does not follow the same pattern as the other demos,
plus it is not really demonstrating astronomy calculations.
Starting working on the Positions.kt demo; but not finished yet.
Run the Java demo unit test as part of the automated test suite.
If the test fails, print the xml test results to the screen,
so if it happens in GitHub Actions, we can see what went wrong
and diagnose the problem.