summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2013-06-25 05:57:55 -0700
committerDave Smith <dizzyd@dizzyd.com>2013-06-25 05:57:55 -0700
commit4b642bf9166473a7766c9071939cc7b237fae0e4 (patch)
tree9fc4a106f77f3c4a82d1ef1c1079046f69973aef
parent00164b280aa3710027089611ebfbaa5730f0f995 (diff)
parentc79314593d0ca1a20eee3cbca4deec70b54e5d53 (diff)
Merge pull request #41 from exterm/cover_html_validity
change cover html generation to produce valid html
-rw-r--r--src/rebar_eunit.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index c997842..95ba3e8 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -561,7 +561,10 @@ 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),
@@ -579,7 +582,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"),