File 1412-ssh-add-CT_LOG-CT_PAL-to-ssh_test_lib.hrl.patch of Package erlang

From 7ba2661f9344052d66b6f7fe45a14bea990d78aa Mon Sep 17 00:00:00 2001
From: Jakub Witczak <kuba@erlang.org>
Date: Mon, 22 Sep 2025 16:29:45 +0200
Subject: [PATCH 2/5] ssh: add CT_LOG, CT_PAL to ssh_test_lib.hrl

---
 lib/ssh/test/ssh_test_lib.hrl | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/lib/ssh/test/ssh_test_lib.hrl b/lib/ssh/test/ssh_test_lib.hrl
index 89e5e1e194..1b6c02aab0 100644
--- a/lib/ssh/test/ssh_test_lib.hrl
+++ b/lib/ssh/test/ssh_test_lib.hrl
@@ -80,12 +80,26 @@
 -define(wait_match(Pattern, FunctionCall),
         ?wait_match(Pattern, FunctionCall, ok)).
 
-%%-------------------------------------------------------------------------
-%% Write file into log
-%%-------------------------------------------------------------------------
 -define(ct_log_show_file(File),
         (fun(File__) ->
                 {ok,Contents__} = file:read_file(File__),
                 ct:log("~p:~p Show file~n~s =~n~s~n",
                        [?MODULE,?LINE,File__, Contents__])
         end)(File)).
+
+-define(SSH_TEST_LIB_FORMAT, "(~s ~p:~p in ~p) ").
+-define(SSH_TEST_LIB_ARGS,
+        [erlang:pid_to_list(self()), ?MODULE, ?LINE, ?FUNCTION_NAME]).
+-define(CT_LOG(F),
+        (ct:log(?SSH_TEST_LIB_FORMAT ++ F, ?SSH_TEST_LIB_ARGS, [esc_chars]))).
+-define(CT_LOG(F, Args),
+        (ct:log(
+           ?SSH_TEST_LIB_FORMAT ++ F,
+           ?SSH_TEST_LIB_ARGS ++ Args,
+           [esc_chars]))).
+-define(CT_PAL(F),
+        (ct:pal(?SSH_TEST_LIB_FORMAT ++ F, ?SSH_TEST_LIB_ARGS))).
+-define(CT_PAL(F, Args),
+        (ct:pal(?SSH_TEST_LIB_FORMAT ++ F, ?SSH_TEST_LIB_ARGS ++ Args))).
+-define(CT_FAIL(F, Args),
+        (ct:fail(?SSH_TEST_LIB_FORMAT ++ F, ?SSH_TEST_LIB_ARGS ++ Args))).
-- 
2.51.0

openSUSE Build Service is sponsored by