File 0722-fixup-CT-Add-source-filename-in-error-output-when-po.patch of Package erlang

From 86660db07f661257252e1d910a9486b1e283201d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= <essen@ninenines.eu>
Date: Tue, 13 Jan 2026 14:16:52 +0100
Subject: [PATCH 2/4] fixup! CT: Add source filename in error output when
 possible

---
 lib/common_test/test/ct_error_SUITE.erl | 33 ++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl
index 08f84b0609..2e2394d8f6 100644
--- a/lib/common_test/test/ct_error_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE.erl
@@ -66,7 +66,7 @@ end_per_testcase(TestCase, Config) ->
 suite() -> [{ct_hooks,[ts_install_cth]}].
 
 all() -> 
-    [cfg_error, lib_error, no_compile, timetrap_end_conf,
+    [cfg_error, lib_error, no_compile, no_debug_info, timetrap_end_conf,
      timetrap_normal, timetrap_extended, timetrap_parallel,
      timetrap_fun, timetrap_fun_group, timetrap_with_float_mult,
      misc_errors, config_restored, config_func_errors].
@@ -156,6 +156,37 @@ no_compile(Config) when is_list(Config) ->
     TestEvents = events_to_check(no_compile),
     ok = ct_test_support:verify_events(TestEvents, Events, Config).
 
+%%%-----------------------------------------------------------------
+%%%
+no_debug_info(Config) when is_list(Config) ->
+
+    DataDir = ?config(data_dir, Config),
+
+    TestDir = filename:join(DataDir, "error/test/"),
+    ModFile = filename:join(TestDir, "misc_error_1_SUITE.erl"),
+    ct:pal("Compiling ~p: ~p",
+	   [ModFile,compile:file(ModFile,[{outdir,TestDir},deterministic])]),
+
+    try
+    Join = fun(D, S) -> filename:join(D, "error/test/"++S) end,
+    Suites = [Join(DataDir, "misc_error_1_SUITE")],
+    {Opts,ERPid} = setup([{suite,Suites}], Config),
+    ok = ct_test_support:run(Opts, Config),
+    Events = ct_test_support:get_events(ERPid, Config),
+
+    ct_test_support:log_events(misc_errors,
+			       reformat(Events, ?eh),
+			       ?config(priv_dir, Config),
+			       Opts),
+
+    TestEvents = events_to_check(misc_errors),
+    ok = ct_test_support:verify_events(TestEvents, Events, Config)
+    after
+        ct:pal("Removing ~p", [ModFile]),
+        code:delete(misc_error_1_SUITE),
+        file:delete(filename:join(TestDir, "misc_error_1_SUITE.beam"))
+    end.
+
 %%%-----------------------------------------------------------------
 %%%
 timetrap_end_conf(Config) when is_list(Config) ->
-- 
2.51.0

openSUSE Build Service is sponsored by