diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common_test/test/ct_sequence_1_SUITE.erl | 36 | ||||
-rw-r--r-- | lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl | 15 |
2 files changed, 47 insertions, 4 deletions
diff --git a/lib/common_test/test/ct_sequence_1_SUITE.erl b/lib/common_test/test/ct_sequence_1_SUITE.erl index f7cb984fc6..5583df1121 100644 --- a/lib/common_test/test/ct_sequence_1_SUITE.erl +++ b/lib/common_test/test/ct_sequence_1_SUITE.erl @@ -59,7 +59,9 @@ end_per_testcase(TestCase, Config) -> all(suite) -> [subgroup_return_fail, subgroup_init_fail, - subgroup_after_failed_case]. + subgroup_after_failed_case, + case_after_subgroup_return_fail, + case_after_subgroup_fail_init]. %%-------------------------------------------------------------------- %% TEST CASES @@ -90,6 +92,22 @@ subgroup_after_failed_case(Config) when is_list(Config) -> Config). %%%----------------------------------------------------------------- +%%% + +case_after_subgroup_return_fail(Config) when is_list(Config) -> + execute(case_after_subgroup_return_fail, + "subgroups_1_SUITE", case_after_subgroup_return_fail, + Config). + +%%%----------------------------------------------------------------- +%%% + +case_after_subgroup_fail_init(Config) when is_list(Config) -> + execute(case_after_subgroup_fail_init, + "subgroups_1_SUITE", case_after_subgroup_fail_init, + Config). + +%%%----------------------------------------------------------------- %%% HELP FUNCTIONS %%%----------------------------------------------------------------- @@ -155,4 +173,20 @@ test_events(subgroup_after_failed_case) -> {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]} + ]; + +test_events(case_after_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(case_after_subgroup_fail_init) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} ]. diff --git a/lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl b/lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl index a25dbe772d..b177b5d7d1 100644 --- a/lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl +++ b/lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl @@ -25,7 +25,8 @@ all() -> [{group, subgroup_return_fail}, {group, subgroup_init_fail}, - {group, subgroup_after_failed_case}]. + {group, subgroup_after_failed_case}, + {group, case_after_failed_subgroup}]. groups() -> [{return_fail, [], [failing_tc]}, @@ -36,11 +37,17 @@ groups() -> {subgroup_init_fail, [sequence], [{group, fail_init}, {group, ok_group}]}, - {subgroup_after_failed_case, [sequence], [failing_tc, {group, ok_group}]} + {subgroup_after_failed_case, [sequence], [failing_tc, {group, ok_group}]}, + + {case_after_subgroup_return_fail, [sequence], [{group, return_fail}, ok_tc]}, + + {case_after_subgroup_fail_init, [sequence], [{group, fail_init}, ok_tc]} ]. failed_subgroup(subgroup_return_fail) -> return_fail; failed_subgroup(subgroup_init_fail) -> fail_init; +failed_subgroup(case_after_subgroup_return_fail) -> return_fail; +failed_subgroup(case_after_subgroup_fail_init) -> fail_init; failed_subgroup(_) -> undefined. init_per_suite(Config) -> @@ -64,7 +71,9 @@ end_per_group(subgroup_after_failed_case, Config) -> {return_group_result,failed}; end_per_group(Group, Config) when Group == subgroup_return_fail; - Group == subgroup_init_fail -> + Group == subgroup_init_fail; + Group == case_after_subgroup_return_fail; + Group == case_after_subgroup_fail_init -> ct:comment(Group), Status = ?config(tc_group_result, Config), Failed = proplists:get_value(failed, Status), |