From: Matthew Fernandez Date: Sun, 27 Mar 2022 18:20:16 +0000 (-0700) Subject: tests: when squashing macOS 'XType' warnings, also swallow trailing '\n' X-Git-Tag: 4.0.0~150^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c040ff20168f72b36496289a8106b3e33eb071ec;p=graphviz tests: when squashing macOS 'XType' warnings, also swallow trailing '\n' Enabling Smyrna on macOS fails the test `test_tools` because running `smyrna -?` outputs some XType warnings prior to the usage text. Suppressing these with `remove_xtype_warnings` still does not fix the issue because the seen text now begins “\n\nusage:…”. This change makes `remove_xtype_warnings` act more precisely and strip the end of line character that is part of the warning as well. Gitlab: related to #1836, #1854 --- diff --git a/rtest/gvtest.py b/rtest/gvtest.py index a030c507e..ed44a872d 100644 --- a/rtest/gvtest.py +++ b/rtest/gvtest.py @@ -128,7 +128,7 @@ def remove_xtype_warnings(s: str) -> str: if platform.system() != "Darwin": return s - return re.sub(r"^.* XType: .*\.$", "", s, flags=re.MULTILINE) + return re.sub(r"^.* XType: .*\.$\n", "", s, flags=re.MULTILINE) def run_c(src: Path, args: List[str] = None, input: str = "", cflags: List[str] = None, link: List[str] = None