Skip to content

Commit 01ec5e4

Browse files
committed
Fix expr_func/prim test
Update the coverage expectations. Also adapt the test case as gnatcov no longer instrument primitives of a tagged type T when the return type is T.
1 parent 740aece commit 01ec5e4

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

testsuite/tests/instr-cov/expr_func/prim/p.gpr

Lines changed: 0 additions & 4 deletions
This file was deleted.

testsuite/tests/instr-cov/expr_func/prim/test.opt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
"""
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.
45
"""
56

6-
import os
7-
import os.path
8-
97
from SCOV.minicheck import build_run_and_coverage, check_xcov_reports
108
from SUITE.context import thistest
119
from SUITE.cutils import Wdir
1210
from SUITE.gprutils import GPRswitches
11+
from SUITE.tutils import gprfor
1312

1413

15-
p_gpr = os.path.abspath("p.gpr")
16-
obj_dir = os.path.abspath("obj")
17-
1814
tmp = Wdir("tmp_")
1915

2016
build_run_and_coverage(
21-
gprsw=GPRswitches(root_project=p_gpr),
17+
gprsw=GPRswitches(root_project=gprfor(srcdirs=[".."], mains=["main.adb"])),
2218
covlevel="stmt+uc_mcdc",
2319
mains=["main"],
2420
extra_coverage_args=["-axcov", "--output-dir=xcov"],
25-
gpr_obj_dir=obj_dir,
26-
gpr_exe_dir=obj_dir,
2721
trace_mode="src",
22+
tolerate_instrument_messages=(
23+
"cannot instrument an expression function which"
24+
),
2825
)
2926

30-
# TODO: update coverage expectations once compiler bug
31-
# has been fixed and XFAIL is removed.
32-
3327
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+
},
3537
)
3638

3739
thistest.result()

0 commit comments

Comments
 (0)