diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-24 22:47:31 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-24 22:47:31 -0500 |
commit | 77551200ec2fb5cd86cac23f43d883cfd4fe9bd3 (patch) | |
tree | 7196a69c54a746e32e5cbc9b938d432ed5f9b946 | |
parent | 128d48771f80efe342b99332b0ebe43f6a27daf7 (diff) | |
download | python-coveragepy-77551200ec2fb5cd86cac23f43d883cfd4fe9bd3.tar.gz |
When partial lines are hidden and run lines are shown, then partial lines are shown as run.
-rw-r--r-- | TODO.txt | 5 | ||||
-rw-r--r-- | coverage/html.py | 4 | ||||
-rw-r--r-- | coverage/htmlfiles/pyfile.html | 11 | ||||
-rw-r--r-- | coverage/htmlfiles/style.css | 18 |
4 files changed, 23 insertions, 15 deletions
@@ -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 @@ <script type='text/javascript'>
function toggle_lines(btn, cls) {
var btn = $(btn);
- if (btn.hasClass("hide")) {
- $("#source ."+cls).removeClass("hide");
- btn.removeClass("hide");
+ var hide = "hide_"+cls;
+ if (btn.hasClass(hide)) {
+ $("#source ."+cls).removeClass(hide);
+ btn.removeClass(hide);
}
else {
- $("#source ."+cls).addClass("hide");
- btn.addClass("hide");
+ $("#source ."+cls).addClass(hide);
+ btn.addClass(hide);
}
}
</script>
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; } |