diff options
-rw-r--r-- | lib/common_test/priv/ct_default.css | 2 | ||||
-rw-r--r-- | lib/common_test/src/ct_logs.erl | 28 | ||||
-rw-r--r-- | lib/test_server/src/test_server.erl | 20 | ||||
-rw-r--r-- | lib/test_server/src/test_server_ctrl.erl | 8 |
4 files changed, 33 insertions, 25 deletions
diff --git a/lib/common_test/priv/ct_default.css b/lib/common_test/priv/ct_default.css index a64e1ec576..75f8d5db8a 100644 --- a/lib/common_test/priv/ct_default.css +++ b/lib/common_test/priv/ct_default.css @@ -147,7 +147,7 @@ td a:visited { } tr:hover th[scope=row], tr:hover td { - background-color: #808080; + background-color: #D1D1D1; color: #fff; } diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl index d66a31d9a5..19ad7b26d8 100644 --- a/lib/common_test/src/ct_logs.erl +++ b/lib/common_test/src/ct_logs.erl @@ -223,7 +223,6 @@ init_tc(RefreshLog) -> %%% %%% <p>This function is called by ct_framework:end_tc/3</p> end_tc(TCPid) -> - io:format(xhtml("<br>", "<br />")), %% use call here so that the TC process will wait and receive %% possible exit signals from ct_logs before end_tc returns ok call({end_tc,TCPid}). @@ -745,20 +744,19 @@ print_style(Fd,StyleSheet) -> 0 -> string:str(Str,"<STYLE>"); N0 -> N0 end, - case Pos0 of - 0 -> print_style_error(Fd,StyleSheet,missing_style_tag); - _ -> - Pos1 = case string:str(Str,"</style>") of - 0 -> string:str(Str,"</STYLE>"); - N1 -> N1 - end, - case Pos1 of - 0 -> - print_style_error(Fd,StyleSheet,missing_style_end_tag); - _ -> - Style = string:sub_string(Str,Pos0,Pos1+7), - io:format(Fd,"~s\n",[Style]) - end + Pos1 = case string:str(Str,"</style>") of + 0 -> string:str(Str,"</STYLE>"); + N1 -> N1 + end, + if (Pos0 == 0) and (Pos1 /= 0) -> + print_style_error(Fd,StyleSheet,missing_style_start_tag); + (Pos0 /= 0) and (Pos1 == 0) -> + print_style_error(Fd,StyleSheet,missing_style_end_tag); + Pos0 /= 0 -> + Style = string:sub_string(Str,Pos0,Pos1+7), + io:format(Fd,"~s\n",[Style]); + Pos0 == 0 -> + io:format(Fd,"<style>~s</style>\n",[Str]) end; {error,Reason} -> print_style_error(Fd,StyleSheet,Reason) diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl index 743e6c1d29..98a2e21e21 100644 --- a/lib/test_server/src/test_server.erl +++ b/lib/test_server/src/test_server.erl @@ -611,7 +611,7 @@ do_run_test_case_apply(Mod, Func, Args, Name, RunInit, TimetrapData) -> print(minor, "Test case started with:\n~s:~s(~p)\n", [Mod,Func,Args2Print]), print(minor, "Current directory is ~p\n", [Cwd]), print_timestamp(minor,"Started at "), - print(minor, "", []), + print(minor, "", [], internal_raw), TCCallback = get(test_server_testcase_callback), LogOpts = get(test_server_logopts), Ref = make_ref(), @@ -1007,8 +1007,11 @@ spawn_fw_call(Mod,{end_per_testcase,Func},EndConf,Pid, end, %% if end_per_testcase fails a warning should be %% printed as comment - Comment1 = if Comment == "" -> ""; - true -> Comment ++ "<br>" + Comment1 = if Comment == "" -> + ""; + true -> + Comment ++ test_server_ctrl:xhtml("<br>", + "<br />") end, %% finished, report back SendTo ! {self(),fw_notify_done, @@ -1473,7 +1476,8 @@ do_end_per_testcase(Mod,EndFunc,Func,Conf) -> throw:Other -> Comment0 = case read_comment() of "" -> ""; - Cmt -> Cmt ++ "<br>" + Cmt -> Cmt ++ test_server_ctrl:xhtml("<br>", + "<br />") end, set_loc(erlang:get_stacktrace()), comment(io_lib:format("~s<font color=\"red\">" @@ -1496,7 +1500,8 @@ do_end_per_testcase(Mod,EndFunc,Func,Conf) -> end, Comment0 = case read_comment() of "" -> ""; - Cmt -> Cmt ++ "<br>" + Cmt -> Cmt ++ test_server_ctrl:xhtml("<br>", + "<br />") end, comment(io_lib:format("~s<font color=\"red\">" "WARNING: ~w crashed!" @@ -1572,7 +1577,7 @@ fw_error_notify(Mod, Func, Args, Error, Loc) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% print(Detail,Format,Args) -> ok +%% print(Detail,Format,Args,Printer) -> ok %% Detail = integer() %% Format = string() %% Args = [term()] @@ -1583,6 +1588,9 @@ fw_error_notify(Mod, Func, Args, Error, Loc) -> print(Detail,Format,Args) -> local_or_remote_apply({test_server_ctrl,print,[Detail,Format,Args]}). +print(Detail,Format,Args,Printer) -> + local_or_remote_apply({test_server_ctrl,print,[Detail,Format,Args,Printer]}). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% print_timsteamp(Detail,Leader) -> ok %% diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl index 9fd0adbfc8..642bb14c88 100644 --- a/lib/test_server/src/test_server_ctrl.erl +++ b/lib/test_server/src/test_server_ctrl.erl @@ -171,7 +171,7 @@ -export([kill_slavenodes/0]). %%% TEST_SERVER INTERFACE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([output/2, print/2, print/3, print_timestamp/2]). +-export([output/2, print/2, print/3, print/4, print_timestamp/2]). -export([start_node/3, stop_node/1, wait_for_node/1, is_release_available/1]). -export([format/1, format/2, format/3, to_string/1]). -export([get_target_info/0]). @@ -187,6 +187,7 @@ -export([handle_call/3, handle_cast/2, handle_info/2]). -export([do_test_cases/4]). -export([do_spec/2, do_spec_list/2]). +-export([xhtml/2]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -3627,7 +3628,7 @@ run_test_case1(Ref, Num, Mod, Func, Args, RunInit, Where, test_server_sup:framework_call(report, [tc_start,{?pl2a(Mod),Func}]), print(major, "=case ~p:~p", [Mod, Func]), MinorName = start_minor_log_file(Mod, Func), - print(minor, "<a name=\"top\"></a>", []), + print(minor, "<a name=\"top\"></a>", [], internal_raw), MinorBase = filename:basename(MinorName), print(major, "=logfile ~s", [filename:basename(MinorName)]), print_props((RunInit==skip_init), get_props(Mode)), @@ -3651,7 +3652,8 @@ run_test_case1(Ref, Num, Mod, Func, Args, RunInit, Where, {died,DReason,DLoc,DCmt} -> {died,DReason,DLoc,[],DCmt} end, - print(minor, "<a name=\"end\"></a>", []), + print(minor, "<a name=\"end\"></a>", [], internal_raw), + print(minor, "\n", [], internal_raw), print_timestamp(minor, "Ended at "), print(major, "=ended ~s", [lists:flatten(timestamp_get(""))]), |