aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src/test_server_ctrl.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2011-11-14 17:02:22 +0100
committerPeter Andersson <[email protected]>2011-11-14 17:02:22 +0100
commitbe0c9a73c891a8d12a249abf558770f540f316e9 (patch)
tree3a43efe972c55b451d39781c3f797abc4e61453c /lib/test_server/src/test_server_ctrl.erl
parent2cacf6885cafa276985324924a038618b0bb10fd (diff)
downloadotp-be0c9a73c891a8d12a249abf558770f540f316e9.tar.gz
otp-be0c9a73c891a8d12a249abf558770f540f316e9.tar.bz2
otp-be0c9a73c891a8d12a249abf558770f540f316e9.zip
Copy default CSS file to log directory before test run
The log files should be independent of the Common Test installation.
Diffstat (limited to 'lib/test_server/src/test_server_ctrl.erl')
-rw-r--r--lib/test_server/src/test_server_ctrl.erl47
1 files changed, 26 insertions, 21 deletions
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl
index 49cce9c429..14a77f5785 100644
--- a/lib/test_server/src/test_server_ctrl.erl
+++ b/lib/test_server/src/test_server_ctrl.erl
@@ -1692,23 +1692,24 @@ do_test_cases(TopCases, SkipCases,
[print_if_known(N, {", ~w test cases",[N]},
{" (with repeated test cases)",[]})]),
Test = get(test_server_name),
- TestName = if is_list(Test) ->
- lists:flatten(io_lib:format("~s", [Test]));
- true ->
- lists:flatten(io_lib:format("~p", [Test]))
- end,
+ TestName = if is_list(Test) ->
+ lists:flatten(io_lib:format("~s", [Test]));
+ true ->
+ lists:flatten(io_lib:format("~p", [Test]))
+ end,
+ TestDescr = "Test " ++ TestName ++ " results",
test_server_sup:framework_call(report, [tests_start,{Test,N}]),
{Header,Footer} =
case test_server_sup:framework_call(get_html_wrapper,
- [Test,true], "") of
+ [TestDescr,true], "") of
Empty when (Empty == "") ; (element(2,Empty) == "") ->
put(basic_html, true),
{["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n",
"<!-- autogenerated by '", atom_to_list(?MODULE), "'. -->\n",
"<html>\n",
- "<head><title>Test ", TestName, " results</title>\n",
+ "<head><title>", TestDescr, "</title>\n",
"<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
"</head>\n",
"<body bgcolor=\"white\" text=\"black\" ",
@@ -1731,14 +1732,16 @@ do_test_cases(TopCases, SkipCases,
print_timestamp(html, "Test started at "),
print(html, xhtml("</p>", "</h4>")),
- print(html, xhtml("<p>HOST:<br>\n", "<p>HOST:<br />\n")),
+ print(html, xhtml("\n<p><b>Host info:</b><br>\n",
+ "\n<p><b>Host info:</b><br />\n")),
print_who(test_server_sup:hoststr(), test_server_sup:get_username()),
print(html, xhtml("<br>Used Erlang v~s in <tt>~s</tt></p>\n",
"<br />Used Erlang v~s in \"~s\"</p>\n"),
[erlang:system_info(version), code:root_dir()]),
if FwMod == ?MODULE ->
- print(html, xhtml("<p>TARGET:<br>\n", "<p>TARGET:<br />\n")),
+ print(html, xhtml("\n<p><b>Target Info:</b><br>\n",
+ "\n<p><b>Target Info:</b><br />\n")),
print_who(TI#target_info.host, TI#target_info.username),
print(html, xhtml("<br>Used Erlang v~s in <tt>~s</tt></p>\n",
"<br />Used Erlang v~s in \"~s\"</p>\n"),
@@ -1747,7 +1750,8 @@ do_test_cases(TopCases, SkipCases,
case test_server_sup:framework_call(target_info, []) of
TargetInfo when is_list(TargetInfo),
length(TargetInfo) > 0 ->
- print(html, xhtml("<p>TARGET:<br>\n", "<p>TARGET:<br />\n")),
+ print(html, xhtml("\n<p><b>Target info:</b><br>\n",
+ "\n<p><b>Target info:</b><br />\n")),
print(html, "~s</p>\n", [TargetInfo]);
_ ->
ok
@@ -1755,9 +1759,9 @@ do_test_cases(TopCases, SkipCases,
end,
print(html,
- "<ul>\n"
+ "<p><ul>\n"
"<li><a href=\"~s\">Full textual log</a></li>\n"
- "<li><a href=\"~s\">Coverage log</a></li>\n</ul>\n",
+ "<li><a href=\"~s\">Coverage log</a></li>\n</ul></p>\n",
[?suitelog_name,?coverlog_name]),
print(html,
"<p>~s</p>\n" ++
@@ -1908,16 +1912,16 @@ start_minor_log_file1(Mod, Func, LogDir, AbsName) ->
Lev = get(test_server_minor_level)+1000, %% far down in the minor levels
put(test_server_minor_fd, Fd),
- TestName = io_lib:format("~p:~p", [Mod,Func]),
+ TestDescr = io_lib:format("Test ~p:~p result", [Mod,Func]),
{Header,Footer} =
case test_server_sup:framework_call(get_html_wrapper,
- [TestName,false], "") of
+ [TestDescr,false], "") of
Empty when (Empty == "") ; (element(2,Empty) == "") ->
put(basic_html, true),
{["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n",
"<!-- autogenerated by '", atom_to_list(?MODULE), "'. -->\n",
"<html>\n",
- "<head><title>Test ", TestName, "</title>\n",
+ "<head><title>", TestDescr, "</title>\n",
"<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
"</head>\n",
"<body bgcolor=\"white\" text=\"black\" ",
@@ -2038,14 +2042,15 @@ html_possibly_convert(Src, SrcInfo, Dest) ->
ok; % dest file up to date
_ ->
Header =
- case test_server_sup:framework_call(get_html_header,
- [Src,false], "") of
+ case test_server_sup:framework_call(get_html_wrapper,
+ ["Module "++Src,false],
+ "") of
Empty when (Empty == "") ; (element(2,Empty) == "") ->
["<!DOCTYPE HTML PUBLIC",
"\"-//W3C//DTD HTML 3.2 Final//EN\">\n",
- "<!-- autogenerated by 'er2html2' -->\n",
+ "<!-- autogenerated by 'erl2html2' -->\n",
"<html>\n",
- "<head><title>Test ", Src, "</title>\n",
+ "<head><title>Module ", Src, "</title>\n",
"<meta http-equiv=\"cache-control\" ",
"content=\"no-cache\">\n",
"</head>\n",
@@ -3618,7 +3623,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>", []),
MinorBase = filename:basename(MinorName),
print(major, "=logfile ~s", [filename:basename(MinorName)]),
print_props((RunInit==skip_init), get_props(Mode)),
@@ -3642,7 +3647,7 @@ 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>", []),
print_timestamp(minor, "Ended at "),
print(major, "=ended ~s", [lists:flatten(timestamp_get(""))]),