File 4322-ct-Add-Testcase-callback-attribute-to-ct_suite.patch of Package erlang
From 19171911e14f75a97eebda7d387dc4199f109b6c Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Wed, 27 Sep 2023 16:02:27 +0200
Subject: [PATCH 2/2] ct: Add 'Testcase' callback attribute to ct_suite
---
lib/common_test/src/ct_suite.erl | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/lib/common_test/src/ct_suite.erl b/lib/common_test/src/ct_suite.erl
index 860efe3ae2..603485c77a 100644
--- a/lib/common_test/src/ct_suite.erl
+++ b/lib/common_test/src/ct_suite.erl
@@ -1,5 +1,4 @@
-module(ct_suite).
-
%%------------------------------------------------------------------
%% Test Suite Behaviour
%% ------------------------------------------------------------------
@@ -117,6 +116,20 @@
{fail, Reason :: term()} |
{save_config, SaveConfig :: ct_config()}.
+-callback 'Testcase'(Config) ->
+ term() |
+ {skip, Reason} |
+ {comment, Comment} |
+ {save_config, SaveConfig} |
+ {skip_and_save, Reason, SaveConfig}
+ when
+ Config :: ct_config(),
+ SaveConfig :: ct_config(),
+ Reason :: term(),
+ Comment :: string().
+
+-callback 'Testcase'() -> [ct_info()].
+
%% only all/0 is mandatory
-optional_callbacks([groups/0,
suite/0,
@@ -126,5 +139,7 @@
init_per_group/2,
end_per_group/2,
init_per_testcase/2,
- end_per_testcase/2
+ end_per_testcase/2,
+ 'Testcase'/1,
+ 'Testcase'/0
]).
--
2.35.3