diff options
author | Peter Andersson <[email protected]> | 2010-06-29 18:03:09 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2010-07-06 02:44:27 +0200 |
commit | 79851b599df5caf5e2101d834a843e3837c6a6ae (patch) | |
tree | 8490cb6a80e20838bb3a6b091ed9f132f9b4ceea /lib/common_test/src/ct_framework.erl | |
parent | 31b52954dc667861a2e7cd4edba100132499cd5f (diff) | |
download | otp-79851b599df5caf5e2101d834a843e3837c6a6ae.tar.gz otp-79851b599df5caf5e2101d834a843e3837c6a6ae.tar.bz2 otp-79851b599df5caf5e2101d834a843e3837c6a6ae.zip |
Improve handling of test case group specifications
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r-- | lib/common_test/src/ct_framework.erl | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 25915b9db2..1c8a14574f 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -29,7 +29,7 @@ -export([error_in_suite/1, ct_init_per_group/2, ct_end_per_group/2]). --export([make_conf/5]). +-export([make_all_conf/3, make_conf/5]). -include("ct_event.hrl"). -include("ct_util.hrl"). @@ -850,6 +850,32 @@ expand(Mod, Name, Defs) -> throw({error,list_to_atom(E)}) end. +make_all_conf(Dir, Mod, _Props) -> + case code:is_loaded(Mod) of + false -> + code:load_abs(filename:join(Dir,atom_to_list(Mod))); + _ -> + ok + end, + make_all_conf(Mod). + +make_all_conf(Mod) -> + case catch apply(Mod, groups, []) of + {'EXIT',_} -> + {error,{invalid_group_definition,Mod}}; + GroupDefs when is_list(GroupDefs) -> + case catch find_groups(Mod, all, all, GroupDefs) of + {error,_} = Error -> + %% this makes test_server call error_in_suite as first + %% (and only) test case so we can report Error properly + [{?MODULE,error_in_suite,[[Error]]}]; + [] -> + {error,{invalid_group_spec,Mod}}; + ConfTests -> + ConfTests + end + end. + make_conf(Dir, Mod, Name, Props, TestSpec) -> case code:is_loaded(Mod) of false -> |