From 6b51c530111e478c9605cb88bb90178682ffe669 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Thu, 1 Jul 2010 20:41:33 +0200 Subject: Improve handling of test case group specifications Still a few things missing: * Documentation * More tests * Fix old broken test cases --- lib/common_test/src/ct_testspec.erl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/common_test/src/ct_testspec.erl') diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl index 1ca60dc92c..f5069427a2 100644 --- a/lib/common_test/src/ct_testspec.erl +++ b/lib/common_test/src/ct_testspec.erl @@ -185,13 +185,13 @@ prepare_cases(Node,Dir,Suite,Cases) -> {[{{Node,Dir},{Suite,all}}],SkipAll}; Skipped -> %% note: this adds a test even if only skip is specified - PrepC = lists:foldr(fun({{G,_}=Group,{skip,_Cmt}}, Acc) when + PrepC = lists:foldr(fun({{G,Cs},{skip,_Cmt}}, Acc) when is_atom(G) -> case lists:keymember(G, 1, Cases) of true -> Acc; false -> - [Group|Acc] + [{skipped,G,Cs}|Acc] end; ({C,{skip,_Cmt}},Acc) -> case lists:member(C,Cases) of @@ -917,7 +917,8 @@ skip_groups(Node,Dir,Suite,Group,all,Cmt,Tests) when is_atom(Group) -> skip_groups(Node,Dir,Suite,[Group],all,Cmt,Tests); skip_groups(Node,Dir,Suite,Group,Cases,Cmt,Tests) when is_atom(Group) -> skip_groups(Node,Dir,Suite,[Group],Cases,Cmt,Tests); -skip_groups(Node,Dir,Suite,Groups,Case,Cmt,Tests) when is_atom(Case) -> +skip_groups(Node,Dir,Suite,Groups,Case,Cmt,Tests) when is_atom(Case), + Case =/= all -> skip_groups(Node,Dir,Suite,Groups,[Case],Cmt,Tests); skip_groups(Node,Dir,Suite,Groups,Cases,Cmt,Tests) when ((Cases == all) or is_list(Cases)) and is_list(Groups) -> -- cgit v1.2.3