diff options
author | Lukas Larsson <[email protected]> | 2010-12-14 10:28:27 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-01-24 10:45:14 +0100 |
commit | ab085b4bbdefd42b456f03dee47f6c51059a8192 (patch) | |
tree | d08e4d21e380006b0dc70491051a93580223cf28 /lib/common_test | |
parent | 96a540b6b219290a8248ef25ec23c1d331f8e953 (diff) | |
download | otp-ab085b4bbdefd42b456f03dee47f6c51059a8192.tar.gz otp-ab085b4bbdefd42b456f03dee47f6c51059a8192.tar.bz2 otp-ab085b4bbdefd42b456f03dee47f6c51059a8192.zip |
Change format of remote groups to {group, Module, GroupName}, note that this is an unsupported feature
Diffstat (limited to 'lib/common_test')
-rw-r--r-- | lib/common_test/src/ct_framework.erl | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index b554749f7a..3050aec0c5 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -733,7 +733,8 @@ find_groups(Mod, Name, TCs, GroupDefs) -> delete_subs(Trimmed, Trimmed), Trimmed. -find(Mod, all, _TCs, [{Name,Props,Tests} | Gs], Known, Defs, _) -> +find(Mod, all, _TCs, [{Name,Props,Tests} | Gs], Known, Defs, _) + when is_atom(Name), is_list(Props), is_list(Tests) -> cyclic_test(Mod, Name, Known), [make_conf(Mod, Name, Props, find(Mod, all, all, Tests, [Name | Known], Defs, true)) | @@ -755,9 +756,8 @@ find(Mod, Name, TCs, [{Name,Props,Tests} | _Gs], Known, Defs, false) find(Mod, Name, TCs, [{Name1,Props,Tests} | Gs], Known, Defs, false) when is_atom(Name1), is_list(Props), is_list(Tests) -> cyclic_test(Mod, Name1, Known), - [make_conf(Mod, Name1, Props, - find(Mod, Name, TCs, Tests, [Name1 | Known], Defs, false)) | - find(Mod, Name, TCs, Gs, [], Defs, false)]; + find(Mod, Name, TCs, Tests, [Name1 | Known], Defs, false) ++ + find(Mod, Name, TCs, Gs, [], Defs, false); find(Mod, Name, _TCs, [{Name,_Props,_Tests} | _Gs], _Known, _Defs, true) when is_atom(Name) -> @@ -772,31 +772,32 @@ find(Mod, Name, all, [{Name1,Props,Tests} | Gs], Known, Defs, true) find(Mod, Name, all, Tests, [Name1 | Known], Defs, true)) | find(Mod, Name, all, Gs, [], Defs, true)]; -find(Mod, Name, TCs, [{group,Name1} | Gs], Known, Defs, Found) when is_atom(Name1) -> +find(Mod, Name, TCs, [{group,Name1} | Gs], Known, Defs, Found) + when is_atom(Name1) -> find(Mod, Name, TCs, [expand(Mod, Name1, Defs) | Gs], Known, Defs, Found); -find(Mod, Name, TCs, [{Name1,Tests} | Gs], Known, Defs, false) - when is_atom(Name1), is_list(Tests) -> - find(Mod, Name, TCs, [{Name1,[],Tests} | Gs], Known, Defs, false); +%% Undocumented remote group feature, use with caution +find(Mod, Name, TCs, [{group, ExtMod, ExtGrp} | Gs], Known, Defs, true) + when is_atom(ExtMod), is_atom(ExtGrp) -> + ExternalDefs = ExtMod:groups(), + ExternalTCs = find(ExtMod, ExtGrp, TCs, [{group, ExtGrp}], + [], ExternalDefs, false), + ExternalTCs ++ find(Mod, Name, TCs, Gs, Known, Defs, true); -find(Mod, Name, TCs, [{Name1,Groups} | Gs], Known, Defs, true) - when is_atom(Name1), is_list(Groups) -> - ExternalDefs = Name1:groups(), - ExternalGroup = proplists:get_value(group, Groups), - ExternalTCs = find(Name1, ExternalGroup, TCs, Groups, - [], ExternalDefs, false), - ExternalTCs ++ find(Mod, Name, TCs, Gs, Known, Defs, true); +find(Mod, Name, TCs, [{Name1,Tests} | Gs], Known, Defs, Found) + when is_atom(Name1), is_list(Tests) -> + find(Mod, Name, TCs, [{Name1,[],Tests} | Gs], Known, Defs, Found); -find(Mod, Name, TCs, [TC | Gs], Known, Defs, false) when is_atom(TC) -> +find(Mod, Name, TCs, [_TC | Gs], Known, Defs, false) -> find(Mod, Name, TCs, Gs, Known, Defs, false); find(Mod, Name, TCs, [TC | Gs], Known, Defs, true) when is_atom(TC) -> [{Mod, TC} | find(Mod, Name, TCs, Gs, Known, Defs, true)]; -find(Mod, Name, TCs, [{ExternalTC, Case} = TC | Gs], Known, Defs, Found) +find(Mod, Name, TCs, [{ExternalTC, Case} = TC | Gs], Known, Defs, true) when is_atom(ExternalTC), is_atom(Case) -> - [TC | find(Mod, Name, TCs, Gs, Known, Defs, Found)]; + [TC | find(Mod, Name, TCs, Gs, Known, Defs, true)]; find(Mod, _Name, _TCs, [BadTerm | _Gs], Known, _Defs, _Found) -> Where = if length(Known) == 0 -> |