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