summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Mueller <mail@philip.in-aachen.net>2012-12-12 12:38:39 +0100
committerPhilip Mueller <mail@philip.in-aachen.net>2012-12-12 12:38:39 +0100
commit4ae4a80219ba6d9404e8fd4666c45f77f3da9dd9 (patch)
treee73bc812e409389ddf00ec045fde4c312b70ecae
parent71c717d86bd92cce0111cb7c4975039784f74a71 (diff)
change cover html generation to produce valid html
- added missing doctype - added encoding statement - removed invalid additional opening <body> tag
-rw-r--r--src/rebar_eunit.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index b82da0f..c674ad9 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -524,7 +524,9 @@ align_notcovered_count(Module, Covered, NotCovered, true) ->
cover_write_index(Coverage, SrcModules) ->
{ok, F} = file:open(filename:join([?EUNIT_DIR, "index.html"]), [write]),
- ok = file:write(F, "<html><head><title>Coverage Summary</title></head>\n"),
+ ok = file:write(F, "<!DOCTYPE HTML><html>\n" ++
+ "<head><meta charset=\"utf-8\"><title>Coverage Summary</title></head>\n" ++
+ "<body>\n"),
IsSrcCoverage = fun({Mod,_C,_N}) -> lists:member(Mod, SrcModules) end,
{SrcCoverage, TestCoverage} = lists:partition(IsSrcCoverage, Coverage),
cover_write_index_section(F, "Source", SrcCoverage),
@@ -542,7 +544,7 @@ cover_write_index_section(F, SectionName, Coverage) ->
TotalCoverage = percentage(Covered, NotCovered),
%% Write the report
- ok = file:write(F, ?FMT("<body><h1>~s Summary</h1>\n", [SectionName])),
+ ok = file:write(F, ?FMT("<h1>~s Summary</h1>\n", [SectionName])),
ok = file:write(F, ?FMT("<h3>Total: ~s</h3>\n", [TotalCoverage])),
ok = file:write(F, "<table><tr><th>Module</th><th>Coverage %</th></tr>\n"),