[Lldb-commits] [lldb] r358216 - [test] Fix & re-enable CommandScriptImmediateOutputFile on Windows

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 11 12:36:53 PDT 2019


Author: jdevlieghere
Date: Thu Apr 11 12:36:53 2019
New Revision: 358216

URL: http://llvm.org/viewvc/llvm-project?rev=358216&view=rev
Log:
[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.

Modified:
    lldb/trunk/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test
    lldb/trunk/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py

Modified: lldb/trunk/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test?rev=358216&r1=358215&r2=358216&view=diff
==============================================================================
--- lldb/trunk/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test (original)
+++ lldb/trunk/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test Thu Apr 11 12:36:53 2019
@@ -1,5 +1,3 @@
-# UNSUPPORTED: system-windows
-
 # Test that LLDB correctly allows scripted commands to set immediate output to
 # a file.
 

Modified: lldb/trunk/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py?rev=358216&r1=358215&r2=358216&view=diff
==============================================================================
--- lldb/trunk/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py (original)
+++ lldb/trunk/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py Thu Apr 11 12:36:53 2019
@@ -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:




More information about the lldb-commits mailing list