aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test/ct_sequence_1_SUITE.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2010-08-06 00:00:49 +0200
committerPeter Andersson <[email protected]>2010-09-02 14:44:54 +0200
commit8012586a816ad0509d137c4443bee97e6ff84146 (patch)
tree3a50babb8fad1e6addf1f78ec48f81fb2db4dccd /lib/common_test/test/ct_sequence_1_SUITE.erl
parenta05e853496d0d0fa5330c65ab6b1755cd6ecca3f (diff)
downloadotp-8012586a816ad0509d137c4443bee97e6ff84146.tar.gz
otp-8012586a816ad0509d137c4443bee97e6ff84146.tar.bz2
otp-8012586a816ad0509d137c4443bee97e6ff84146.zip
Fix error with group term in ct:run_test/1
Also some new test cases on sequence groups have been added.
Diffstat (limited to 'lib/common_test/test/ct_sequence_1_SUITE.erl')
-rw-r--r--lib/common_test/test/ct_sequence_1_SUITE.erl64
1 files changed, 51 insertions, 13 deletions
diff --git a/lib/common_test/test/ct_sequence_1_SUITE.erl b/lib/common_test/test/ct_sequence_1_SUITE.erl
index 55aca764fb..f7cb984fc6 100644
--- a/lib/common_test/test/ct_sequence_1_SUITE.erl
+++ b/lib/common_test/test/ct_sequence_1_SUITE.erl
@@ -57,7 +57,9 @@ end_per_testcase(TestCase, Config) ->
ct_test_support:end_per_testcase(TestCase, Config).
all(suite) ->
- [subgroup].
+ [subgroup_return_fail,
+ subgroup_init_fail,
+ subgroup_after_failed_case].
%%--------------------------------------------------------------------
%% TEST CASES
@@ -66,31 +68,51 @@ all(suite) ->
%%%-----------------------------------------------------------------
%%%
-subgroup(Config) when is_list(Config) ->
- DataDir = ?config(data_dir, Config),
+subgroup_return_fail(Config) when is_list(Config) ->
+ execute(subgroup_return_fail,
+ "subgroups_1_SUITE", subgroup_return_fail,
+ Config).
+
+%%%-----------------------------------------------------------------
+%%%
+
+subgroup_init_fail(Config) when is_list(Config) ->
+ execute(subgroup_init_fail,
+ "subgroups_1_SUITE", subgroup_init_fail,
+ Config).
+
+%%%-----------------------------------------------------------------
+%%%
- Suite = filename:join(DataDir, "subgroups_1_SUITE"),
+subgroup_after_failed_case(Config) when is_list(Config) ->
+ execute(subgroup_after_failed_case,
+ "subgroups_1_SUITE", subgroup_after_failed_case,
+ Config).
- {Opts,ERPid} = setup({suite,Suite}, Config),
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+execute(TestCase, SuiteName, Group, Config) ->
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, SuiteName),
+
+ {Opts,ERPid} = setup([{suite,Suite},{group,Group},{label,TestCase}], Config),
ok = ct_test_support:run(Opts, Config),
Events = ct_test_support:get_events(ERPid, Config),
- ct_test_support:log_events(subgroup,
+ ct_test_support:log_events(TestCase,
reformat(Events, ?eh),
?config(priv_dir, Config)),
- TestEvents = events_to_check(subgroup),
+ TestEvents = events_to_check(TestCase),
ok = ct_test_support:verify_events(TestEvents, Events, Config).
-%%%-----------------------------------------------------------------
-%%% HELP FUNCTIONS
-%%%-----------------------------------------------------------------
-
setup(Test, Config) ->
Opts0 = ct_test_support:get_opts(Config),
Level = ?config(trace_level, Config),
EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
- Opts = Opts0 ++ [Test,{event_handler,{?eh,EvHArgs}}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}} | Test],
ERPid = ct_test_support:start_event_receiver(Config),
{Opts,ERPid}.
@@ -111,7 +133,23 @@ events_to_check(_, 0) ->
events_to_check(Test, N) ->
test_events(Test) ++ events_to_check(Test, N-1).
-test_events(subgroup) ->
+test_events(subgroup_return_fail) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(subgroup_init_fail) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(subgroup_after_failed_case) ->
[
{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},