Commit d6e3804
committed
HPC artifacts are written and read from pkg-db
This commit re-designs the mechanism by which we make the .mix files of
libraries available to produce the Haskell Program Coverage report after
running testsuites.
The idea, for the Cabal library, is:
* Cabal builds libraries with -fhpc, and store the hpc artifacts in
build </> `extraCompilationArtifacts`
* At Cabal install time, `extraCompilationArtifacts` is copied into the
package database
* At Cabal configure time, we both
- receive as --coverage-for flags unit-ids of library components
from the same package (ultimately, when #9493 is resolved, we will
receive unit ids of libraries in other packages in the same
project too),
- and, when configuring a whole package instead of just a testsuite
component, we determine the unit-ids of libraries in the package
these unit-ids are written into `configCoverageFor` in `ConfigFlags`
* At Cabal test time, for each library to cover (stored in
`configCoverageFor`), we look in the package database for the hpc
dirs, which we eventually pass along to the `hpc markup` call as
`--hpcdir` flags
As for cabal-install:
* After a plan has been elaborated, we select the packages which can be
covered and pass them to Cabal's ./Setup configure as
--coverage-for=<unit-id> flags.
- Notably, valid libraries are non-indefinite and
non-instantiations, since HPC does not support backpack.
- Furthermore, we only include libraries in the same package as the
component being configured, despite possibly there being
more library components in other packages of the same project.
When #9493 is resolved, we could lift this restriction and pass
all libraries local to the package as --coverage-for. See
`determineCoverageFor` and `shouldCoverPkg` in Distribution.Client.ProjectPlanning.
Detail:
We no longer pass the path to the testsuite's mix dirs to `hpc
markup` because we only ever include modules in libraries, which
means they were previously unused.
Fixes #6440 (internal libs coverage), #6397 (backpack breaks coverage),
doesn't yet fix #8609 (multi-package coverage report) which is tracked
in #9493, and fixes in a new way the previously fixed #4798, #5213.1 parent 073ccc8 commit d6e3804
File tree
41 files changed
+425
-156
lines changed- Cabal-tests/tests/UnitTests/Distribution/Utils
- Cabal/src/Distribution/Simple
- GHC
- Setup
- Test
- cabal-install/src/Distribution/Client
- ProjectConfig
- cabal-testsuite/PackageTests
- Backpack/Includes2
- CustomTestCoverage
- test
- MultipleLibraries/Successful
- Project/CoverageProject
- Regression
- T4798
- T5213ExeCoverage
- T5213
- T6440
- TestSuiteTests/ExeV10
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
41 files changed
+425
-156
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | | - | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
| 169 | + | |
165 | 170 | | |
166 | 171 | | |
167 | 172 | | |
| |||
877 | 882 | | |
878 | 883 | | |
879 | 884 | | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
880 | 896 | | |
881 | 897 | | |
882 | 898 | | |
883 | | - | |
| 899 | + | |
884 | 900 | | |
885 | 901 | | |
886 | 902 | | |
| |||
1747 | 1763 | | |
1748 | 1764 | | |
1749 | 1765 | | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
1750 | 1788 | | |
1751 | 1789 | | |
1752 | 1790 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
| 305 | + | |
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
| |||
791 | 793 | | |
792 | 794 | | |
793 | 795 | | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
| 41 | + | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
399 | 398 | | |
400 | 399 | | |
401 | 400 | | |
402 | | - | |
403 | 401 | | |
404 | 402 | | |
405 | | - | |
| 403 | + | |
406 | 404 | | |
407 | 405 | | |
408 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | | - | |
100 | 98 | | |
101 | 99 | | |
102 | | - | |
| 100 | + | |
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
518 | | - | |
519 | 518 | | |
520 | 519 | | |
521 | | - | |
| 520 | + | |
522 | 521 | | |
523 | 522 | | |
524 | 523 | | |
| |||
1235 | 1234 | | |
1236 | 1235 | | |
1237 | 1236 | | |
1238 | | - | |
1239 | 1237 | | |
1240 | 1238 | | |
1241 | | - | |
| 1239 | + | |
1242 | 1240 | | |
1243 | 1241 | | |
1244 | 1242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
118 | | - | |
| 127 | + | |
119 | 128 | | |
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
125 | | - | |
| 134 | + | |
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
| |||
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
163 | | - | |
| 172 | + | |
164 | 173 | | |
165 | 174 | | |
166 | 175 | | |
167 | 176 | | |
168 | 177 | | |
169 | 178 | | |
170 | 179 | | |
171 | | - | |
172 | | - | |
| 180 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
223 | 229 | | |
224 | 230 | | |
225 | 231 | | |
| |||
288 | 294 | | |
289 | 295 | | |
290 | 296 | | |
| 297 | + | |
291 | 298 | | |
292 | 299 | | |
293 | 300 | | |
| |||
828 | 835 | | |
829 | 836 | | |
830 | 837 | | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
831 | 854 | | |
832 | 855 | | |
833 | 856 | | |
| |||
0 commit comments