diff options
author | Peter Andersson <[email protected]> | 2012-03-13 17:05:08 +0100 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2012-03-13 17:05:08 +0100 |
commit | ccdee0c96757252c63f4e4d2f3d21c628e0c4025 (patch) | |
tree | 9708d5bdb8bd9110d8c16082aa9370d497752c29 /lib/common_test/test | |
parent | 83b3156388ee6773fddd82e5395bdfe2c8eedc19 (diff) | |
download | otp-ccdee0c96757252c63f4e4d2f3d21c628e0c4025.tar.gz otp-ccdee0c96757252c63f4e4d2f3d21c628e0c4025.tar.bz2 otp-ccdee0c96757252c63f4e4d2f3d21c628e0c4025.zip |
Change the option name 'unique_priv_dir' to 'create_priv_dir'
The new values for create_priv_dir are:
auto_per_run, auto_per_tc, manual_per_tc
Diffstat (limited to 'lib/common_test/test')
7 files changed, 76 insertions, 49 deletions
diff --git a/lib/common_test/test/ct_priv_dir_SUITE.erl b/lib/common_test/test/ct_priv_dir_SUITE.erl index bfc579d7f1..f6942d59bf 100644 --- a/lib/common_test/test/ct_priv_dir_SUITE.erl +++ b/lib/common_test/test/ct_priv_dir_SUITE.erl @@ -21,7 +21,7 @@ %%% File: ct_priv_dir_SUITE %%% %%% Description: -%%% Test that it works to use the unique_priv_dir option. +%%% Test that it works to use the create_priv_dir option. %%% %%%------------------------------------------------------------------- -module(ct_priv_dir_SUITE). @@ -60,11 +60,13 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ default, - unique_auto, - unique_manual, + auto_per_run, + auto_per_tc, + manual_per_tc, spec_default, - spec_unique_auto, - spec_unique_manual + spec_auto_per_run, + spec_auto_per_run, + spec_manual_per_tc ]. %%-------------------------------------------------------------------- @@ -82,23 +84,33 @@ default(Config) when is_list(Config) -> %%%----------------------------------------------------------------- %%% -unique_auto(Config) when is_list(Config) -> +auto_per_run(Config) when is_list(Config) -> DataDir = ?config(data_dir, Config), Suite = filename:join(DataDir, "priv_dir_SUITE"), - {Opts,ERPid} = setup([{suite,Suite},{testcase,unique_auto}, - {label,unique_auto}, - {unique_priv_dir,auto}], Config), - ok = execute(unique_auto, Opts, ERPid, Config). + {Opts,ERPid} = setup([{suite,Suite},{testcase,default}, + {label,auto_per_run}, + {create_priv_dir,auto_per_run}], Config), + ok = execute(auto_per_run, Opts, ERPid, Config). + +%%%----------------------------------------------------------------- +%%% +auto_per_tc(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + Suite = filename:join(DataDir, "priv_dir_SUITE"), + {Opts,ERPid} = setup([{suite,Suite},{testcase,auto_per_tc}, + {label,auto_per_tc}, + {create_priv_dir,auto_per_tc}], Config), + ok = execute(auto_per_tc, Opts, ERPid, Config). %%%----------------------------------------------------------------- %%% -unique_manual(Config) when is_list(Config) -> +manual_per_tc(Config) when is_list(Config) -> DataDir = ?config(data_dir, Config), Suite = filename:join(DataDir, "priv_dir_SUITE"), - {Opts,ERPid} = setup([{suite,Suite},{testcase,unique_manual}, - {label,unique_manual}, - {unique_priv_dir,manual}], Config), - ok = execute(unique_manual, Opts, ERPid, Config). + {Opts,ERPid} = setup([{suite,Suite},{testcase,manual_per_tc}, + {label,manual_per_tc}, + {create_priv_dir,manual_per_tc}], Config), + ok = execute(manual_per_tc, Opts, ERPid, Config). %%%----------------------------------------------------------------- %%% @@ -111,21 +123,30 @@ spec_default(Config) when is_list(Config) -> %%%----------------------------------------------------------------- %%% -spec_unique_auto(Config) when is_list(Config) -> +spec_auto_per_run(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + Spec = filename:join(DataDir, "auto_per_run.spec"), + {Opts,ERPid} = setup([{spec,Spec}, + {label,spec_auto_per_run}], Config), + ok = execute(spec_auto_per_run, Opts, ERPid, Config). + +%%%----------------------------------------------------------------- +%%% +spec_auto_per_tc(Config) when is_list(Config) -> DataDir = ?config(data_dir, Config), - Spec = filename:join(DataDir, "unique_auto.spec"), + Spec = filename:join(DataDir, "auto_per_tc.spec"), {Opts,ERPid} = setup([{spec,Spec}, - {label,spec_unique_auto}], Config), - ok = execute(spec_unique_auto, Opts, ERPid, Config). + {label,spec_auto_per_tc}], Config), + ok = execute(spec_auto_per_tc, Opts, ERPid, Config). %%%----------------------------------------------------------------- %%% -spec_unique_manual(Config) when is_list(Config) -> +spec_manual_per_tc(Config) when is_list(Config) -> DataDir = ?config(data_dir, Config), - Spec = filename:join(DataDir, "unique_manual.spec"), + Spec = filename:join(DataDir, "manual_per_tc.spec"), {Opts,ERPid} = setup([{spec,Spec}, - {label,spec_unique_manual}], Config), - ok = execute(spec_unique_manual, Opts, ERPid, Config). + {label,spec_manual_per_tc}], Config), + ok = execute(spec_manual_per_tc, Opts, ERPid, Config). %%%----------------------------------------------------------------- @@ -168,7 +189,7 @@ events_to_check(Test, N) -> test_events(Test) ++ events_to_check(Test, N-1). -test_events(default) -> +test_events(DEF) when DEF == default ; DEF == auto_per_run -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, @@ -183,35 +204,36 @@ test_events(default) -> {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]}]; -test_events(unique_auto) -> +test_events(auto_per_tc) -> [{?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,start_info,{1,1,1}}, {?eh,tc_start,{priv_dir_SUITE,init_per_suite}}, {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}}, - {?eh,tc_start,{priv_dir_SUITE,unique_auto}}, - {?eh,tc_done,{priv_dir_SUITE,unique_auto,ok}}, + {?eh,tc_start,{priv_dir_SUITE,auto_per_tc}}, + {?eh,tc_done,{priv_dir_SUITE,auto_per_tc,ok}}, {?eh,test_stats,{1,0,{0,0}}}, {?eh,tc_start,{priv_dir_SUITE,end_per_suite}}, {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]}]; -test_events(unique_manual) -> +test_events(manual_per_tc) -> [{?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,start_info,{1,1,1}}, {?eh,tc_start,{priv_dir_SUITE,init_per_suite}}, {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}}, - {?eh,tc_start,{priv_dir_SUITE,unique_manual}}, - {?eh,tc_done,{priv_dir_SUITE,unique_manual,ok}}, + {?eh,tc_start,{priv_dir_SUITE,manual_per_tc}}, + {?eh,tc_done,{priv_dir_SUITE,manual_per_tc,ok}}, {?eh,test_stats,{1,0,{0,0}}}, {?eh,tc_start,{priv_dir_SUITE,end_per_suite}}, {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]}]; -test_events(spec_default) -> +test_events(SPECDEF) when SPECDEF == spec_default ; + SPECDEF == spec_auto_per_run -> [{?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,start_info,{1,1,1}}, @@ -225,28 +247,28 @@ test_events(spec_default) -> {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]}]; -test_events(spec_unique_auto) -> +test_events(spec_auto_per_tc) -> [{?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,start_info,{1,1,1}}, {?eh,tc_start,{priv_dir_SUITE,init_per_suite}}, {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}}, - {?eh,tc_start,{priv_dir_SUITE,unique_auto}}, - {?eh,tc_done,{priv_dir_SUITE,unique_auto,ok}}, + {?eh,tc_start,{priv_dir_SUITE,auto_per_tc}}, + {?eh,tc_done,{priv_dir_SUITE,auto_per_tc,ok}}, {?eh,test_stats,{1,0,{0,0}}}, {?eh,tc_start,{priv_dir_SUITE,end_per_suite}}, {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]}]; -test_events(spec_unique_manual) -> +test_events(spec_manual_per_tc) -> [{?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,start_info,{1,1,1}}, {?eh,tc_start,{priv_dir_SUITE,init_per_suite}}, {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}}, - {?eh,tc_start,{priv_dir_SUITE,unique_manual}}, - {?eh,tc_done,{priv_dir_SUITE,unique_manual,ok}}, + {?eh,tc_start,{priv_dir_SUITE,manual_per_tc}}, + {?eh,tc_done,{priv_dir_SUITE,manual_per_tc,ok}}, {?eh,test_stats,{1,0,{0,0}}}, {?eh,tc_start,{priv_dir_SUITE,end_per_suite}}, {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}}, diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_run.spec b/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_run.spec new file mode 100644 index 0000000000..4dde0ed1f4 --- /dev/null +++ b/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_run.spec @@ -0,0 +1,5 @@ +{create_priv_dir, auto_per_run}. + +{alias, curr, "./"}. + +{cases, curr, priv_dir_SUITE, default}.
\ No newline at end of file diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_tc.spec b/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_tc.spec new file mode 100644 index 0000000000..c265500865 --- /dev/null +++ b/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_tc.spec @@ -0,0 +1,5 @@ +{create_priv_dir, auto_per_tc}. + +{alias, curr, "./"}. + +{cases, curr, priv_dir_SUITE, auto_per_tc}.
\ No newline at end of file diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/manual_per_tc.spec b/lib/common_test/test/ct_priv_dir_SUITE_data/manual_per_tc.spec new file mode 100644 index 0000000000..4f98734d5f --- /dev/null +++ b/lib/common_test/test/ct_priv_dir_SUITE_data/manual_per_tc.spec @@ -0,0 +1,5 @@ +{create_priv_dir, manual_per_tc}. + +{alias, curr, "./"}. + +{cases, curr, priv_dir_SUITE, manual_per_tc}.
\ No newline at end of file diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl b/lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl index 0fe337135b..423cb2999b 100644 --- a/lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl +++ b/lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl @@ -113,12 +113,12 @@ default(Config) -> "log_private" = filename:basename(PrivDir), {ok,_} = file:list_dir(PrivDir). -unique_auto(Config) -> +auto_per_tc(Config) -> PrivDir = proplists:get_value(priv_dir, Config), ["log_private",_] = string:tokens(filename:basename(PrivDir), "."), {ok,_} = file:list_dir(PrivDir). -unique_manual(Config) -> +manual_per_tc(Config) -> PrivDir = proplists:get_value(priv_dir, Config), ["log_private",_] = string:tokens(filename:basename(PrivDir), "."), {error,_} = file:list_dir(PrivDir), diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/unique_auto.spec b/lib/common_test/test/ct_priv_dir_SUITE_data/unique_auto.spec deleted file mode 100644 index a64a09ecf0..0000000000 --- a/lib/common_test/test/ct_priv_dir_SUITE_data/unique_auto.spec +++ /dev/null @@ -1,5 +0,0 @@ -{unique_priv_dir, auto}. - -{alias, curr, "./"}. - -{cases, curr, priv_dir_SUITE, unique_auto}.
\ No newline at end of file diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/unique_manual.spec b/lib/common_test/test/ct_priv_dir_SUITE_data/unique_manual.spec deleted file mode 100644 index 9af9197c18..0000000000 --- a/lib/common_test/test/ct_priv_dir_SUITE_data/unique_manual.spec +++ /dev/null @@ -1,5 +0,0 @@ -{unique_priv_dir, manual}. - -{alias, curr, "./"}. - -{cases, curr, priv_dir_SUITE, unique_manual}.
\ No newline at end of file |