diff options
author | Siri Hansen <[email protected]> | 2019-04-16 14:40:02 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2019-04-16 14:40:02 +0200 |
commit | b1eea95392315e3602766af77e80d27b8e8c3af2 (patch) | |
tree | b06ebf2310b44aa6928bd6da524df80beca8394e /lib/common_test/src/ct_framework.erl | |
parent | 9e03b5fa83ea33209e214a484e985db21bd41b4a (diff) | |
parent | 62ed4780f713d86a9bca332945bf583111570978 (diff) | |
download | otp-b1eea95392315e3602766af77e80d27b8e8c3af2.tar.gz otp-b1eea95392315e3602766af77e80d27b8e8c3af2.tar.bz2 otp-b1eea95392315e3602766af77e80d27b8e8c3af2.zip |
Merge branch 'siri/ct/reset_curr_tc/ERIERL-334/OTP-15717' into maint
* siri/ct/reset_curr_tc/ERIERL-334/OTP-15717:
[ct] Cleanup after timetrap timeout or kill during framework call or hook
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r-- | lib/common_test/src/ct_framework.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 134ae0e1cc..e02bc5edfa 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -696,9 +696,16 @@ end_tc(Mod,IPTC={init_per_testcase,_Func},_TCPid,Result,Args,Return) -> end end; -end_tc(Mod,Func0,TCPid,Result,Args,Return) -> +end_tc(Mod,Func00,TCPid,Result,Args,Return) -> %% in case Mod == ct_framework, lookup the suite name Suite = get_suite_name(Mod, Args), + {OnlyCleanup,Func0} = + case Func00 of + {cleanup,F0} -> + {true,F0}; + _ -> + {false,Func00} + end, {Func,FuncSpec,HookFunc} = case Func0 of {end_per_testcase_not_run,F} -> @@ -742,6 +749,8 @@ end_tc(Mod,Func0,TCPid,Result,Args,Return) -> case HookFunc of undefined -> {ok,Result}; + _ when OnlyCleanup -> + {ok,Result}; _ -> case ct_hooks:end_tc(Suite,HookFunc,Args,Result,Return) of '$ct_no_change' -> @@ -752,6 +761,8 @@ end_tc(Mod,Func0,TCPid,Result,Args,Return) -> end, FinalResult = case get('$test_server_framework_test') of + _ when OnlyCleanup -> + Result1; undefined -> %% send sync notification so that event handlers may print %% in the log file before it gets closed |