From 5208c4b354ee31d3dc3242d81cab70fd50b5977a Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Wed, 28 Oct 2026 23:04:14 +0100 Subject: [PATCH] Return a non-zero exit code from the Delphi serializer test on failure 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 --- lib/delphi/test/serializer/TestSerializer.Tests.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/delphi/test/serializer/TestSerializer.Tests.pas b/lib/delphi/test/serializer/TestSerializer.Tests.pas index 27830335028..8af91711799 100644 --- a/lib/delphi/test/serializer/TestSerializer.Tests.pas +++ b/lib/delphi/test/serializer/TestSerializer.Tests.pas @@ -813,7 +813,12 @@ procedure TTestSerializer.RunTests; except on e:Exception do begin Writeln( e.ClassName+': '+ e.Message); - Write('Hit ENTER to close ... '); Readln; + ExitCode := 1; + // keep the console open only when started from the IDE, never block a scripted run + if IsDebuggerPresent then begin + Write('Hit ENTER to close ... '); + Readln; + end; end; end; end;