summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/test/functionalities/data-formatter/stringprinter/main.cpp4
-rw-r--r--lldb/test/lldbinline.py3
-rw-r--r--lldb/test/lldbtest.py11
3 files changed, 13 insertions, 5 deletions
diff --git a/lldb/test/functionalities/data-formatter/stringprinter/main.cpp b/lldb/test/functionalities/data-formatter/stringprinter/main.cpp
index fc04ed538d6..e30e8fb37f9 100644
--- a/lldb/test/functionalities/data-formatter/stringprinter/main.cpp
+++ b/lldb/test/functionalities/data-formatter/stringprinter/main.cpp
@@ -11,13 +11,11 @@
int main (int argc, char const *argv[])
{
- std::string stdstring("Hello\t\tWorld\nI am here\t\tto say hello\n");
+ std::string stdstring("Hello\t\tWorld\nI am here\t\tto say hello\n"); //%self.addTearDownHook(lambda x: x.runCmd("setting set escape-non-printables true"))
const char* constcharstar = stdstring.c_str();
return 0; //% self.assertTrue(self.frame().FindVariable('stdstring').GetSummary() == '"Hello\\t\\tWorld\\nI am here\\t\\tto say hello\\n"')
//% self.assertTrue(self.frame().FindVariable('constcharstar').GetSummary() == '"Hello\\t\\tWorld\\nI am here\\t\\tto say hello\\n"')
//% self.runCmd("setting set escape-non-printables false")
- //% print self.frame().FindVariable('stdstring').GetSummary()
//% self.assertTrue(self.frame().FindVariable('stdstring').GetSummary() == '"Hello\t\tWorld\nI am here\t\tto say hello\n"')
//% self.assertTrue(self.frame().FindVariable('constcharstar').GetSummary() == '"Hello\t\tWorld\nI am here\t\tto say hello\n"')
- //% self.runCmd("setting set escape-non-printables true")
}
diff --git a/lldb/test/lldbinline.py b/lldb/test/lldbinline.py
index c8209f72e3a..868b695eadf 100644
--- a/lldb/test/lldbinline.py
+++ b/lldb/test/lldbinline.py
@@ -187,5 +187,6 @@ def MakeInlineTest(__file, __globals, decorators=None):
# Add the test case to the globals, and hide InlineTest
__globals.update({test_name : test})
-
+
+ return test
diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py
index c19dfc78541..318b4e02491 100644
--- a/lldb/test/lldbtest.py
+++ b/lldb/test/lldbtest.py
@@ -999,6 +999,8 @@ class Base(unittest2.TestCase):
with recording(self, traceAlways) as sbuf:
print >> sbuf, "Adding tearDown hook:", getsource_if_available(hook)
self.hooks.append(hook)
+
+ return self
def deletePexpectChild(self):
# This is for the case of directly spawning 'lldb' and interacting with it
@@ -1033,7 +1035,14 @@ class Base(unittest2.TestCase):
for hook in reversed(self.hooks):
with recording(self, traceAlways) as sbuf:
print >> sbuf, "Executing tearDown hook:", getsource_if_available(hook)
- hook()
+ import inspect
+ hook_argc = len(inspect.getargspec(hook).args)
+ if hook_argc == 0:
+ hook()
+ elif hook_argc == 1:
+ hook(self)
+ else:
+ hook() # try the plain call and hope it works
del self.hooks
OpenPOWER on IntegriCloud