aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2010-08-06 00:00:49 +0200
committerPeter Andersson <[email protected]>2010-09-02 14:44:54 +0200
commit8012586a816ad0509d137c4443bee97e6ff84146 (patch)
tree3a50babb8fad1e6addf1f78ec48f81fb2db4dccd /lib/common_test/src
parenta05e853496d0d0fa5330c65ab6b1755cd6ecca3f (diff)
downloadotp-8012586a816ad0509d137c4443bee97e6ff84146.tar.gz
otp-8012586a816ad0509d137c4443bee97e6ff84146.tar.bz2
otp-8012586a816ad0509d137c4443bee97e6ff84146.zip
Fix error with group term in ct:run_test/1
Also some new test cases on sequence groups have been added.
Diffstat (limited to 'lib/common_test/src')
-rw-r--r--lib/common_test/src/ct_run.erl22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl
index c5bfd01642..5447b9c8fc 100644
--- a/lib/common_test/src/ct_run.erl
+++ b/lib/common_test/src/ct_run.erl
@@ -879,8 +879,10 @@ run_dir(Opts = #opts{logdir = LogDir,
case lists:keysearch(suite, 1, StartOpts) of
{value,{_,Suite}} when is_integer(hd(Suite)) ; is_atom(Suite) ->
{Dir,Mod} = S2M(Suite),
- case listify(proplists:get_value(group, StartOpts, [])) ++
- listify(proplists:get_value(testcase, StartOpts, [])) of
+ case groups_and_cases(proplists:get_value(group, StartOpts),
+ proplists:get_value(testcase, StartOpts)) of
+ Error = {error,_} ->
+ exit(Error);
[] ->
reformat_result(catch do_run(tests(Dir, listify(Mod)),
[], Opts1, StartOpts));
@@ -900,8 +902,10 @@ run_dir(Opts = #opts{logdir = LogDir,
Mod = if is_atom(Suite) -> Suite;
true -> list_to_atom(Suite)
end,
- case listify(proplists:get_value(group, StartOpts, [])) ++
- listify(proplists:get_value(testcase, StartOpts, [])) of
+ case groups_and_cases(proplists:get_value(group, StartOpts),
+ proplists:get_value(testcase, StartOpts)) of
+ Error = {error,_} ->
+ exit(Error);
[] ->
reformat_result(catch do_run(tests(Dir, listify(Mod)),
[], Opts1, StartOpts));
@@ -1087,14 +1091,16 @@ groups_and_cases(Gs, Cs) when ((Gs == undefined) or (Gs == [])) and
((Cs == undefined) or (Cs == [])) ->
[];
groups_and_cases(Gs, Cs) when Gs == undefined ; Gs == [] ->
- [list_to_atom(C) || C <- Cs];
+ [ensure_atom(C) || C <- listify(Cs)];
groups_and_cases(Gs, Cs) when Cs == undefined ; Cs == [] ->
- [{list_to_atom(G),all} || G <- Gs];
+ [{ensure_atom(G),all} || G <- listify(Gs)];
+groups_and_cases(G, Cs) when is_atom(G) ->
+ [{G,[ensure_atom(C) || C <- listify(Cs)]}];
groups_and_cases([G], Cs) ->
- [{list_to_atom(G),[list_to_atom(C) || C <- Cs]}];
+ [{ensure_atom(G),[ensure_atom(C) || C <- listify(Cs)]}];
groups_and_cases([_,_|_] , Cs) when Cs =/= [] ->
{error,multiple_groups_and_cases};
-groups_and_cases(_Gs, _Cs) ->
+groups_and_cases(Gs, Cs) ->
{error,incorrect_group_or_case_option}.
tests(TestDir, Suites, []) when is_list(TestDir), is_integer(hd(TestDir)) ->