aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_framework.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2019-03-20 16:48:41 +0100
committerSiri Hansen <[email protected]>2019-04-15 11:22:56 +0200
commit3d087911ef3ecd769333b822c337bbbb76877871 (patch)
treea618ec69afe9e37c7e15f2ba5d6a555e6eef8c33 /lib/common_test/src/ct_framework.erl
parentacd87425acf7705328b01aa8f0a804207ffe4790 (diff)
downloadotp-3d087911ef3ecd769333b822c337bbbb76877871.tar.gz
otp-3d087911ef3ecd769333b822c337bbbb76877871.tar.bz2
otp-3d087911ef3ecd769333b822c337bbbb76877871.zip
[ct] Add {testcase,TC,RepeatProps} syntax for repeating test cases
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r--lib/common_test/src/ct_framework.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index f2d063254a..c8450280ef 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -1208,8 +1208,9 @@ get_all(Mod, ConfTests) ->
try ct_groups:expand_groups(AllTCs, ConfTests, Mod) of
{error,_} = Error ->
[{?MODULE,error_in_suite,[[Error]]}];
- Tests ->
- ct_groups:delete_subs(Tests, Tests)
+ Tests0 ->
+ Tests = ct_groups:delete_subs(Tests0, Tests0),
+ expand_tests(Mod, Tests)
catch
throw:{error,Error} ->
[{?MODULE,error_in_suite,[[{error,Error}]]}];
@@ -1683,3 +1684,10 @@ handle_callback_crash(undef,[{Mod,Func,[],_}|_],Mod,Func,Default) ->
end;
handle_callback_crash(Reason,Stacktrace,_Mod,_Func,_Default) ->
{error,{failed,{Reason,Stacktrace}}}.
+
+expand_tests(Mod, [{testcase,Case,[Prop]}|Tests]) ->
+ [{repeat,{Mod,Case},Prop}|expand_tests(Mod,Tests)];
+expand_tests(Mod,[Test|Tests]) ->
+ [Test|expand_tests(Mod,Tests)];
+expand_tests(_Mod,[]) ->
+ [].