diff options
author | Erlang/OTP <[email protected]> | 2019-06-17 16:50:20 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2019-06-17 16:50:20 +0200 |
commit | af5759cecc1982a5835dd85d4dbaf3d91f8a7e6e (patch) | |
tree | 74496f05d9065b985594aad052d3aaca0a64ff92 /lib/common_test/src/test_server.erl | |
parent | 8ba6427bba42152a81f5bbb5a66dd3478db75f08 (diff) | |
parent | f2fa395a6e83d5a5271a296886467e8fef2e0cff (diff) | |
download | otp-af5759cecc1982a5835dd85d4dbaf3d91f8a7e6e.tar.gz otp-af5759cecc1982a5835dd85d4dbaf3d91f8a7e6e.tar.bz2 otp-af5759cecc1982a5835dd85d4dbaf3d91f8a7e6e.zip |
Merge branch 'siri/ct/fail-after-failed-init_per_testcase/maint-21/ERIERL-350/OTP-15869' into maint-21
* siri/ct/fail-after-failed-init_per_testcase/maint-21/ERIERL-350/OTP-15869:
[ct] Allow post_init_per_testcase to change skip to fail
Diffstat (limited to 'lib/common_test/src/test_server.erl')
-rw-r--r-- | lib/common_test/src/test_server.erl | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/common_test/src/test_server.erl b/lib/common_test/src/test_server.erl index 756cd4d692..588396f101 100644 --- a/lib/common_test/src/test_server.erl +++ b/lib/common_test/src/test_server.erl @@ -1364,23 +1364,29 @@ do_end_tc_call(Mod, IPTC={init_per_testcase,Func}, Res, Return) -> {NOk,_} when NOk == auto_skip; NOk == fail; NOk == skip ; NOk == skipped -> {_,Args} = Res, - IPTCEndRes = + {NewConfig,IPTCEndRes} = case do_end_tc_call1(Mod, IPTC, Res, Return) of IPTCEndConfig when is_list(IPTCEndConfig) -> - IPTCEndConfig; + {IPTCEndConfig,IPTCEndConfig}; + {failed,RetReason} when Return=:={fail,RetReason} -> + %% Fail reason not changed by framework or hook + {Args,Return}; + {SF,_} = IPTCEndResult when SF=:=skip; SF=:=skipped; + SF=:=fail; SF=:=failed -> + {Args,IPTCEndResult}; _ -> - Args + {Args,Return} end, EPTCInitRes = case do_init_tc_call(Mod,{end_per_testcase_not_run,Func}, - IPTCEndRes,Return) of + NewConfig,IPTCEndRes) of {ok,EPTCInitConfig} when is_list(EPTCInitConfig) -> - {Return,EPTCInitConfig}; + {IPTCEndRes,EPTCInitConfig}; _ -> - {Return,IPTCEndRes} + {IPTCEndRes,NewConfig} end, do_end_tc_call1(Mod, {end_per_testcase_not_run,Func}, - EPTCInitRes, Return); + EPTCInitRes, IPTCEndRes); _Ok -> do_end_tc_call1(Mod, IPTC, Res, Return) end; |