summaryrefslogtreecommitdiffstats
path: root/lldb/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test')
-rw-r--r--lldb/test/array_types/TestArrayTypes.py14
-rw-r--r--lldb/test/class_types/TestClassTypes.py11
-rw-r--r--lldb/test/help/TestHelp.py7
3 files changed, 29 insertions, 3 deletions
diff --git a/lldb/test/array_types/TestArrayTypes.py b/lldb/test/array_types/TestArrayTypes.py
index a7cb6a705b1..f54da61bee9 100644
--- a/lldb/test/array_types/TestArrayTypes.py
+++ b/lldb/test/array_types/TestArrayTypes.py
@@ -1,6 +1,6 @@
"""Test breakpoint by file/line number; and list variables with array types."""
-import os
+import os, time
import lldb
import unittest
@@ -13,6 +13,8 @@ class TestArrayTypes(unittest.TestCase):
if ("LLDB_TEST" in os.environ):
os.chdir(os.path.join(os.environ["LLDB_TEST"], "array_types"));
self.dbg = lldb.SBDebugger.Create()
+ if not self.dbg.IsValid():
+ raise Exception('Invalid debugger instance')
self.dbg.SetAsync(False)
self.ci = self.dbg.GetCommandInterpreter()
if not self.ci:
@@ -27,24 +29,29 @@ class TestArrayTypes(unittest.TestCase):
res = lldb.SBCommandReturnObject()
exe = os.path.join(os.getcwd(), "a.out")
self.ci.HandleCommand("file " + exe, res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
# Break on line 42 inside main().
self.ci.HandleCommand("breakpoint set -f main.c -l 42", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().startswith(
"Breakpoint created: 1: file ='main.c', line = 42, locations = 1"))
self.ci.HandleCommand("run", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
# The breakpoint should have a hit count of 1.
self.ci.HandleCommand("breakpoint list", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().find('resolved, hit count = 1'))
# And the stop reason of the thread should be breakpoint.
self.ci.HandleCommand("thread list", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().find('state is Stopped') and
res.GetOutput().find('stop reason = breakpoint'))
@@ -52,6 +59,7 @@ class TestArrayTypes(unittest.TestCase):
# Issue 'variable list' command on several array-type variables.
self.ci.HandleCommand("variable list strings", res);
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
output = res.GetOutput()
self.assertTrue(output.startswith('(char *[4])') and
@@ -65,19 +73,23 @@ class TestArrayTypes(unittest.TestCase):
output.find('Guten Tag'))
self.ci.HandleCommand("variable list char_16", res);
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().find('(char) char_16[0]') and
res.GetOutput().find('(char) char_16[15]'))
self.ci.HandleCommand("variable list ushort_matrix", res);
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().startswith('(unsigned short [2][3])'))
self.ci.HandleCommand("variable list long_6", res);
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().startswith('(long [6])'))
self.ci.HandleCommand("continue", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
diff --git a/lldb/test/class_types/TestClassTypes.py b/lldb/test/class_types/TestClassTypes.py
index a02782e8479..e70bd847a4d 100644
--- a/lldb/test/class_types/TestClassTypes.py
+++ b/lldb/test/class_types/TestClassTypes.py
@@ -1,6 +1,6 @@
"""Test breakpoint on a class constructor; and variable list the this object."""
-import os
+import os, time
import lldb
import unittest
@@ -13,6 +13,8 @@ class TestClassTypes(unittest.TestCase):
if ("LLDB_TEST" in os.environ):
os.chdir(os.path.join(os.environ["LLDB_TEST"], "class_types"));
self.dbg = lldb.SBDebugger.Create()
+ if not self.dbg.IsValid():
+ raise Exception('Invalid debugger instance')
self.dbg.SetAsync(False)
self.ci = self.dbg.GetCommandInterpreter()
if not self.ci:
@@ -27,34 +29,41 @@ class TestClassTypes(unittest.TestCase):
res = lldb.SBCommandReturnObject()
exe = os.path.join(os.getcwd(), "a.out")
self.ci.HandleCommand("file " + exe, res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
# Break on the ctor function of class C.
self.ci.HandleCommand("breakpoint set -f main.cpp -l 73", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().startswith(
"Breakpoint created: 1: file ='main.cpp', line = 73, locations = 1"))
self.ci.HandleCommand("run", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
# The breakpoint should have a hit count of 1.
self.ci.HandleCommand("breakpoint list", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().find('resolved, hit count = 1'))
# And the stop reason of the thread should be breakpoint.
self.ci.HandleCommand("thread list", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().find('state is Stopped') and
res.GetOutput().find('stop reason = breakpoint'))
# We should be stopped on the ctor function of class C.
self.ci.HandleCommand("variable list this", res);
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().startswith('(class C *const) this = '))
self.ci.HandleCommand("continue", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
diff --git a/lldb/test/help/TestHelp.py b/lldb/test/help/TestHelp.py
index f2524989891..fbfdc8ca25b 100644
--- a/lldb/test/help/TestHelp.py
+++ b/lldb/test/help/TestHelp.py
@@ -1,6 +1,6 @@
"""Test lldb help command."""
-import os
+import os, time
import lldb
import unittest
@@ -13,6 +13,8 @@ class TestHelpCommand(unittest.TestCase):
if ("LLDB_TEST" in os.environ):
os.chdir(os.path.join(os.environ["LLDB_TEST"], "help"));
self.dbg = lldb.SBDebugger.Create()
+ if not self.dbg.IsValid():
+ raise Exception('Invalid debugger instance')
self.dbg.SetAsync(False)
self.ci = self.dbg.GetCommandInterpreter()
if not self.ci:
@@ -26,6 +28,7 @@ class TestHelpCommand(unittest.TestCase):
"""A simple test of 'help' command and its output."""
res = lldb.SBCommandReturnObject()
self.ci.HandleCommand("help", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().startswith(
'The following is a list of built-in, permanent debugger commands'))
@@ -34,8 +37,10 @@ class TestHelpCommand(unittest.TestCase):
"""Command 'set term-width 0' should not hang the help command."""
res = lldb.SBCommandReturnObject()
self.ci.HandleCommand("set term-width 0", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.ci.HandleCommand("help", res)
+ time.sleep(0.1)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().startswith(
'The following is a list of built-in, permanent debugger commands'))
OpenPOWER on IntegriCloud