diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-07-03 20:41:42 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-07-03 20:41:42 +0000 |
commit | f02ec12796336cc382338f2a6a70be177397f780 (patch) | |
tree | a63b50695425fa7cb93d1b070ef20cb508a08dfd | |
parent | ba62bda99825e3d48c3c241f62bf78eb725098a1 (diff) | |
download | bcm5719-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.py | 2 | ||||
-rw-r--r-- | lldb/test/lldbtest.py | 8 |
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') |