1 ## Show that SIGINT and similar signals don't cause crash messages to be
3 # RUN: %python %s wrapper llvm-symbolizer 2> %t.err
4 # RUN: FileCheck -DMSG=%errc_ENOENT --input-file=%t.err %s
6 # CHECK: {{.*}} error: 'foo': [[MSG]]
16 proc = subprocess.Popen([sys.argv[2]], stdout=subprocess.PIPE,
17 stdin=subprocess.PIPE, stderr=sys.stderr)
18 # Write then read some output to ensure the process has started fully.
19 proc.stdin.write(b'foo bar\n')
21 proc.stdout.readline()
22 # Windows handles signals differently.
24 os.kill(0, signal.CTRL_BREAK_EVENT)
26 proc.send_signal(signal.SIGINT)
28 # On Windows, this function spawns the subprocess in its own (hidden) console,
29 # so that signals do not interfere with the calling test. This isn't necessary
32 args = [sys.executable, __file__, 'symbolizer'] + sys.argv[2:]
34 startupinfo = subprocess.STARTUPINFO()
35 startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
36 subprocess.run(args, stderr=sys.stderr, startupinfo=startupinfo,
37 creationflags=subprocess.CREATE_NEW_CONSOLE)
39 subprocess.run(args, stderr=sys.stderr)
41 if sys.argv[1] == 'wrapper':