aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_framework.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2015-02-16 23:54:17 +0100
committerPeter Andersson <[email protected]>2015-02-16 23:54:17 +0100
commitcd0f2a81ebdd3b510821eef69ff3eafed8c41fb8 (patch)
treeabe74d778260742034f945b195684a33c70f7011 /lib/common_test/src/ct_framework.erl
parent33156218401ba0ba489d0d787367af82f56c5f3c (diff)
downloadotp-cd0f2a81ebdd3b510821eef69ff3eafed8c41fb8.tar.gz
otp-cd0f2a81ebdd3b510821eef69ff3eafed8c41fb8.tar.bz2
otp-cd0f2a81ebdd3b510821eef69ff3eafed8c41fb8.zip
Make it possible to print in the test case log from on_tc_* hook funcs
OTP-12468
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r--lib/common_test/src/ct_framework.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index e8ea7992b4..ec525784ec 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -1268,6 +1268,11 @@ report(What,Data) ->
Data1 = if GrName == undefined -> {Suite,Func,Result};
true -> Data
end,
+ %% Register the group leader for the process calling the report
+ %% function, making it possible for a hook function to print
+ %% in the test case log file
+ ReportingPid = self(),
+ ct_logs:register_groupleader(ReportingPid, group_leader()),
case Result of
{failed, _} ->
ct_hooks:on_tc_fail(What, Data1);
@@ -1282,6 +1287,7 @@ report(What,Data) ->
_Else ->
ok
end,
+ ct_logs:unregister_groupleader(ReportingPid),
case {Func,Result} of
{init_per_suite,_} ->
ok;