-from lldbsuite.test import lldbinline
-from lldbsuite.test import decorators
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
-lldbinline.MakeInlineTest(
- __file__, globals(), [decorators.no_debug_info_test])
+class TestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test(self):
+ self.build()
+ lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.c"))
+
+ self.expect("statistics disable", substrs=['need to enable statistics before disabling'], error=True)
+
+ # 'expression' should change the statistics.
+ self.expect("statistics enable")
+ self.expect("statistics enable", substrs=['already enabled'], error=True)
+ self.expect("expr patatino", substrs=['27'])
+ self.expect("statistics disable")
+ self.expect("statistics dump", substrs=['expr evaluation successes : 1',
+ 'expr evaluation failures : 0'])
+
+ # 'frame var' with disabled statistics shouldn't change stats.
+ self.expect("frame var", substrs=['27'])
+
+ self.expect("statistics enable")
+ # 'frame var' with enabled statistics will change stats.
+ self.expect("frame var", substrs=['27'])
+ self.expect("statistics disable")
+ self.expect("statistics dump", substrs=['frame var successes : 1',
+ 'frame var failures : 0'])
int main(void) {
int patatino = 27;
- //%self.expect("statistics disable", substrs=['need to enable statistics before disabling'], error=True)
- //%self.expect("statistics enable")
- //%self.expect("statistics enable", substrs=['already enabled'], error=True)
- //%self.expect("expr patatino", substrs=['27'])
- //%self.expect("statistics disable")
- //%self.expect("statistics dump", substrs=['expr evaluation successes : 1', 'expr evaluation failures : 0'])
- //%self.expect("frame var", substrs=['27'])
- //%self.expect("statistics enable")
- //%self.expect("frame var", substrs=['27'])
- //%self.expect("statistics disable")
- //%self.expect("statistics dump", substrs=['frame var successes : 1', 'frame var failures : 0'])
- return 0;
+ return 0; // break here
}