Commit Graph

12 Commits

Author SHA1 Message Date
Don Cross
7e196a3c17 Fixed Windows batch files ignoring negative integer failure codes.
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.
2023-02-26 10:26:42 -05:00
Don Cross
42650bd341 Java: added true solar time demo 2023-02-12 20:01:05 -05:00
Don Cross
29e2bd31b8 Java demo: lunar eclipse prediction 2022-05-04 13:04:39 -04:00
Don Cross
7a916d4f8c Java demo: rise/set/culmination
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.
2022-05-04 11:12:49 -04:00
Don Cross
f32a922ddb Demo for Kotlin, Java: constellation 2022-05-03 16:50:11 -04:00
Don Cross
1e84f4940f Demo jupiter_moons for Kotlin, Java.
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.
2022-05-02 15:45:10 -04:00
Don Cross
551ce7a249 Simplified Java/Kotlin demo tests.
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.
2022-05-02 10:21:23 -04:00
Don Cross
190cc5b534 Java: added positions demo. 2022-05-01 21:12:57 -04:00
Don Cross
eac8582418 Test Kotlin demos in Windows. 2022-05-01 19:48:18 -04:00
Don Cross
e81a566d1e Kotlin: was not running Java demo tests.
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.
2022-04-30 11:14:01 -04:00
Don Cross
3ca64f1ab2 Kotlin: fixed Java demo test for Windows.
I forgot to update the Windows batch file
for testing Java demo programs. Now it works
and correctly verifies the output of the
Java demo `MoonPhase`.
2022-04-28 21:52:33 -04:00
Don Cross
57ab910abb Automate validation of Java demos in Windows. 2022-03-22 16:04:36 -04:00