From afbd6fa341f89211697a3c3f59f888b8247aa7f4 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Thu, 1 Jul 2010 15:46:13 +0200 Subject: Add textured backgound to html log files The overview html log files now have a textured background. This default new look can be switched off with the 'basic_html' option. --- lib/common_test/src/ct_logs.erl | 68 +++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 27 deletions(-) (limited to 'lib/common_test/src/ct_logs.erl') diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl index bb859d3b72..004d0d2540 100644 --- a/lib/common_test/src/ct_logs.erl +++ b/lib/common_test/src/ct_logs.erl @@ -36,7 +36,8 @@ -export([make_all_suites_index/1,make_all_runs_index/1]). %% Logging stuff directly from testcase --export([tc_log/3,tc_print/3,tc_pal/3]). +-export([tc_log/3,tc_print/3,tc_pal/3, + basic_html/0]). %% Simulate logger process for use without ct environment running -export([simulate/0]). @@ -57,7 +58,7 @@ -define(table_color2,"#E4F0FE"). -define(table_color3,"#F0F8FF"). --define(testname_width, 55). +-define(testname_width, 60). -define(abs(Name), filename:absname(Name)). @@ -808,7 +809,7 @@ make_one_index_entry1(SuiteName, Link, Label, Success, Fail, UserSkip, AutoSkip, false -> "" end, - {Timestamp,Node,AllInfo} = + {Lbl,Timestamp,Node,AllInfo} = case All of {true,OldRuns} -> [_Prefix,NodeOrDate|_] = string:tokens(Link,"."), @@ -816,20 +817,21 @@ make_one_index_entry1(SuiteName, Link, Label, Success, Fail, UserSkip, AutoSkip, 0 -> "-"; _ -> NodeOrDate end, - N = ["",Node1,"\n"], + N = ["",Node1,"\n"], CtRunDir = filename:dirname(filename:dirname(Link)), - T = ["",timestamp(CtRunDir),"\n"], + L = ["",Label,"\n"], + T = ["",timestamp(CtRunDir),"\n"], CtLogFile = filename:join(CtRunDir,?ct_log_name), OldRunsLink = case OldRuns of [] -> "none"; _ -> "Old Runs" end, - A=["CT Log\n", - "",OldRunsLink,"\n"], - {T,N,A}; + A=["CT Log\n", + "",OldRunsLink,"\n"], + {L,T,N,A}; false -> - {"","",""} + {"","","",""} end, NotBuiltStr = if NotBuilt == 0 -> @@ -856,8 +858,8 @@ make_one_index_entry1(SuiteName, Link, Label, Success, Fail, UserSkip, AutoSkip, {UserSkip+AutoSkip,integer_to_list(UserSkip),ASStr} end, ["\n", - "",SuiteName,"",CrashDumpLink,"\n", - Label, + "",SuiteName,"",CrashDumpLink,"\n", + Lbl, Timestamp, "",integer_to_list(Success),"\n", "",FailStr,"\n", @@ -868,12 +870,14 @@ make_one_index_entry1(SuiteName, Link, Label, Success, Fail, UserSkip, AutoSkip, AllInfo, "\n"]. total_row(Success, Fail, UserSkip, AutoSkip, NotBuilt, All) -> - {TimestampCell,AllInfo} = + {Label,TimestampCell,AllInfo} = case All of - true -> - {" \n"," \n \n"}; + true -> + {" \n", + " \n", + " \n \n"}; false -> - {"",""} + {"","",""} end, {AllSkip,UserSkipStr,AutoSkipStr} = @@ -883,6 +887,7 @@ total_row(Success, Fail, UserSkip, AutoSkip, NotBuilt, All) -> end, ["\n", "Total", + Label, TimestampCell, "",integer_to_list(Success),"\n", "",integer_to_list(Fail),"\n", @@ -1047,19 +1052,28 @@ index_footer() -> footer() -> ["

\n" - "
\n" - "

\n" - "Copyright © ", year(), - " Open Telecom Platform
\n" - "Updated: ", current_time(), "
\n" - "
\n" - "

\n" - "\n"]. + "

\n" + "
\n" + "

\n" + "Copyright © ", year(), + " Open Telecom Platform
\n" + "Updated: ", current_time(), "
\n" + "
\n" + "\n" + "\n"]. body_tag() -> - "\n". + case basic_html() of + true -> + "\n"; + false -> + CTPath = ct_util:get_ct_root(), + TileFile = filename:join(filename:join(filename:join(CTPath),"priv"),"tile1.jpg"), + "\n" + end. current_time() -> format_time(calendar:local_time()). @@ -1297,7 +1311,7 @@ runentry(Dir, BasicHtml) -> end, Total = TotSucc+TotFail+AllSkip, A = ["",Node,"\n", - "",Label,"\n", + "",Label,"\n", "",NoOfTests,"\n"], B = if BasicHtml -> ["",TestNamesTrunc,"\n"]; @@ -1318,7 +1332,7 @@ runentry(Dir, BasicHtml) -> end, Index = filename:join(Dir,?index_name), ["\n" - "",timestamp(Dir),"",TotalsStr,"\n" + "",timestamp(Dir),"",TotalsStr,"\n" "\n"]. write_totals_file(Name,Label,Logs,Totals) -> -- cgit v1.2.3