summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py10
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py2
3 files changed, 12 insertions, 3 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py b/lldb/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
index 9346bb0ba85..3131000be42 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
@@ -192,10 +192,16 @@ class ProcessLaunchTestCase(TestBase):
process = target.LaunchSimple(None, ['EVIL=' + evil_var], self.get_process_working_directory())
self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
- out = process.GetSTDOUT(len(evil_var))[:len(evil_var)]
+ out = process.GetSTDOUT(len(evil_var))
+ self.assertIsNotNone(out, "Encountered an error reading the process's output")
+
+ out = out[:len(evil_var)]
if out != evil_var:
self.fail('The environment variable was mis-coded: %s\n' % repr(out))
- newline = process.GetSTDOUT(1)[0]
+ newline = process.GetSTDOUT(1)
+ self.assertIsNotNone(newline, "Encountered an error reading the process's output")
+
+ newline = newline[0]
if newline != '\r' and newline != '\n':
self.fail('Garbage at end of environment variable')
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
index c632ef5fdad..1553a43e1a7 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
@@ -32,6 +32,7 @@ class CppVirtualMadness(TestBase):
self.line = line_number(self.source, '// Set first breakpoint here.')
@expectedFailureIcc('llvm.org/pr16808') # lldb does not call the correct virtual function with icc
+ @expectedFailureAll(oslist=['windows'])
def test_virtual_madness(self):
"""Test that expression works correctly with virtual inheritance as well as virtual function."""
self.build()
@@ -60,6 +61,8 @@ class CppVirtualMadness(TestBase):
# series of printf statements.
stdout = process.GetSTDOUT(1024)
+ self.assertIsNotNone(stdout, "Encountered an error reading the process's output")
+
# This golden list contains a list of "my_expr = 'value' pairs extracted
# from the golden output.
gl = []
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 4cda90385b1..ca3616ad5b4 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -388,7 +388,7 @@ def system(commands, **kwargs):
raise ValueError('stdout argument not allowed, it will be overridden.')
if 'shell' in kwargs and kwargs['shell']==False:
raise ValueError('shell=False not allowed')
- process = Popen(shellCommand, stdout=PIPE, stderr=PIPE, shell=True, **kwargs)
+ process = Popen(shellCommand, stdout=PIPE, stderr=PIPE, shell=True, universal_newlines=True, **kwargs)
pid = process.pid
this_output, this_error = process.communicate()
retcode = process.poll()
OpenPOWER on IntegriCloud