From c040ff20168f72b36496289a8106b3e33eb071ec Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 27 Mar 2022 11:20:16 -0700 Subject: [PATCH] tests: when squashing macOS 'XType' warnings, also swallow trailing '\n' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- rtest/gvtest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.40.0