Repository navigation
Return a non-zero exit code from the Delphi serializer test on failure - #4063
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TTestSerializer.RunTests()inlib/delphi/test/serializer/TestSerializer.Tests.pascaught the exception of a failing test, printed it and waited for ENTER, but never setExitCode. After a failure the process therefore ended with exit code 0, and a run with no input on stdin blocked atReadln. A scripted run either hung or looked successful.The
exceptblock now setsExitCode := 1and waits for ENTER only when a debugger is attached, so the console still stays open when the program is started from the IDE.IsDebuggerPresentcomes from theWindowsunit, 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')inRunTests, which is not part of the commit. Stdin was open with no input:Readln; after ENTER, exit code 0EAssertionFailed: injected failure, exit code 1, no waitNo CI job builds or runs
TestSerializer. #4060 also editsRunTests; the two branches merge cleanly.🤖 Generated with Claude Code