aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-10-16 16:26:32 +0200
committerFredrik Gustafsson <[email protected]>2013-10-16 16:26:32 +0200
commit73d1b4a1cc5ef1898b650fc74063ab28bc85bcbf (patch)
treeafca567484079b2dcb10fda0c40a67633a577b19 /lib/common_test/src
parent4d4a2170a02b5550df4ba3a7c04a755523b81cb4 (diff)
parent8dfd57ab8581813bee1404e5fe2d74081d9c1c0a (diff)
downloadotp-73d1b4a1cc5ef1898b650fc74063ab28bc85bcbf.tar.gz
otp-73d1b4a1cc5ef1898b650fc74063ab28bc85bcbf.tar.bz2
otp-73d1b4a1cc5ef1898b650fc74063ab28bc85bcbf.zip
Merge branch 'robertoaloi/cth_fix_terminate/OTP-11401' into maint
* robertoaloi/cth_fix_terminate/OTP-11401: common_test: added code_change/3 for gen_event behaviour The gen_event callback module expects terminate/2, not terminate/1
Diffstat (limited to 'lib/common_test/src')
-rw-r--r--lib/common_test/src/cth_log_redirect.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/common_test/src/cth_log_redirect.erl b/lib/common_test/src/cth_log_redirect.erl
index 4ee7e48a67..f5e769e1ba 100644
--- a/lib/common_test/src/cth_log_redirect.erl
+++ b/lib/common_test/src/cth_log_redirect.erl
@@ -34,13 +34,15 @@
%% Event handler Callbacks
-export([init/1,
handle_event/2, handle_call/2, handle_info/2,
- terminate/1]).
+ terminate/2, code_change/3]).
%% Other
-export([handle_remote_events/1]).
-include("ct.hrl").
+-behaviour(gen_event).
+
-record(eh_state, {log_func,
curr_suite,
curr_group,
@@ -184,7 +186,7 @@ handle_call({handle_remote_events,Bool}, State) ->
handle_call(_Query, _State) ->
{error, bad_query}.
-terminate(_State) ->
+terminate(_Arg, _State) ->
error_logger:delete_report_handler(?MODULE),
[].
@@ -236,3 +238,6 @@ format_header(#eh_state{curr_suite = Suite,
curr_func = TC}) ->
io_lib:format("System report during ~w:~w/1 in ~w",
[Suite,TC,Group]).
+
+code_change(_OldVsn, State, _Extra) ->
+ {ok, State}.