diff options
author | Lukas Larsson <[email protected]> | 2012-07-19 16:31:51 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2012-07-19 16:31:51 +0200 |
commit | ed273fd511169dba3686f97c7276a6508973400b (patch) | |
tree | 8e5f75ee13895591167787c5c97bc5f95af0b6aa /lib/common_test/src/ct.erl | |
parent | 82470e1c820e367007338b8e188d7d985aabe77b (diff) | |
parent | 56d2d5ece7a1abdafcab830cbb5e83663b38ec00 (diff) | |
download | otp-ed273fd511169dba3686f97c7276a6508973400b.tar.gz otp-ed273fd511169dba3686f97c7276a6508973400b.tar.bz2 otp-ed273fd511169dba3686f97c7276a6508973400b.zip |
Merge branch 'maint'
* maint:
Add ct:notify and ct:sync_notify
Diffstat (limited to 'lib/common_test/src/ct.erl')
-rw-r--r-- | lib/common_test/src/ct.erl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl index 571d99029f..6373634812 100644 --- a/lib/common_test/src/ct.erl +++ b/lib/common_test/src/ct.erl @@ -66,7 +66,8 @@ capture_start/0, capture_stop/0, capture_get/0, capture_get/1, fail/1, fail/2, comment/1, comment/2, make_priv_dir/0, testcases/2, userdata/2, userdata/3, - timetrap/1, get_timetrap_info/0, sleep/1]). + timetrap/1, get_timetrap_info/0, sleep/1, + notify/2, sync_notify/2]). %% New API for manipulating with config handlers -export([add_config/2, remove_config/2]). @@ -1047,3 +1048,27 @@ sleep({seconds,Ss}) -> sleep(trunc(Ss * 1000)); sleep(Time) -> test_server:adjusted_sleep(Time). + +%%%----------------------------------------------------------------- +%%% @spec notify(Name,Data) -> ok +%%% Name = atom() +%%% Data = term() +%%% +%%% @doc <p>Sends a asynchronous notification of type <c>Name</c> with +%%% <c>Data</c>to the common_test event manager. This can later be +%%% caught by any installed event manager. </p> +%%% @see //stdlib/gen_event +notify(Name,Data) -> + ct_event:notify(Name, Data). + +%%%----------------------------------------------------------------- +%%% @spec sync_notify(Name,Data) -> ok +%%% Name = atom() +%%% Data = term() +%%% +%%% @doc <p>Sends a synchronous notification of type <c>Name</c> with +%%% <c>Data</c>to the common_test event manager. This can later be +%%% caught by any installed event manager. </p> +%%% @see //stdlib/gen_event +sync_notify(Name,Data) -> + ct_event:sync_notify(Name, Data). |