From c85ff9ae224088a86654b16cc868483819336ed1 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Mon, 22 Apr 2013 14:09:59 +0200 Subject: Add correct footer to last run index page OTP-11046 --- lib/common_test/src/ct_logs.erl | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'lib/common_test') diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl index 79db1ae65c..adea28e0fb 100644 --- a/lib/common_test/src/ct_logs.erl +++ b/lib/common_test/src/ct_logs.erl @@ -978,12 +978,11 @@ print_style_error(Fd,StyleSheet,Reason) -> print_style(Fd,undefined). close_ctlog(Fd) -> - io:format(Fd,"\n\n",[]), - io:format(Fd,footer(),[]), + io:format(Fd, "\n\n", []), + io:format(Fd, [xhtml("

\n", "

\n") | footer()], []), file:close(Fd). - %%%----------------------------------------------------------------- %%% Make an index page for the last run make_last_run_index(StartTime) -> @@ -1037,7 +1036,7 @@ make_last_run_index1(StartTime,IndexName) -> 0, 0, 0, 0, 0, Missing), %% write current Totals to file, later to be used in all_runs log write_totals_file(?totals_name,Label,Logs1,Totals), - Index = [Index0|index_footer()], + Index = [Index0|last_run_index_footer()], case force_write_file(IndexName, unicode:characters_to_binary(Index)) of ok -> @@ -1446,17 +1445,30 @@ header1(Title, SubTitle, TableCols) -> "\n", SubTitleHTML,"\n"]. -index_footer() -> - ["\n" +last_run_index_footer() -> + AllRuns = filename:join("../",?all_runs_name), + TestIndex = filename:join("../",?index_name), + ["\n", + xhtml("

\n", "


\n"), + "Test run history\n | ", + "Top level test index\n\n

\n", "\n" | footer()]. +all_suites_index_footer() -> + ["\n", + "\n", + xhtml("

\n", "

\n") | footer()]. + all_runs_index_footer() -> - ["\n\n" - "\n" | footer()]. + ["\n\n", + "\n", + xhtml("

\n", "

\n") | footer()]. footer() -> ["
\n", - xhtml("

\n
\n", "

\n"), + xhtml("
\n", ""), xhtml("

\n", "

"), "Copyright © ", year(), " Open Telecom Platform", @@ -1468,7 +1480,6 @@ footer() -> "\n" "\n"]. - body_tag() -> CTPath = code:lib_dir(common_test), TileFile = filename:join(filename:join(CTPath,"priv"),"tile1.jpg"), @@ -2370,7 +2381,7 @@ make_all_suites_index2(IndexName, AllTestLogDirs) -> make_all_suites_index3(AllTestLogDirs, all_suites_index_header(), 0, 0, 0, 0, 0, [], []), - Index = [Index0|index_footer()], + Index = [Index0|all_suites_index_footer()], case force_write_file(IndexName, unicode:characters_to_binary(Index)) of ok -> {ok,TempData}; @@ -2476,7 +2487,7 @@ make_all_suites_ix_temp(AbsIndexName, NewTestData, Label, AllTestLogDirs) -> Index0 = make_all_suites_ix_temp1(AllTestLogDirs1, all_suites_index_header(IndexDir), 0, 0, 0, 0, 0), - Index = [Index0|index_footer()], + Index = [Index0|all_suites_index_footer()], case force_write_file(AbsIndexName, unicode:characters_to_binary(Index)) of ok -> ok; -- cgit v1.2.3 From 5e0617242fe313a6eb3ce57b71eb4a3855de2c66 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Mon, 22 Apr 2013 16:31:01 +0200 Subject: Fix error with refreshing logs when html util files are missing OTP-11046 --- lib/common_test/src/ct_logs.erl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/common_test') diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl index adea28e0fb..d557150a63 100644 --- a/lib/common_test/src/ct_logs.erl +++ b/lib/common_test/src/ct_logs.erl @@ -199,12 +199,19 @@ clear_stylesheet(TC) -> %%%----------------------------------------------------------------- %%% @spec get_log_dir() -> {ok,Dir} | {error,Reason} get_log_dir() -> - call({get_log_dir,false}). + get_log_dir(false). %%%----------------------------------------------------------------- %%% @spec get_log_dir(ReturnAbsName) -> {ok,Dir} | {error,Reason} get_log_dir(ReturnAbsName) -> - call({get_log_dir,ReturnAbsName}). + case call({get_log_dir,ReturnAbsName}) of + {error,does_not_exist} when ReturnAbsName == true -> + {ok,filename:absname(".")}; + {error,does_not_exist} -> + {ok,"."}; + Result -> + Result + end. %%%----------------------------------------------------------------- %%% make_last_run_index() -> ok @@ -546,7 +553,6 @@ log_timestamp({MS,S,US}) -> logger(Parent, Mode, Verbosity) -> register(?MODULE,self()), - %%! Below is a temporary workaround for the limitation of %%! max one test run per second. %%! ---> -- cgit v1.2.3