aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-03-20 01:29:02 +0100
committerPeter Andersson <[email protected]>2012-03-21 11:41:57 +0100
commitc2a3647e471bb08de24d867bc7c3f541e2f7a15d (patch)
tree248e157a67cd4d6322bc5b6585e930a532598a7f /lib/common_test/src/ct.erl
parentafe7a29a54a7958ac90e44b3bee6c572792bb96b (diff)
downloadotp-c2a3647e471bb08de24d867bc7c3f541e2f7a15d.tar.gz
otp-c2a3647e471bb08de24d867bc7c3f541e2f7a15d.tar.bz2
otp-c2a3647e471bb08de24d867bc7c3f541e2f7a15d.zip
Implement support for user controlled timetraps
OTP-9988
Diffstat (limited to 'lib/common_test/src/ct.erl')
-rw-r--r--lib/common_test/src/ct.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl
index 63a8adbc63..296416737f 100644
--- a/lib/common_test/src/ct.erl
+++ b/lib/common_test/src/ct.erl
@@ -993,13 +993,21 @@ remove_config(Callback, Config) ->
%%%-----------------------------------------------------------------
%%% @spec timetrap(Time) -> ok
-%%% Time = {hours,Hours} | {minutes,Mins} | {seconds,Secs} | Millisecs | infinity
+%%% Time = {hours,Hours} | {minutes,Mins} | {seconds,Secs} | Millisecs | infinity | Func
%%% Hours = integer()
%%% Mins = integer()
%%% Secs = integer()
%%% Millisecs = integer() | float()
-%%%
-%%% @doc <p>Use this function to set a new timetrap for the running test case.</p>
+%%% Func = {M,F,A} | fun()
+%%% M = atom()
+%%% F = atom()
+%%% A = list()
+%%%
+%%% @doc <p>Use this function to set a new timetrap for the running test case.
+%%% If the argument is <code>Func</code>, the timetrap will be triggered
+%%% when this function returns. <code>Func</code> may also return a new
+%%% <code>Time</code> value, which in that case will be the value for the
+%%% new timetrap.</p>
timetrap(Time) ->
test_server:timetrap_cancel(),
test_server:timetrap(Time).