aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2010-11-22 15:29:09 +0100
committerLukas Larsson <[email protected]>2010-12-08 18:07:51 +0100
commit0655bd3132d42457be62f1f22ba36e9267555047 (patch)
tree641c5acb27c923b2459307ef684c536381171509 /lib
parent65ed50867590df76521b1032b91e35fdbd56f3f5 (diff)
downloadotp-0655bd3132d42457be62f1f22ba36e9267555047.tar.gz
otp-0655bd3132d42457be62f1f22ba36e9267555047.tar.bz2
otp-0655bd3132d42457be62f1f22ba36e9267555047.zip
Add on_tc_skip function
Diffstat (limited to 'lib')
-rw-r--r--lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl
index 1b8979ee4b..0d98a8c55a 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl
@@ -51,6 +51,7 @@
-export([post_end_per_testcase/3]).
-export([on_tc_fail/3]).
+-export([on_tc_skip/3]).
-export([terminate/1]).
@@ -216,15 +217,31 @@ post_end_per_testcase(TC,Config,State) ->
%% It is not possible to modify the config or the status of the test run.
-spec on_tc_fail(TC :: init_per_suite | end_per_suite |
init_per_group | end_per_group | atom(),
- Config :: config(), State :: #state{}) ->
+ Reason :: term(), State :: #state{}) ->
ok.
-on_tc_fail(TC, Config, State) ->
+on_tc_fail(TC, Reason, State) ->
gen_event:notify(
?CT_EVMGR_REF, #event{ name = scb, node = node(),
data = {?MODULE, on_tc_fail,
[TC,State]}}),
ok.
+%% @doc Called when a test case is skipped by either user action
+%% or due to an init function failing. Test case can be
+%% end_per_suite, init_per_group, end_per_group and the actual test cases.
+-spec on_tc_skip(TC :: end_per_suite |
+ init_per_group | end_per_group | atom(),
+ {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), Reason :: term()}}} |
+ {tc_user_skip, {skipped, Reason :: term()}},
+ State :: #state{}) ->
+ ok.
+on_tc_skip(TC, Reason, State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = scb, node = node(),
+ data = {?MODULE, on_tc_skip,
+ [TC,State]}}),
+ ok.
+
%% @doc Called when the scope of the SCB is done, this depends on
%% when the SCB was specified. This translation table describes when this
%% function is called.