From 77551200ec2fb5cd86cac23f43d883cfd4fe9bd3 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 24 Nov 2009 22:47:31 -0500 Subject: When partial lines are hidden and run lines are shown, then partial lines are shown as run. --- TODO.txt | 5 +++-- coverage/html.py | 4 ++-- coverage/htmlfiles/pyfile.html | 11 ++++++----- coverage/htmlfiles/style.css | 18 ++++++++++++------ 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/TODO.txt b/TODO.txt index 23f4278..12cbc95 100644 --- a/TODO.txt +++ b/TODO.txt @@ -11,7 +11,7 @@ Coverage TODO - self.coverage.data.has_arcs is ugly. + Branches that never jump to nocover lines shouldn't be marked as partial. (see top of test_cogapp for examples) -- Maybe turning off yellow lines should make those lines green? ++ Maybe turning off yellow lines should make those lines green? + A missing branch to leave the function shows an annotation of -1. Now "exit". - XML report needs to get branch information. - Add branch info to "coverage debug data" @@ -29,7 +29,8 @@ x Tricky swapping of collector like figleaf, pycov, et al. (Don't need to do CodeParser.raw_parse. - If tracing, canonical_filename_cache overlaps with should_trace_cache. Skip canonical_filename_cache. Maybe it isn't even worth it... -- Would pre-allocating line number integers make the C tracer faster? +- Would pre-allocating line number integers make the C tracer faster? It would + use less memory. * Accuracy diff --git a/coverage/html.py b/coverage/html.py index fcab6f4..f8e84ac 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -68,10 +68,10 @@ class HtmlReporter(Reporter): arcs = self.arcs # These classes determine which lines are highlighted by default. - c_run = " run hide" + c_run = " run hide_run" c_exc = " exc" c_mis = " mis" - c_par = " par" + c_par = " par" + c_run lines = [] diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index ca65152..566244f 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -8,13 +8,14 @@ diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css index dd6c991..b2987ea 100644 --- a/coverage/htmlfiles/style.css +++ b/coverage/htmlfiles/style.css @@ -89,9 +89,14 @@ h2.stats { cursor: pointer; border-color: #999 #ccc #ccc #999; } -.stats span.hide { +.stats span.hide_run, .stats span.hide_exc, +.stats span.hide_mis, .stats span.hide_par, +.stats span.par.hide_run.hide_par { border-color: #ccc #999 #999 #ccc; } +.stats span.par.hide_run { + border-color: #999 #ccc #ccc #999; +} /* Source file styles */ .linenos p { @@ -100,7 +105,7 @@ h2.stats { padding: 0 .5em; color: #999999; font-family: verdana, sans-serif; - font-size: .625em; /* 10/16 */ + font-size: .625em; /* 10/16 */ line-height: 1.6em; /* 16/10 */ } td.text { @@ -117,7 +122,7 @@ td.text { background: #ffdddd; border-left: 2px solid #ff0000; } -.text p.run { +.text p.run, .text p.run.hide_par { background: #ddffdd; border-left: 2px solid #00ff00; } @@ -125,11 +130,12 @@ td.text { background: #eeeeee; border-left: 2px solid #808080; } -.text p.par { +.text p.par, .text p.par.hide_run { background: #ffffaa; border-left: 2px solid #eeee99; } -.text p.hide { +.text p.hide_run, .text p.hide_exc, .text p.hide_mis, .text p.hide_par, +.text p.hide_run.hide_par { background: inherit; } @@ -140,7 +146,7 @@ td.text { float: right; padding-right: .5em; } -.text p.hide span.annotate { +.text p.hide_par span.annotate { display: none; } -- cgit v1.2.1