aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_run.erl
diff options
context:
space:
mode:
authorJames Fish <[email protected]>2015-03-04 21:19:52 +0000
committerZandra Hird <[email protected]>2015-05-05 15:16:56 +0200
commitb428cda36b3fc692e7feee3452cde0d76f110566 (patch)
tree7ac70dd8c29a745b5fcec5395f63fb7ff79208b4 /lib/common_test/src/ct_run.erl
parent66260d0606fcbaad3d5179288fea90cfe546cbbe (diff)
downloadotp-b428cda36b3fc692e7feee3452cde0d76f110566.tar.gz
otp-b428cda36b3fc692e7feee3452cde0d76f110566.tar.bz2
otp-b428cda36b3fc692e7feee3452cde0d76f110566.zip
Fix parsing list of one test directory in ct:run_test/1
Fix support for the following cases for ct:run_test/1 options: * [{dir, [Dir]}, {suite, _}, ...] * [{dir, [Dir]}, {suite, Suite}, {group, _}, ...] * [{dir, [Dir]}, {suite, Suite}, {case, _}, ...] Previously these options would result in a function_clause error as {dir, [Dir]} was not handled when combined with a suite.
Diffstat (limited to 'lib/common_test/src/ct_run.erl')
-rw-r--r--lib/common_test/src/ct_run.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl
index 33c4f352b0..632901837c 100644
--- a/lib/common_test/src/ct_run.erl
+++ b/lib/common_test/src/ct_run.erl
@@ -1627,11 +1627,15 @@ groups_and_cases(Gs, Cs) ->
tests(TestDir, Suites, []) when is_list(TestDir), is_integer(hd(TestDir)) ->
[{?testdir(TestDir,Suites),ensure_atom(Suites),all}];
tests(TestDir, Suite, Cases) when is_list(TestDir), is_integer(hd(TestDir)) ->
+ [{?testdir(TestDir,Suite),ensure_atom(Suite),Cases}];
+tests([TestDir], Suite, Cases) when is_list(TestDir), is_integer(hd(TestDir)) ->
[{?testdir(TestDir,Suite),ensure_atom(Suite),Cases}].
tests([{Dir,Suite}],Cases) ->
[{?testdir(Dir,Suite),ensure_atom(Suite),Cases}];
tests(TestDir, Suite) when is_list(TestDir), is_integer(hd(TestDir)) ->
- tests(TestDir, ensure_atom(Suite), all).
+ tests(TestDir, ensure_atom(Suite), all);
+tests([TestDir], Suite) when is_list(TestDir), is_integer(hd(TestDir)) ->
+ tests(TestDir, ensure_atom(Suite), all).
tests(DirSuites) when is_list(DirSuites), is_tuple(hd(DirSuites)) ->
[{?testdir(Dir,Suite),ensure_atom(Suite),all} || {Dir,Suite} <- DirSuites];
tests(TestDir) when is_list(TestDir), is_integer(hd(TestDir)) ->