1 """Test that the clang modules cache directory can be controlled."""
8 from lldbsuite
.test
.decorators
import *
9 from lldbsuite
.test
.lldbtest
import *
10 from lldbsuite
.test
import lldbutil
13 class ObjCModulesTestCase(TestBase
):
14 NO_DEBUG_INFO_TESTCASE
= True
18 self
.main_source_file
= lldb
.SBFileSpec("main.m")
19 self
.runCmd("settings set target.auto-import-clang-modules true")
20 mod_cache
= self
.getBuildArtifact("my-clang-modules-cache")
21 if os
.path
.isdir(mod_cache
):
22 shutil
.rmtree(mod_cache
)
23 self
.assertFalse(os
.path
.isdir(mod_cache
), "module cache should not exist")
24 self
.runCmd('settings set symbols.clang-modules-cache-path "%s"' % mod_cache
)
26 'settings set target.clang-module-search-paths "%s"' % self
.getSourceDir()
28 (target
, process
, thread
, bkpt
) = lldbutil
.run_to_source_breakpoint(
29 self
, "Set breakpoint here", self
.main_source_file
31 self
.runCmd("expr @import Foo")
32 self
.assertTrue(os
.path
.isdir(mod_cache
), "module cache exists")