diff options
author | Peter Andersson <[email protected]> | 2012-08-23 18:29:45 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2012-08-23 18:29:45 +0200 |
commit | a94308cb1e1aa727a126e99b5a8714490dd3de16 (patch) | |
tree | 2452c3b837c23ab62cb16e363d56cfa095005a7e /lib/common_test/src | |
parent | 38456cd45c8677a567e32722dee0d9602a306037 (diff) | |
parent | e2d5adbd9167ec51edaece5bf672c76e4898ca05 (diff) | |
download | otp-a94308cb1e1aa727a126e99b5a8714490dd3de16.tar.gz otp-a94308cb1e1aa727a126e99b5a8714490dd3de16.tar.bz2 otp-a94308cb1e1aa727a126e99b5a8714490dd3de16.zip |
Merge remote branch 'origin/peppe/common_test/parallel_testcases_error' into maint
* origin/peppe/common_test/parallel_testcases_error:
Solve problems with verbosity levels and parallel test cases
Diffstat (limited to 'lib/common_test/src')
-rw-r--r-- | lib/common_test/src/ct_framework.erl | 31 | ||||
-rw-r--r-- | lib/common_test/src/ct_testspec.erl | 9 |
2 files changed, 28 insertions, 12 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index d698ebb5dc..e8d5d4708b 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -75,8 +75,11 @@ init_tc(Mod,Func,Config) -> case CurrTC of undefined -> ct_util:set_testdata({curr_tc,[{Suite,Func}]}); - Running when is_list(Running) -> - ct_util:set_testdata({curr_tc,[{Suite,Func}|Running]}) + _ when is_list(CurrTC) -> + ct_util:update_testdata(curr_tc, + fun(Running) -> + [{Suite,Func}|Running] + end) end, case ct_util:read_suite_data({seq,Suite,Func}) of undefined -> @@ -84,11 +87,13 @@ init_tc(Mod,Func,Config) -> Seq when is_atom(Seq) -> case ct_util:read_suite_data({seq,Suite,Seq}) of [Func|TCs] -> % this is the 1st case in Seq - %% make sure no cases in this seq are marked as failed - %% from an earlier execution in the same suite + %% make sure no cases in this seq are + %% marked as failed from an earlier execution + %% in the same suite lists:foreach( fun(TC) -> - ct_util:save_suite_data({seq,Suite,TC},Seq) + ct_util:save_suite_data({seq,Suite,TC}, + Seq) end, TCs); _ -> ok @@ -665,12 +670,16 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> %% reset the curr_tc state, or delete this TC from the list of %% executing cases (if in a parallel group) - case ct_util:get_testdata(curr_tc) of - Running = [_,_|_] -> - ct_util:set_testdata({curr_tc,lists:delete({Mod,Func}, Running)}); - [_] -> - ct_util:set_testdata({curr_tc,undefined}) - end, + ClearCurrTC = fun(Running = [_,_|_]) -> + lists:delete({Mod,Func},Running); + ({_,{suite0_failed,_}}) -> + undefined; + ([{_,CurrTC}]) when CurrTC == Func -> + undefined; + (undefined) -> + undefined + end, + ct_util:update_testdata(curr_tc,ClearCurrTC), case FinalResult of {skip,{sequence_failed,_,_}} -> diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl index d66caef100..7759aca16b 100644 --- a/lib/common_test/src/ct_testspec.erl +++ b/lib/common_test/src/ct_testspec.erl @@ -934,6 +934,12 @@ handle_data(ct_hooks,Node,Hook,_Spec) -> [{Node,Hook}]; handle_data(stylesheet,Node,CSSFile,Spec) -> [{Node,get_absfile(CSSFile,Spec)}]; +handle_data(verbosity,Node,VLvls,_Spec) when is_integer(VLvls) -> + [{Node,[{'$unspecified',VLvls}]}]; +handle_data(verbosity,Node,VLvls,_Spec) when is_list(VLvls) -> + VLvls1 = lists:map(fun(VLvl = {_Cat,_Lvl}) -> VLvl; + (Lvl) -> {'$unspecified',Lvl} end, VLvls), + [{Node,VLvls1}]; handle_data(_Tag,Node,Data,_Spec) -> [{Node,Data}]. @@ -943,7 +949,8 @@ should_be_added(Tag,Node,_Data,Spec) -> %% list terms *without* possible duplicates here Tag == logdir; Tag == logopts; Tag == basic_html; Tag == label; - Tag == auto_compile; Tag == stylesheet -> + Tag == auto_compile; Tag == stylesheet; + Tag == verbosity -> lists:keymember(ref2node(Node,Spec#testspec.nodes),1, read_field(Spec,Tag)) == false; %% for terms *with* possible duplicates |