aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_framework.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2010-07-01 15:46:13 +0200
committerPeter Andersson <[email protected]>2010-07-06 02:44:27 +0200
commitafbd6fa341f89211697a3c3f59f888b8247aa7f4 (patch)
treecb9ec5ea21a5b146be67fd5b9a2d26cb8e730b49 /lib/common_test/src/ct_framework.erl
parent79851b599df5caf5e2101d834a843e3837c6a6ae (diff)
downloadotp-afbd6fa341f89211697a3c3f59f888b8247aa7f4.tar.gz
otp-afbd6fa341f89211697a3c3f59f888b8247aa7f4.tar.bz2
otp-afbd6fa341f89211697a3c3f59f888b8247aa7f4.zip
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.
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r--lib/common_test/src/ct_framework.erl30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index 1c8a14574f..17215e5eb5 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -27,6 +27,8 @@
-export([init_tc/3, end_tc/3, get_suite/2, report/2, warn/1]).
-export([error_notification/4]).
+-export([overview_html_header/1]).
+
-export([error_in_suite/1, ct_init_per_group/2, ct_end_per_group/2]).
-export([make_all_conf/3, make_conf/5]).
@@ -1218,4 +1220,32 @@ add_data_dir(File,Config) when is_list(File) ->
File
end.
+%%%-----------------------------------------------------------------
+%%% @spec overview_html_header(TestName) -> Header
+overview_html_header(TestName) ->
+ TestName1 = lists:flatten(io_lib:format("~p", [TestName])),
+ Label = case application:get_env(common_test, test_label) of
+ {ok,Lbl} when Lbl =/= undefined ->
+ "<H1><FONT color=\"green\">" ++ Lbl ++ "</FONT></H1>\n";
+ _ ->
+ ""
+ end,
+ Bgr = case ct_logs:basic_html() of
+ true ->
+ "";
+ false ->
+ CTPath = ct_util:get_ct_root(),
+ TileFile = filename:join(filename:join(filename:join(CTPath),
+ "priv"),"tile1.jpg"),
+ " background=\"" ++ TileFile ++ "\""
+ end,
+
+ ["<html>\n",
+ "<head><title>Test ", TestName1, " results</title>\n",
+ "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
+ "</head>\n",
+ "<body", Bgr, " bgcolor=\"white\" text=\"black\" ",
+ "link=\"blue\" vlink=\"purple\" alink=\"red\">\n",
+ Label,
+ "<H2>Results from test ", TestName1, "</H2>\n"].