7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
12 class TestClangModuleAppUpdate(TestBase):
13 mydir = TestBase.compute_mydir(__file__)
16 @skipIf(debug_info=no_match(["gmodules"]))
17 def test_rebuild_app_modules_untouched(self):
18 with open(self.getBuildArtifact("module.modulemap"), "w") as f:
20 module Foo { header "f.h" }
22 with open(self.getBuildArtifact("f.h"), "w") as f:
25 @interface Foo : NSObject {
32 mod_cache = self.getBuildArtifact("private-module-cache")
34 if os.path.isdir(mod_cache):
35 shutil.rmtree(mod_cache)
37 self.assertTrue(os.path.isdir(mod_cache), "module cache exists")
39 target, process, _, bkpt = lldbutil.run_to_source_breakpoint(
40 self, "break here", lldb.SBFileSpec("main.m"))
41 bar = target.FindTypes('Bar').GetTypeAtIndex(0)
42 foo = bar.GetDirectBaseClassAtIndex(0).GetType()
43 self.assertEqual(foo.GetNumberOfFields(), 1)
44 self.assertEqual(foo.GetFieldAtIndex(0).GetName(), "i")
48 os.remove(self.getBuildArtifact('main.o'))
49 os.remove(self.getBuildArtifact('a.out'))
53 target, process, _, _ = lldbutil.run_to_breakpoint_do_run(self, target, bkpt)
54 bar = target.FindTypes('Bar').GetTypeAtIndex(0)
55 foo = bar.GetDirectBaseClassAtIndex(0).GetType()
56 self.assertEqual(foo.GetNumberOfFields(), 1)
57 self.assertEqual(foo.GetFieldAtIndex(0).GetName(), "i")