Skip to content

Commit 348b95a

Browse files
committed
Merge branch 'pmderodat/subprograms' into 'master'
subp_of_interest: fix regexp escaping See merge request eng/das/cov/gnatcoverage!326 Escape filenames before including them in regexps: on Windows, these contain backslashes, which have special interpretations. In the general case, these filenames also contain dots, which mean "any character" whereas in this context we meant "a dot". For eng/das/cov/gnatcoverage#148
2 parents 2eff1d5 + 0a8c387 commit 348b95a

File tree

1 file changed

+3
-2
lines changed
  • testsuite/tests/subp_of_interest

1 file changed

+3
-2
lines changed

testsuite/tests/subp_of_interest/test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import os
88
import os.path
9+
import re
910

1011
from SCOV.minicheck import build_and_run, check_xcov_reports
1112
from SUITE.context import thistest
@@ -151,8 +152,8 @@ def check_xcov(label, args, expected_output=""):
151152
thistest.fail_if_no_match(
152153
what="unexpected coverage output",
153154
regexp=(
154-
f".*Error when parsing --subprograms argument {pkg_body}:14:"
155-
" unknown subprogram"
155+
".*Error when parsing --subprograms argument"
156+
f" {re.escape(pkg_body)}:14: unknown subprogram"
156157
),
157158
actual=contents_of("xcov-wrong3.txt"),
158159
)

0 commit comments

Comments
 (0)