diff options
author | Lukas Larsson <[email protected]> | 2010-10-01 17:31:02 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-01-24 10:45:13 +0100 |
commit | 7629d083e321a964d3f1cd05b5af746d62dfb5fb (patch) | |
tree | 225530e7a17de759eb9c13e3d8a0d8c4be9f7d32 /lib/common_test | |
parent | 418f30e5c2f64802075c1bc3188935aa91cd8d4e (diff) | |
download | otp-7629d083e321a964d3f1cd05b5af746d62dfb5fb.tar.gz otp-7629d083e321a964d3f1cd05b5af746d62dfb5fb.tar.bz2 otp-7629d083e321a964d3f1cd05b5af746d62dfb5fb.zip |
Add support for external groups.
Diffstat (limited to 'lib/common_test')
-rw-r--r-- | lib/common_test/src/ct_framework.erl | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index dde9739dc6..1c4ee7bd49 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -760,20 +760,28 @@ find(Mod, Name, all, [{Name1,Props,Tests} | Gs], Known, Defs, true) 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, 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, Found); + find(Mod, Name, TCs, [{Name1,[],Tests} | Gs], Known, Defs, false); + +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, [TC | Gs], Known, Defs, false) when is_atom(TC) -> find(Mod, Name, TCs, Gs, Known, Defs, false); find(Mod, Name, TCs, [TC | Gs], Known, Defs, true) when is_atom(TC) -> - [TC | find(Mod, Name, TCs, Gs, Known, Defs, true)]; + [{Mod, TC} | find(Mod, Name, TCs, Gs, Known, Defs, true)]; -find(Mod, Name, TCs, [{ExternalTC, Case} = TC | Gs], Known, Defs, true) +find(Mod, Name, TCs, [{ExternalTC, Case} = TC | Gs], Known, Defs, Found) when is_atom(ExternalTC), is_atom(Case) -> - [TC | find(Mod, Name, TCs, Gs, Known, Defs, true)]; + [TC | find(Mod, Name, TCs, Gs, Known, Defs, Found)]; find(Mod, _Name, _TCs, [BadTerm | _Gs], Known, _Defs, _Found) -> Where = if length(Known) == 0 -> |