Skip to content

Return a non-zero exit code from the Delphi serializer test on failure - #4063

Merged
Jens-G merged 1 commit into
apache:masterfrom
Jens-G:delphi-testserializer-exitcode
Oct 28, 2026
Merged

Jens-G merged 1 commit into
apache:masterfrom
Jens-G:delphi-testserializer-exitcode

Conversation

@Jens-G

@Jens-G Jens-G commented Oct 28, 2026

Copy link
Copy Markdown
Member

TTestSerializer.RunTests() in lib/delphi/test/serializer/TestSerializer.Tests.pas caught the exception of a failing test, printed it and waited for ENTER, but never set ExitCode. After a failure the process therefore ended with exit code 0, and a run with no input on stdin blocked at Readln. A scripted run either hung or looked successful.

The except block now sets ExitCode := 1 and waits for ENTER only when a debugger is attached, so the console still stays open when the program is started from the IDE. IsDebuggerPresent comes from the Windows unit, which the test already uses. The test suite client waits for ENTER on the same condition (Performance/PerfTests.pas).

Built with Delphi XE (Win32), with no compiler errors, warnings or hints. The failing test was a temporary ASSERT( FALSE, 'injected failure') in RunTests, which is not part of the commit. Stdin was open with no input:

state result
master, a test fails blocks at Readln; after ENTER, exit code 0
this branch, a test fails EAssertionFailed: injected failure, exit code 1, no wait
this branch, all tests pass exit code 0

No CI job builds or runs TestSerializer. #4060 also edits RunTests; the two branches merge cleanly.

  • No Apache Jira ticket: a small change to a test program
  • Single commit
  • Code change, so the commit carries no CI-skip marker.

🤖 Generated with Claude Code

Client: delphi

TTestSerializer.RunTests() printed a failing test's exception and then
waited for ENTER, and the process still ended with exit code 0. A
scripted run therefore either blocked or reported success. It now sets
ExitCode to 1 and waits for ENTER only when a debugger is attached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jens-G
Jens-G merged commit ebdafa6 into apache:master Oct 28, 2026
87 of 88 checks passed
@Jens-G
Jens-G deleted the delphi-testserializer-exitcode branch October 28, 2026 22:39
@mergeable mergeable Bot added the delphi label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant