[llvm] [test] Align behavior of interrupts.test on different platforms (PR #68556)

Serge Pavlov via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 8 23:04:32 PDT 2023


https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/68556

The test llvm/Support/interrupts.test behaves differently on Linux and Windows. On Linux the function 'run_wrapper' runs process with stderr connected to pipe, while on Windows stderr is mapped to stderr of the running script.

When no output was made to stderr, this difference was not observable. The new version of llvm-symbolizer (https://reviews.llvm.org/D149759) complains about missing binary file, so stderr is not empty anymore and the test fails on Windows and passes on Linux.

With this change pipes are used on all operating systems.

>From d2de891d1524b0a591a6ea14d1b6d610c22626da Mon Sep 17 00:00:00 2001
From: Serge Pavlov <sepavloff at gmail.com>
Date: Mon, 9 Oct 2023 11:23:17 +0700
Subject: [PATCH] [test] Align behavior of interrupts.test on different
 platforms

The test llvm/Support/interrupts.test behaves differently on Linux and
Windows. On Linux the function 'run_wrapper' runs process with stderr
connected to pipe, while on Windows stderr is mapped to stderr of the
running script.

When no output was made to stderr, this difference was not observable.
The new version of llvm-symbolizer (https://reviews.llvm.org/D149759)
complains about missing binary file, so stderr is not empty anymore and
the test fails on Windows and passes on Linux.

With this change pipes are used on all operating systems.
---
 llvm/test/Support/interrupts.test | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/test/Support/interrupts.test b/llvm/test/Support/interrupts.test
index 86730f5139c042d..6e5dd5ea71f9b07 100644
--- a/llvm/test/Support/interrupts.test
+++ b/llvm/test/Support/interrupts.test
@@ -30,7 +30,7 @@ def run_wrapper():
         startupinfo = subprocess.STARTUPINFO()
         startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
         proc = subprocess.Popen(args,
-                                stderr=sys.stderr,
+                                stderr=subprocess.PIPE,
                                 startupinfo=startupinfo,
                                 creationflags=subprocess.CREATE_NEW_CONSOLE)
     else:



More information about the llvm-commits mailing list