[llvm] [test] Align behavior of interrupts.test on different platforms (PR #68556)
Serge Pavlov via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 25 10:05:46 PDT 2023
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/68556
>From ddf29970e62362a5e9c80f15234e724ae9e5994c 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.
---
llvm/test/Support/interrupts.test | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/llvm/test/Support/interrupts.test b/llvm/test/Support/interrupts.test
index 86730f5139c042d..5ef9df46c76febc 100644
--- a/llvm/test/Support/interrupts.test
+++ b/llvm/test/Support/interrupts.test
@@ -10,7 +10,8 @@ import sys
import time
def run_symbolizer():
- proc = subprocess.Popen([sys.argv[2]], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
+ proc = subprocess.Popen([sys.argv[2]], stdout=subprocess.PIPE,
+ stdin=subprocess.PIPE, stderr=sys.stderr)
# Write then read some output to ensure the process has started fully.
proc.stdin.write(b'foo bar\n')
proc.stdin.flush()
@@ -34,8 +35,8 @@ def run_wrapper():
startupinfo=startupinfo,
creationflags=subprocess.CREATE_NEW_CONSOLE)
else:
- proc = subprocess.Popen(args,
- stderr=subprocess.PIPE)
+ proc = subprocess.Popen(args, stderr=sys.stderr)
+ proc.wait()
if sys.argv[1] == 'wrapper':
run_wrapper()
More information about the llvm-commits
mailing list