self.build()
exe = self.getBuildArtifact("a.out")
- module_cache = self.getBuildArtifact("module.cache")
# Pass CRASH so the process will crash and stop in batch mode.
extra_args = ['-b',
- '-o', "settings set symbols.clang-modules-cache-path '%s'"%module_cache,
'-o', 'break set -n main',
'-o', 'run',
'-o', 'continue',
self.build()
exe = self.getBuildArtifact("a.out")
- module_cache = self.getBuildArtifact("module.cache")
# Now do it again, and make sure if we don't crash, we quit:
extra_args = ['-b',
- '-o', "settings set symbols.clang-modules-cache-path '%s'"%module_cache,
'-o', 'break set -n main',
'-o', 'run',
'-o', 'continue',
self.setTearDownCleanup()
exe = self.getBuildArtifact("a.out")
- module_cache = self.getBuildArtifact("module.cache")
# Start up the process by hand, attach to it, and wait for its completion.
# Attach is funny, since it looks like it stops with a signal on most Unixen so
extra_args = [
'-b',
- '-o', "settings set symbols.clang-modules-cache-path '%s'"%module_cache,
'-o', 'process attach -p %d'%victim_pid,
'-o', "breakpoint set --file '%s' -p 'Stop here to unset keep_waiting' -N keep_waiting"%self.source,
'-o', 'continue',
"""Return absolute path to a file in the test's source directory."""
return os.path.join(self.getSourceDir(), name)
- @staticmethod
- def setUpCommands():
- return [
+ @classmethod
+ def setUpCommands(cls):
+ commands = [
# Disable Spotlight lookup. The testsuite creates
# different binaries with the same UUID, because they only
# differ in the debug info, which is not being hashed.
"settings set symbols.enable-external-lookup false",
# Testsuite runs in parallel and the host can have also other load.
- "settings set plugin.process.gdb-remote.packet-timeout 60"]
+ "settings set plugin.process.gdb-remote.packet-timeout 60",
+
+ 'settings set symbols.clang-modules-cache-path "{}"'.format(
+ configuration.module_cache_dir),
+ "settings set use-color false",
+ ]
+ # Make sure that a sanitizer LLDB's environment doesn't get passed on.
+ if cls.platformContext and cls.platformContext.shlib_environment_var in os.environ:
+ commands.append('settings set target.env-vars {}='.format(
+ cls.platformContext.shlib_environment_var))
+
+ # Set environment variables for the inferior.
+ if lldbtest_config.inferior_env:
+ commands.append('settings set target.env-vars {}'.format(
+ lldbtest_config.inferior_env))
+ return commands
def setUp(self):
"""Fixture for unittest test case setup.
# decorators.
Base.setUp(self)
- # Set the clang modules cache path used by LLDB.
- self.runCmd(
- 'settings set symbols.clang-modules-cache-path "{}"'.format(
- configuration.module_cache_dir))
-
for s in self.setUpCommands():
self.runCmd(s)
- # Disable color.
- self.runCmd("settings set use-color false")
-
- # Make sure that a sanitizer LLDB's environment doesn't get passed on.
- if 'DYLD_LIBRARY_PATH' in os.environ:
- self.runCmd('settings set target.env-vars DYLD_LIBRARY_PATH=')
-
- # Set environment variables for the inferior.
- if lldbtest_config.inferior_env:
- self.runCmd('settings set target.env-vars {}'.format(lldbtest_config.inferior_env))
-
if "LLDB_MAX_LAUNCH_COUNT" in os.environ:
self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"])