diff options
author | Lukas Larsson <[email protected]> | 2011-02-09 14:01:39 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-02-17 16:59:39 +0100 |
commit | ff8d3f0f39b0d1347cd94e1d0d3ab422ad7b06d7 (patch) | |
tree | 026e7d50511f663cbfa301b746e80672d51d715e /lib/common_test/test | |
parent | e34cd721545915266a00b1ec55a9a5867c8459a4 (diff) | |
download | otp-ff8d3f0f39b0d1347cd94e1d0d3ab422ad7b06d7.tar.gz otp-ff8d3f0f39b0d1347cd94e1d0d3ab422ad7b06d7.tar.bz2 otp-ff8d3f0f39b0d1347cd94e1d0d3ab422ad7b06d7.zip |
Fix bug where the state of an SCB was altered when no on_tc_* existed
Diffstat (limited to 'lib/common_test/test')
-rw-r--r-- | lib/common_test/test/ct_suite_callback_SUITE.erl | 21 | ||||
-rw-r--r-- | lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl | 38 |
2 files changed, 56 insertions, 3 deletions
diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index 19feacad1d..67f3cf430a 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -81,7 +81,8 @@ all(suite) -> scope_suite_state_scb, fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, skip_post_suite_scb, recover_post_suite_scb, update_config_scb, - state_update_scb, options_scb, same_id_scb + state_update_scb, options_scb, same_id_scb, + fail_n_skip_with_minimal_scb ] ) . @@ -197,7 +198,10 @@ options_scb(Config) when is_list(Config) -> same_id_scb(Config) when is_list(Config) -> do_test(same_id_scb, "ct_scb_empty_SUITE.erl", [same_id_scb,same_id_scb],Config). - + +fail_n_skip_with_minimal_scb(Config) when is_list(Config) -> + do_test(fail_n_skip_with_minimal_scb, "ct_scb_fail_one_skip_one_SUITE.erl", + [minimal_terminate_scb],Config). %%%----------------------------------------------------------------- %%% HELP FUNCTIONS @@ -963,6 +967,17 @@ test_events(same_id_scb) -> {?eh,stop_logging,[]} ]; +test_events(fail_n_skip_with_minimal_scb) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{'_',init_per_suite}}, + + {?eh,tc_done,{'_',end_per_suite,ok}}, + {?eh,scb,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + test_events(ok) -> ok. @@ -995,7 +1010,7 @@ contains([],_) -> contains_parallel([Key | T], Elems) -> contains([Key],Elems), contains_parallel(T,Elems); -contains_parallel([],Elems) -> +contains_parallel([],_Elems) -> match. not_contains(List) -> diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl new file mode 100644 index 0000000000..3f76d2f47d --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl @@ -0,0 +1,38 @@ +%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(minimal_terminate_scb).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% Suite Callbacks
+-export([init/2]).
+-export([terminate/1]).
+
+init(Id, Opts) ->
+ empty_scb:init(Id, Opts).
+
+terminate(State) ->
+ empty_scb:terminate(State).
+
+
|