aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-08-23 18:28:19 +0200
committerPeter Andersson <[email protected]>2012-08-23 18:28:19 +0200
commit005eb245e52a08180460e62bf3e919e1ffde810c (patch)
tree933acafaaa1362cfa8e3f3b6fd407966cd6a5ff1
parent0cf386d0968b6cd1515b5739a8a6575d4a7c3acd (diff)
parent38456cd45c8677a567e32722dee0d9602a306037 (diff)
downloadotp-005eb245e52a08180460e62bf3e919e1ffde810c.tar.gz
otp-005eb245e52a08180460e62bf3e919e1ffde810c.tar.bz2
otp-005eb245e52a08180460e62bf3e919e1ffde810c.zip
Merge branch 'maint'
-rw-r--r--lib/common_test/src/ct_logs.erl31
-rw-r--r--lib/common_test/src/ct_run.erl6
-rw-r--r--lib/common_test/src/ct_util.erl12
3 files changed, 31 insertions, 18 deletions
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index 4b01532863..0b7a8bb075 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -241,7 +241,7 @@ end_tc(TCPid) ->
%%% activity it is. <code>Format</code> and <code>Args</code> is the
%%% data to log (as in <code>io:format(Format,Args)</code>).</p>
log(Heading,Format,Args) ->
- cast({log,sync,self(),group_leader(),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
[{int_header(),[log_timestamp(now()),Heading]},
{Format,Args},
{int_footer(),[]}]}),
@@ -263,7 +263,7 @@ log(Heading,Format,Args) ->
%%% @see cont_log/2
%%% @see end_log/0
start_log(Heading) ->
- cast({log,sync,self(),group_leader(),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
[{int_header(),[log_timestamp(now()),Heading]}]}),
ok.
@@ -278,7 +278,8 @@ cont_log([],[]) ->
ok;
cont_log(Format,Args) ->
maybe_log_timestamp(),
- cast({log,sync,self(),group_leader(),[{Format,Args}]}),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
+ [{Format,Args}]}),
ok.
%%%-----------------------------------------------------------------
@@ -289,7 +290,8 @@ cont_log(Format,Args) ->
%%% @see start_log/1
%%% @see cont_log/2
end_log() ->
- cast({log,sync,self(),group_leader(),[{int_footer(), []}]}),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
+ [{int_footer(), []}]}),
ok.
@@ -397,6 +399,8 @@ tc_print(Category,Importance,Format,Args) ->
VLvl = case ct_util:get_testdata({verbosity,Category}) of
undefined ->
ct_util:get_testdata({verbosity,'$unspecified'});
+ {error,bad_invocation} ->
+ ?MAX_VERBOSITY;
Val ->
Val
end,
@@ -484,7 +488,7 @@ maybe_log_timestamp() ->
{MS,S,_} ->
ok;
_ ->
- cast({log,sync,self(),group_leader(),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
[{"<i>~s</i>",[log_timestamp({MS,S,US})]}]})
end.
@@ -619,10 +623,15 @@ copy_priv_files([], []) ->
logger_loop(State) ->
receive
{log,SyncOrAsync,Pid,GL,Category,Importance,List} ->
- VLvl = case get({verbosity,Category}) of
- undefined -> get({verbosity,'$unspecified'});
- Val -> Val
- end,
+ VLvl = case Category of
+ ct_internal ->
+ ?MAX_VERBOSITY;
+ _ ->
+ case get({verbosity,Category}) of
+ undefined -> get({verbosity,'$unspecified'});
+ Val -> Val
+ end
+ end,
if Importance >= (100-VLvl) ->
case get_groupleader(Pid, GL, State) of
{tc_log,TCGL,TCGLs} ->
@@ -754,7 +763,7 @@ print_to_log(async, FromPid, TCGL, List, State) ->
true -> State#logger_state.ct_log_fd
end,
Printer = fun() ->
- test_server:permit_io(TCGL, self()),
+ test_server:permit_io(IoProc, self()),
io:format(IoProc, "~s", [lists:foldl(IoFun, [], List)])
end,
case State#logger_state.async_print_jobs of
@@ -2105,7 +2114,7 @@ simulate() ->
simulate_logger_loop() ->
receive
- {log,_,_,_,List} ->
+ {log,_,_,_,_,_,List} ->
S = [[io_lib:format(Str,Args),io_lib:nl()] || {Str,Args} <- List],
io:format("~s",[S]),
simulate_logger_loop();
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl
index 1dbd9973cf..a202ca15e2 100644
--- a/lib/common_test/src/ct_run.erl
+++ b/lib/common_test/src/ct_run.erl
@@ -1114,7 +1114,7 @@ run_spec_file(Relaxed,
end.
run_prepared(Run, Skip, Opts = #opts{logdir = LogDir,
- config = CfgFiles },
+ config = CfgFiles},
StartOpts) ->
LogDir1 = which(logdir, LogDir),
case check_and_install_configfiles(CfgFiles, LogDir1, Opts) of
@@ -1619,7 +1619,8 @@ do_run(Tests, Skip, Opts, Args) when is_record(Opts, opts) ->
"run ct:start_interactive()\n\n",[]),
{error,interactive_mode};
_Pid ->
- compile_and_run(Tests, Skip, Opts1, Args)
+ compile_and_run(Tests, Skip,
+ Opts1#opts{verbosity=Verbosity}, Args)
end
end.
@@ -1786,7 +1787,6 @@ verify_suites(TestSuites) ->
Beam = filename:join(TestDir,
atom_to_list(Suite)++
".beam"),
-
case filelib:is_regular(Beam) of
true ->
{[DS|Found],NotFound};
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl
index 95072ebf58..efc85543ac 100644
--- a/lib/common_test/src/ct_util.erl
+++ b/lib/common_test/src/ct_util.erl
@@ -858,13 +858,17 @@ call(Msg) ->
call(Msg, infinity).
call(Msg, Timeout) ->
- case whereis(ct_util_server) of
- undefined ->
+ case {self(),whereis(ct_util_server)} of
+ {_,undefined} ->
{error,ct_util_server_not_running};
- Pid ->
+ {Pid,Pid} ->
+ %% the caller is ct_util_server, which must
+ %% be a mistake
+ {error,bad_invocation};
+ {Self,Pid} ->
MRef = erlang:monitor(process, Pid),
Ref = make_ref(),
- ct_util_server ! {Msg,{self(),Ref}},
+ ct_util_server ! {Msg,{Self,Ref}},
receive
{Ref, Result} ->
erlang:demonitor(MRef, [flush]),