path_coverage 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +286 -199
- data/exe/path_coverage_report +4 -0
- data/lib/path_coverage/call_trace.rb +88 -0
- data/lib/path_coverage/calls.rb +49 -43
- data/lib/path_coverage/card_context.rb +104 -0
- data/lib/path_coverage/card_forks.rb +44 -0
- data/lib/path_coverage/card_gaps.rb +125 -0
- data/lib/path_coverage/card_scopes.rb +37 -0
- data/lib/path_coverage/card_tree.rb +79 -66
- data/lib/path_coverage/card_way_lists.rb +72 -0
- data/lib/path_coverage/card_ways.rb +123 -67
- data/lib/path_coverage/{html_syntax.rb → code_tokens.rb} +35 -33
- data/lib/path_coverage/condition.rb +14 -14
- data/lib/path_coverage/configuration.rb +7 -4
- data/lib/path_coverage/configuration_limits.rb +52 -0
- data/lib/path_coverage/configuration_paths.rb +7 -7
- data/lib/path_coverage/console_summary.rb +24 -22
- data/lib/path_coverage/{site.rb → decision.rb} +2 -2
- data/lib/path_coverage/decision_locations.rb +76 -0
- data/lib/path_coverage/{site_paths.rb → decision_paths.rb} +13 -11
- data/lib/path_coverage/{site_tree.rb → decision_tree.rb} +25 -16
- data/lib/path_coverage/fold_branches.rb +18 -0
- data/lib/path_coverage/fold_cells.rb +42 -0
- data/lib/path_coverage/{html_tree.rb → fold_rows.rb} +42 -71
- data/lib/path_coverage/gaps.rb +33 -15
- data/lib/path_coverage/json_reader.rb +54 -19
- data/lib/path_coverage/json_reports.rb +102 -0
- data/lib/path_coverage/json_writer.rb +27 -12
- data/lib/path_coverage/kernel.rb +56 -58
- data/lib/path_coverage/kinds/base.rb +16 -16
- data/lib/path_coverage/kinds/block.rb +16 -15
- data/lib/path_coverage/kinds/case.rb +14 -12
- data/lib/path_coverage/kinds/chain.rb +40 -11
- data/lib/path_coverage/kinds/choice.rb +4 -3
- data/lib/path_coverage/kinds/contains.rb +40 -32
- data/lib/path_coverage/kinds/safe.rb +38 -26
- data/lib/path_coverage/kinds/write.rb +6 -6
- data/lib/path_coverage/kinds.rb +2 -2
- data/lib/path_coverage/leaving.rb +44 -0
- data/lib/path_coverage/loop_forks.rb +57 -0
- data/lib/path_coverage/loop_nodes.rb +55 -0
- data/lib/path_coverage/manifest.rb +92 -58
- data/lib/path_coverage/manifest_blocks.rb +5 -26
- data/lib/path_coverage/manifest_case.rb +2 -2
- data/lib/path_coverage/manifest_chains.rb +8 -8
- data/lib/path_coverage/manifest_choices.rb +23 -20
- data/lib/path_coverage/manifest_disabled.rb +97 -0
- data/lib/path_coverage/manifest_folding.rb +43 -40
- data/lib/path_coverage/manifest_ignoring.rb +6 -6
- data/lib/path_coverage/manifest_writes.rb +11 -10
- data/lib/path_coverage/measured_by.rb +20 -0
- data/lib/path_coverage/merge.rb +7 -7
- data/lib/path_coverage/method_loops.rb +128 -0
- data/lib/path_coverage/method_statements.rb +130 -127
- data/lib/path_coverage/method_ways.rb +142 -0
- data/lib/path_coverage/paths_report.rb +16 -16
- data/lib/path_coverage/recorder.rb +57 -36
- data/lib/path_coverage/recorder_blocks.rb +17 -17
- data/lib/path_coverage/recorder_cases.rb +12 -11
- data/lib/path_coverage/recorder_chains.rb +12 -12
- data/lib/path_coverage/recorder_writes.rb +9 -9
- data/lib/path_coverage/render.rb +58 -51
- data/lib/path_coverage/result.rb +32 -31
- data/lib/path_coverage/rewriter.rb +39 -27
- data/lib/path_coverage/rewriter_nested.rb +13 -13
- data/lib/path_coverage/runs_report.rb +84 -0
- data/lib/path_coverage/source_lines.rb +16 -16
- data/lib/path_coverage/source_report.rb +100 -0
- data/lib/path_coverage/stable_leaves.rb +162 -0
- data/lib/path_coverage/statement_arms.rb +31 -30
- data/lib/path_coverage/summary.rb +4 -62
- data/lib/path_coverage/totals.rb +10 -8
- data/lib/path_coverage/version.rb +1 -1
- data/lib/path_coverage/walk.rb +106 -0
- data/lib/path_coverage/way_algebras.rb +127 -0
- data/lib/path_coverage/ways_report.rb +91 -0
- data/lib/path_coverage/ways_totals.rb +46 -0
- data/lib/path_coverage/within_methods.rb +135 -80
- metadata +33 -28
- data/lib/path_coverage/card.rb +0 -14
- data/lib/path_coverage/html/file.html +0 -33
- data/lib/path_coverage/html/index.html +0 -29
- data/lib/path_coverage/html/settings.js +0 -50
- data/lib/path_coverage/html/side.js +0 -599
- data/lib/path_coverage/html/sort.js +0 -34
- data/lib/path_coverage/html/style.css +0 -484
- data/lib/path_coverage/html/tabs.js +0 -15
- data/lib/path_coverage/html/theme.js +0 -27
- data/lib/path_coverage/html_branch.rb +0 -30
- data/lib/path_coverage/html_cards.rb +0 -88
- data/lib/path_coverage/html_cells.rb +0 -71
- data/lib/path_coverage/html_file.rb +0 -123
- data/lib/path_coverage/html_index.rb +0 -128
- data/lib/path_coverage/html_index_head.rb +0 -29
- data/lib/path_coverage/html_labels.rb +0 -16
- data/lib/path_coverage/html_methods.rb +0 -66
- data/lib/path_coverage/html_nav.rb +0 -67
- data/lib/path_coverage/html_report.rb +0 -131
- data/lib/path_coverage/html_statements.rb +0 -186
- data/lib/path_coverage/html_tabs.rb +0 -26
- data/lib/path_coverage/html_template.rb +0 -26
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: path_coverage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jon Jagger
|
|
@@ -27,48 +27,42 @@ description: Records which paths each condition and each method took, and report
|
|
|
27
27
|
the paths never taken in the terminal and as HTML.
|
|
28
28
|
executables:
|
|
29
29
|
- path_coverage_collector
|
|
30
|
+
- path_coverage_report
|
|
30
31
|
extensions: []
|
|
31
32
|
extra_rdoc_files: []
|
|
32
33
|
files:
|
|
33
34
|
- LICENSE.md
|
|
34
35
|
- README.md
|
|
35
36
|
- exe/path_coverage_collector
|
|
37
|
+
- exe/path_coverage_report
|
|
36
38
|
- lib/path_coverage.rb
|
|
37
39
|
- lib/path_coverage/auto.rb
|
|
40
|
+
- lib/path_coverage/call_trace.rb
|
|
38
41
|
- lib/path_coverage/calls.rb
|
|
39
|
-
- lib/path_coverage/
|
|
42
|
+
- lib/path_coverage/card_context.rb
|
|
43
|
+
- lib/path_coverage/card_forks.rb
|
|
44
|
+
- lib/path_coverage/card_gaps.rb
|
|
45
|
+
- lib/path_coverage/card_scopes.rb
|
|
40
46
|
- lib/path_coverage/card_tree.rb
|
|
47
|
+
- lib/path_coverage/card_way_lists.rb
|
|
41
48
|
- lib/path_coverage/card_ways.rb
|
|
49
|
+
- lib/path_coverage/code_tokens.rb
|
|
42
50
|
- lib/path_coverage/collector.rb
|
|
43
51
|
- lib/path_coverage/condition.rb
|
|
44
52
|
- lib/path_coverage/configuration.rb
|
|
53
|
+
- lib/path_coverage/configuration_limits.rb
|
|
45
54
|
- lib/path_coverage/configuration_paths.rb
|
|
46
55
|
- lib/path_coverage/console_summary.rb
|
|
56
|
+
- lib/path_coverage/decision.rb
|
|
57
|
+
- lib/path_coverage/decision_locations.rb
|
|
58
|
+
- lib/path_coverage/decision_paths.rb
|
|
59
|
+
- lib/path_coverage/decision_tree.rb
|
|
60
|
+
- lib/path_coverage/fold_branches.rb
|
|
61
|
+
- lib/path_coverage/fold_cells.rb
|
|
62
|
+
- lib/path_coverage/fold_rows.rb
|
|
47
63
|
- lib/path_coverage/gaps.rb
|
|
48
|
-
- lib/path_coverage/html/file.html
|
|
49
|
-
- lib/path_coverage/html/index.html
|
|
50
|
-
- lib/path_coverage/html/settings.js
|
|
51
|
-
- lib/path_coverage/html/side.js
|
|
52
|
-
- lib/path_coverage/html/sort.js
|
|
53
|
-
- lib/path_coverage/html/style.css
|
|
54
|
-
- lib/path_coverage/html/tabs.js
|
|
55
|
-
- lib/path_coverage/html/theme.js
|
|
56
|
-
- lib/path_coverage/html_branch.rb
|
|
57
|
-
- lib/path_coverage/html_cards.rb
|
|
58
|
-
- lib/path_coverage/html_cells.rb
|
|
59
|
-
- lib/path_coverage/html_file.rb
|
|
60
|
-
- lib/path_coverage/html_index.rb
|
|
61
|
-
- lib/path_coverage/html_index_head.rb
|
|
62
|
-
- lib/path_coverage/html_labels.rb
|
|
63
|
-
- lib/path_coverage/html_methods.rb
|
|
64
|
-
- lib/path_coverage/html_nav.rb
|
|
65
|
-
- lib/path_coverage/html_report.rb
|
|
66
|
-
- lib/path_coverage/html_statements.rb
|
|
67
|
-
- lib/path_coverage/html_syntax.rb
|
|
68
|
-
- lib/path_coverage/html_tabs.rb
|
|
69
|
-
- lib/path_coverage/html_template.rb
|
|
70
|
-
- lib/path_coverage/html_tree.rb
|
|
71
64
|
- lib/path_coverage/json_reader.rb
|
|
65
|
+
- lib/path_coverage/json_reports.rb
|
|
72
66
|
- lib/path_coverage/json_writer.rb
|
|
73
67
|
- lib/path_coverage/kernel.rb
|
|
74
68
|
- lib/path_coverage/kinds.rb
|
|
@@ -80,16 +74,23 @@ files:
|
|
|
80
74
|
- lib/path_coverage/kinds/contains.rb
|
|
81
75
|
- lib/path_coverage/kinds/safe.rb
|
|
82
76
|
- lib/path_coverage/kinds/write.rb
|
|
77
|
+
- lib/path_coverage/leaving.rb
|
|
78
|
+
- lib/path_coverage/loop_forks.rb
|
|
79
|
+
- lib/path_coverage/loop_nodes.rb
|
|
83
80
|
- lib/path_coverage/manifest.rb
|
|
84
81
|
- lib/path_coverage/manifest_blocks.rb
|
|
85
82
|
- lib/path_coverage/manifest_case.rb
|
|
86
83
|
- lib/path_coverage/manifest_chains.rb
|
|
87
84
|
- lib/path_coverage/manifest_choices.rb
|
|
85
|
+
- lib/path_coverage/manifest_disabled.rb
|
|
88
86
|
- lib/path_coverage/manifest_folding.rb
|
|
89
87
|
- lib/path_coverage/manifest_ignoring.rb
|
|
90
88
|
- lib/path_coverage/manifest_writes.rb
|
|
89
|
+
- lib/path_coverage/measured_by.rb
|
|
91
90
|
- lib/path_coverage/merge.rb
|
|
91
|
+
- lib/path_coverage/method_loops.rb
|
|
92
92
|
- lib/path_coverage/method_statements.rb
|
|
93
|
+
- lib/path_coverage/method_ways.rb
|
|
93
94
|
- lib/path_coverage/paths_report.rb
|
|
94
95
|
- lib/path_coverage/post.rb
|
|
95
96
|
- lib/path_coverage/recorder.rb
|
|
@@ -101,14 +102,18 @@ files:
|
|
|
101
102
|
- lib/path_coverage/result.rb
|
|
102
103
|
- lib/path_coverage/rewriter.rb
|
|
103
104
|
- lib/path_coverage/rewriter_nested.rb
|
|
104
|
-
- lib/path_coverage/
|
|
105
|
-
- lib/path_coverage/site_paths.rb
|
|
106
|
-
- lib/path_coverage/site_tree.rb
|
|
105
|
+
- lib/path_coverage/runs_report.rb
|
|
107
106
|
- lib/path_coverage/source_lines.rb
|
|
107
|
+
- lib/path_coverage/source_report.rb
|
|
108
|
+
- lib/path_coverage/stable_leaves.rb
|
|
108
109
|
- lib/path_coverage/statement_arms.rb
|
|
109
110
|
- lib/path_coverage/summary.rb
|
|
110
111
|
- lib/path_coverage/totals.rb
|
|
111
112
|
- lib/path_coverage/version.rb
|
|
113
|
+
- lib/path_coverage/walk.rb
|
|
114
|
+
- lib/path_coverage/way_algebras.rb
|
|
115
|
+
- lib/path_coverage/ways_report.rb
|
|
116
|
+
- lib/path_coverage/ways_totals.rb
|
|
112
117
|
- lib/path_coverage/within_methods.rb
|
|
113
118
|
homepage: https://github.com/path-coverage/ruby
|
|
114
119
|
licenses:
|
data/lib/path_coverage/card.rb
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
module PathCoverage
|
|
2
|
-
# One card of a file's page, as the page lays out the code
|
|
3
|
-
# around it: its first and last lines, its def's column, its
|
|
4
|
-
# status, gaps or covered, whether it is a top card, of sites
|
|
5
|
-
# outside every def, how many sites a top card holds, its
|
|
6
|
-
# button showing that count, nil for a method's, and its HTML.
|
|
7
|
-
Card = Data.define(:first, :last, :column, :status, :top, :sites,
|
|
8
|
-
:html) do
|
|
9
|
-
# True when line is one of the card's lines.
|
|
10
|
-
def holds?(line)
|
|
11
|
-
(first..last).cover?(line)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8"/>
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>{{path}} · Path coverage</title>
|
|
7
|
-
<style>
|
|
8
|
-
/*<![CDATA[*/
|
|
9
|
-
{{style}}
|
|
10
|
-
/*]]>*/
|
|
11
|
-
</style>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<main class="page">
|
|
15
|
-
<header class="head" data-head="">
|
|
16
|
-
<div class="top"><p class="title"><a data-index="" href="{{index}}">Path coverage</a></p><h1 class="path"><a data-row="" href="{{index}}#row-{{path}}">{{path}}</a></h1><button type="button" class="theme" aria-label="Light or dark"></button></div>
|
|
17
|
-
{{jumps}}
|
|
18
|
-
</header>
|
|
19
|
-
<div class="box">
|
|
20
|
-
<div class="rail">
|
|
21
|
-
{{rail}}
|
|
22
|
-
</div>
|
|
23
|
-
{{listing}}
|
|
24
|
-
<div class="divider" role="separator" aria-orientation="vertical" title="Drag to share the width between paths and code"></div>
|
|
25
|
-
</div>
|
|
26
|
-
</main>
|
|
27
|
-
<script>
|
|
28
|
-
//<![CDATA[
|
|
29
|
-
{{script}}
|
|
30
|
-
//]]>
|
|
31
|
-
</script>
|
|
32
|
-
</body>
|
|
33
|
-
</html>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8"/>
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>Path coverage</title>
|
|
7
|
-
<style>
|
|
8
|
-
/*<![CDATA[*/
|
|
9
|
-
{{style}}
|
|
10
|
-
/*]]>*/
|
|
11
|
-
</style>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<main class="page">
|
|
15
|
-
<header class="head" data-head="">
|
|
16
|
-
<div class="top"><h1 class="title">Path coverage</h1><button type="button" class="theme" aria-label="Light or dark"></button></div>
|
|
17
|
-
</header>
|
|
18
|
-
{{tabs}}
|
|
19
|
-
<div class="box">
|
|
20
|
-
{{tables}}
|
|
21
|
-
</div>{{ignored}}
|
|
22
|
-
</main>
|
|
23
|
-
<script>
|
|
24
|
-
//<![CDATA[
|
|
25
|
-
{{script}}
|
|
26
|
-
//]]>
|
|
27
|
-
</script>
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// The report's settings, eg its theme. Each is carried by
|
|
2
|
-
// every link to another page of the report, as ?name=, since some
|
|
3
|
-
// browsers keep nothing shared between a report's local files, and
|
|
4
|
-
// is also kept in the browser where it can be, for a page opened
|
|
5
|
-
// afresh.
|
|
6
|
-
window.pathCoverageSettings = (function () {
|
|
7
|
-
// The value of setting name the link that opened this page
|
|
8
|
-
// carried, else the one last kept, when it is one of allowed;
|
|
9
|
-
// else null.
|
|
10
|
-
function given(name, allowed) {
|
|
11
|
-
var match = new RegExp('[?&]' + name + '=([a-z]+)').exec(window.location.search);
|
|
12
|
-
if (match && allowed.indexOf(match[1]) >= 0) { return match[1]; }
|
|
13
|
-
try {
|
|
14
|
-
var kept = window.localStorage.getItem('path_coverage.' + name);
|
|
15
|
-
return allowed.indexOf(kept) >= 0 ? kept : null;
|
|
16
|
-
} catch (e) { return null; }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Keeps value as setting name's, where the browser allows it.
|
|
20
|
-
function keep(name, value) {
|
|
21
|
-
try { window.localStorage.setItem('path_coverage.' + name, value); } catch (e) { /* carried by links only */ }
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// href, a link to another page of the report, with its ?name=
|
|
25
|
-
// set to value, before any #fragment, its other ?settings kept.
|
|
26
|
-
function carrying(href, name, value) {
|
|
27
|
-
var hash = href.indexOf('#');
|
|
28
|
-
var fragment = hash < 0 ? '' : href.slice(hash);
|
|
29
|
-
var rest = hash < 0 ? href : href.slice(0, hash);
|
|
30
|
-
var query = rest.indexOf('?');
|
|
31
|
-
var page = query < 0 ? rest : rest.slice(0, query);
|
|
32
|
-
var settings = query < 0 ? [] : rest.slice(query + 1).split('&').filter(function (pair) {
|
|
33
|
-
return pair && pair.split('=')[0] !== name;
|
|
34
|
-
});
|
|
35
|
-
settings.push(name + '=' + value);
|
|
36
|
-
return page + '?' + settings.join('&') + fragment;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Makes every link to another of the report's pages carry value
|
|
40
|
-
// as setting name's.
|
|
41
|
-
function carry(name, value) {
|
|
42
|
-
document.querySelectorAll('a[href]').forEach(function (link) {
|
|
43
|
-
var href = link.getAttribute('href');
|
|
44
|
-
if (/^[a-z]+:|^#/.test(href) || !/\.html(\?|#|$)/.test(href)) { return; }
|
|
45
|
-
link.setAttribute('href', carrying(href, name, value));
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return { given: given, keep: keep, carry: carry };
|
|
50
|
-
})();
|