File 0189-CT-Better-format-external-exits.patch of Package erlang
From bb57786285f53d2aba3cef63f23e9ceb29632e48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= <essen@ninenines.eu>
Date: Mon, 13 Oct 2025 12:07:53 +0200
Subject: [PATCH 1/2] CT: Better format external exits
Before:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Error detected: {'EXIT',{badmatch,{...}}}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
After:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Error detected: {'EXIT',{badmatch,[{watchdog,<0.1038.0>},
{ref,...}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---
lib/common_test/src/ct_framework.erl | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index 242fd3ce1e..1c69d31506 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -949,6 +949,15 @@ error_notification(Mod,Func,_Args,{Error,Loc}) ->
true ->
io_lib:format("{badmatch,~ts}",[Descr1])
end;
+ {'EXIT',Descr} ->
+ Descr1 = io_lib:format("~tP",[Descr,10]),
+ DescrLength = string:length(Descr1),
+ if DescrLength > 50 ->
+ Descr2 = string:slice(Descr1,0,50),
+ io_lib:format("{'EXIT',~ts...}",[Descr2]);
+ true ->
+ io_lib:format("{'EXIT',~ts}",[Descr1])
+ end;
{test_case_failed,Reason} ->
case (catch io_lib:format("{test_case_failed,~ts}", [Reason])) of
{'EXIT',_} ->
--
2.51.0