|
1 | 1 | """
|
2 |
| -Check that we properly instrument expression functions that are primitives |
3 |
| -of tagged types for MC/DC. |
| 2 | +Check that gnatcov correctly processes expression functions that are primitives |
| 3 | +of tagged types for MC/DC, e.g. it warns about them, and they are reported as |
| 4 | +uninstrumented in the coverage report. |
4 | 5 | """
|
5 | 6 |
|
6 |
| -import os |
7 |
| -import os.path |
8 |
| - |
9 | 7 | from SCOV.minicheck import build_run_and_coverage, check_xcov_reports
|
10 | 8 | from SUITE.context import thistest
|
11 | 9 | from SUITE.cutils import Wdir
|
12 | 10 | from SUITE.gprutils import GPRswitches
|
| 11 | +from SUITE.tutils import gprfor |
13 | 12 |
|
14 | 13 |
|
15 |
| -p_gpr = os.path.abspath("p.gpr") |
16 |
| -obj_dir = os.path.abspath("obj") |
17 |
| - |
18 | 14 | tmp = Wdir("tmp_")
|
19 | 15 |
|
20 | 16 | build_run_and_coverage(
|
21 |
| - gprsw=GPRswitches(root_project=p_gpr), |
| 17 | + gprsw=GPRswitches(root_project=gprfor(srcdirs=[".."], mains=["main.adb"])), |
22 | 18 | covlevel="stmt+uc_mcdc",
|
23 | 19 | mains=["main"],
|
24 | 20 | extra_coverage_args=["-axcov", "--output-dir=xcov"],
|
25 |
| - gpr_obj_dir=obj_dir, |
26 |
| - gpr_exe_dir=obj_dir, |
27 | 21 | trace_mode="src",
|
| 22 | + tolerate_instrument_messages=( |
| 23 | + "cannot instrument an expression function which" |
| 24 | + ), |
28 | 25 | )
|
29 | 26 |
|
30 |
| -# TODO: update coverage expectations once compiler bug |
31 |
| -# has been fixed and XFAIL is removed. |
32 |
| - |
33 | 27 | check_xcov_reports(
|
34 |
| - "xcov", {"main.adb.xcov": {"+": {4, 5, 7, 12, 14, 17, 19, 21, 22, 23, 24}}} |
| 28 | + "xcov", |
| 29 | + { |
| 30 | + "main.adb.xcov": {"+": {6}}, |
| 31 | + "pak.ads.xcov": { |
| 32 | + "+": {4, 5, 6, 13, 14, 15}, |
| 33 | + "-": {8, 10}, |
| 34 | + "?": {11, 16}, |
| 35 | + }, |
| 36 | + }, |
35 | 37 | )
|
36 | 38 |
|
37 | 39 | thistest.result()
|
0 commit comments