[test] Fix & re-enable CommandScriptImmediateOutputFile on Windows

Apparently the shlex module produces garbage on Windows. I've added a
hand rolled split instead that should suffice for this test.

llvm-svn: 358216
This commit is contained in:
Jonas Devlieghere 2019-04-11 19:36:53 +00:00
parent 586fad50ac
commit bb6e3f6be7
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,3 @@
# UNSUPPORTED: system-windows
# Test that LLDB correctly allows scripted commands to set immediate output to
# a file.

View File

@ -1,16 +1,19 @@
from __future__ import print_function
import sys
import shlex
def split(command):
command = command.strip()
return command.rsplit(' ', 1)
def command_function(debugger, command, exe_ctx, result, internal_dict):
result.SetImmediateOutputFile(sys.__stdout__)
print('this is a test string, just a test string', file=result)
def write_file(debugger, command, exe_ctx, result, internal_dict):
args = shlex.split(command)
args = split(command)
path = args[0]
mode = args[1]
with open(path, mode) as f: