summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-07-03 20:41:42 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-07-03 20:41:42 +0000
commitf02ec12796336cc382338f2a6a70be177397f780 (patch)
treea63b50695425fa7cb93d1b070ef20cb508a08dfd
parentba62bda99825e3d48c3c241f62bf78eb725098a1 (diff)
downloadbcm5719-llvm-f02ec12796336cc382338f2a6a70be177397f780.tar.gz
bcm5719-llvm-f02ec12796336cc382338f2a6a70be177397f780.zip
Make it fail fast if 'mydir' attribute is not overridden by subclasses of
lldbtest.TestBase. Also removed some debug prints. llvm-svn: 107575
-rw-r--r--lldb/test/function_types/TestFunctionTypes.py2
-rw-r--r--lldb/test/lldbtest.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/lldb/test/function_types/TestFunctionTypes.py b/lldb/test/function_types/TestFunctionTypes.py
index 7f6ce273e72..79d47d2765b 100644
--- a/lldb/test/function_types/TestFunctionTypes.py
+++ b/lldb/test/function_types/TestFunctionTypes.py
@@ -14,8 +14,6 @@ class TestClassTypes(lldbtest.TestBase):
res = self.res
exe = os.path.join(os.getcwd(), "a.out")
self.ci.HandleCommand("file " + exe, res)
- print "os.getcwd(): ", os.getcwd()
- print "file a.out :", res.GetOutput()
self.assertTrue(res.Succeeded())
# Break inside the main.
diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py
index 0596757c05b..8d20fff53ef 100644
--- a/lldb/test/lldbtest.py
+++ b/lldb/test/lldbtest.py
@@ -35,9 +35,12 @@ class TestBase(unittest.TestCase):
"""This LLDB abstract base class is meant to be subclassed."""
# The concrete subclass should override this attribute.
- mydir = ""
+ mydir = None
def setUp(self):
+ # Fail fast if 'mydir' attribute is not overridden.
+ if not self.mydir or len(self.mydir) == 0:
+ raise Exception("Subclasses must override the 'mydir' attribute.")
# Save old working directory.
self.oldcwd = os.getcwd()
@@ -49,10 +52,9 @@ class TestBase(unittest.TestCase):
# Create the debugger instance if necessary.
try:
self.dbg = lldb.DBG
- except NameError:
- self.dbg = lldb.SBDebugger.Create()
except AttributeError:
self.dbg = lldb.SBDebugger.Create()
+
if not self.dbg.IsValid():
raise Exception('Invalid debugger instance')
OpenPOWER on IntegriCloud