From 983b1a407119f427a9203769bb94784b1bf0563b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 1 Nov 2012 12:24:28 +0100 Subject: Handle ct:abort_current_testcase/1 when executing parallel groups ct:abort_current_testcase/1 (which is a wrapper for the function with the same name in test_server_ctrl) would not work as expected when a group with parallel test cases was executing. Essentially, the abort_current_testcase message would be ignored until the group has finished and would then abort the end_per_group testcase for the group. Since there is no unique current testcase when a parallel group is executing, we must handle the abort_current_testcase message and return an error tuple. Also fix the bug that test_server_ctrl:abort_current_testcase/1 would always return 'ok'. --- lib/common_test/src/ct.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/common_test/src/ct.erl') diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl index 90e4e79ccf..6ecd0a022c 100644 --- a/lib/common_test/src/ct.erl +++ b/lib/common_test/src/ct.erl @@ -987,8 +987,9 @@ get_testdata(Key) -> end. %%%----------------------------------------------------------------- -%%% @spec abort_current_testcase(Reason) -> ok | {error,no_testcase_running} +%%% @spec abort_current_testcase(Reason) -> ok | {error,ErrorReason} %%% Reason = term() +%%% ErrorReason = no_testcase_running | parallel_group %%% %%% @doc

When calling this function, the currently executing test case will be aborted. %%% It is the user's responsibility to know for sure which test case is currently -- cgit v1.2.3