aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test/ct_test_support.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2010-06-03 14:34:09 +0200
committerRaimo Niskanen <[email protected]>2010-06-09 16:19:21 +0200
commit7c6504029f84c52de40a6b29b2fd1b17c053ccec (patch)
tree048864f9673af5757359e25a99b613c91253a4a1 /lib/common_test/test/ct_test_support.erl
parent4da38a84f7540856fa590afdba2eb7958978788c (diff)
downloadotp-7c6504029f84c52de40a6b29b2fd1b17c053ccec.tar.gz
otp-7c6504029f84c52de40a6b29b2fd1b17c053ccec.tar.bz2
otp-7c6504029f84c52de40a6b29b2fd1b17c053ccec.zip
Add event_handler_init start flag that can pass init arguments to event handlers
Also changed: The userconfig option in ct:run_test/1 from 3-tuple to 2-tuple.
Diffstat (limited to 'lib/common_test/test/ct_test_support.erl')
-rw-r--r--lib/common_test/test/ct_test_support.erl19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index 0ce103e111..c3dc706d9b 100644
--- a/lib/common_test/test/ct_test_support.erl
+++ b/lib/common_test/test/ct_test_support.erl
@@ -28,7 +28,7 @@
-export([init_per_suite/1, init_per_suite/2, end_per_suite/1,
init_per_testcase/2, end_per_testcase/2, write_testspec/3,
- run/4, get_opts/1, wait_for_ct_stop/1]).
+ run/2, run/4, get_opts/1, wait_for_ct_stop/1]).
-export([handle_event/2, start_event_receiver/1, get_events/2,
verify_events/3, reformat/2, log_events/3]).
@@ -172,6 +172,23 @@ get_opts(Config) ->
%%%-----------------------------------------------------------------
%%%
+run(Opts, Config) ->
+ CTNode = ?config(ct_node, Config),
+ Level = ?config(trace_level, Config),
+ %% use ct interface
+ test_server:format(Level, "Calling ct:run_test(~p) on ~p~n",
+ [Opts, CTNode]),
+ Result1 = rpc:call(CTNode, ct, run_test, [Opts]),
+
+ %% use run_test interface (simulated)
+ test_server:format(Level, "Saving start opts on ~p: ~p~n", [CTNode,Opts]),
+ rpc:call(CTNode, application, set_env, [common_test, run_test_start_opts, Opts]),
+ test_server:format(Level, "Calling ct_run:script_start() on ~p~n", [CTNode]),
+ Result2 = rpc:call(CTNode, ct_run, script_start, []),
+
+ {Result1,Result2}.
+
+
run(M, F, A, Config) ->
CTNode = ?config(ct_node, Config),
Level = ?config(trace_level, Config),