Test calling an expression with errors that a FixIt can fix.
"""
-
-
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
mydir = TestBase.compute_mydir(__file__)
- def setUp(self):
- # Call super's setUp().
- TestBase.setUp(self)
-
- self.main_source = "main.cpp"
- self.main_source_spec = lldb.SBFileSpec(self.main_source)
-
- @skipUnlessDarwin
- def test_with_target(self):
- """Test calling expressions with errors that can be fixed by the FixIts."""
- self.build()
- self.try_expressions()
-
def test_with_dummy_target(self):
"""Test calling expressions in the dummy target with errors that can be fixed by the FixIts."""
self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "The expression was successful.")
self.assertTrue("Fix-it applied" in ret_val.GetError(), "Found the applied FixIt.")
- def try_expressions(self):
+ @skipUnlessDarwin
+ def test_with_target(self):
"""Test calling expressions with errors that can be fixed by the FixIts."""
+ self.build()
(target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
- 'Stop here to evaluate expressions', self.main_source_spec)
+ 'Stop here to evaluate expressions',
+ lldb.SBFileSpec("main.cpp"))
options = lldb.SBExpressionOptions()
options.SetAutoApplyFixIts(True)