summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'lldb')
-rwxr-xr-xlldb/test/dotest.py23
-rw-r--r--lldb/test/lldbtest.py20
2 files changed, 31 insertions, 12 deletions
diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py
index ae5d6f34d6a..011a9113ba9 100755
--- a/lldb/test/dotest.py
+++ b/lldb/test/dotest.py
@@ -128,8 +128,11 @@ fs4all = True
# Ignore the build search path relative to this script to locate the lldb.py module.
ignore = False
+# By default, we do not skip build and cleanup. Use '-S' option to override.
+skip_build_and_cleanup = False
+
# By default, we skip long running test case. Use '-l' option to override.
-skipLongRunningTest = True
+skip_long_running_test = True
# By default, we print the build dir, lldb version, and svn info. Use '-n' option to
# turn it off.
@@ -210,6 +213,11 @@ where options:
-r : specify a dir to relocate the tests and their intermediate files to;
the directory must not exist before running this test driver;
no cleanup of intermediate test files is performed in this case
+-S : skip the build and cleanup while running the test
+ use this option with care as you would need to build the inferior(s) by hand
+ and build the executable(s) with the correct name(s)
+ this can be used with '-# n' to stress test certain test cases for n number of
+ times
-s : specify the name of the dir created to store the session files of tests
with errored or failed status; if not specified, the test driver uses the
timestamp as the session dir name
@@ -337,7 +345,8 @@ def parseOptionsAndInitTestdirs():
global fs4all
global ignore
global runHooks
- global skipLongRunningTest
+ global skip_build_and_cleanup
+ global skip_long_running_test
global noHeaders
global regexp
global rdir
@@ -448,7 +457,7 @@ def parseOptionsAndInitTestdirs():
runHooks.append(sys.argv[index])
index += 1
elif sys.argv[index].startswith('-l'):
- skipLongRunningTest = False
+ skip_long_running_test = False
index += 1
elif sys.argv[index].startswith('-n'):
noHeaders = True
@@ -470,6 +479,9 @@ def parseOptionsAndInitTestdirs():
print "Relocated directory:", rdir, "must not exist!"
usage()
index += 1
+ elif sys.argv[index].startswith('-S'):
+ skip_build_and_cleanup = True
+ index += 1
elif sys.argv[index].startswith('-s'):
# Increment by 1 to fetch the session dir name.
index += 1
@@ -895,7 +907,7 @@ if delay:
#
# If '-l' is specified, do not skip the long running tests.
-if not skipLongRunningTest:
+if not skip_long_running_test:
os.environ["LLDB_SKIP_LONG_RUNNING_TEST"] = "NO"
#
@@ -927,6 +939,9 @@ lldb.dont_do_python_api_test = dont_do_python_api_test
lldb.just_do_python_api_test = just_do_python_api_test
lldb.just_do_benchmarks_test = just_do_benchmarks_test
+# Do we need to skip build and cleanup?
+lldb.skip_build_and_cleanup = skip_build_and_cleanup
+
# Put bmExecutable, bmBreakpointSpec, and bmIterationCount into the lldb namespace, too.
lldb.bmExecutable = bmExecutable
lldb.bmBreakpointSpec = bmBreakpointSpec
diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py
index aad912e4fdd..a756b19efd9 100644
--- a/lldb/test/lldbtest.py
+++ b/lldb/test/lldbtest.py
@@ -438,7 +438,7 @@ class Base(unittest2.TestCase):
Do class-wide cleanup.
"""
- if doCleanup:
+ if doCleanup and not lldb.skip_build_and_cleanup:
# First, let's do the platform-specific cleanup.
module = builder_module()
if not module.cleanup():
@@ -673,17 +673,13 @@ class Base(unittest2.TestCase):
# Perform registered teardown cleanup.
if doCleanup and self.doTearDownCleanup:
- module = builder_module()
- if not module.cleanup(self, dictionary=self.dict):
- raise Exception("Don't know how to do cleanup with dictionary: " + self.dict)
+ self.cleanup(dictionary=self.dict)
# In rare cases where there are multiple teardown cleanups added.
if doCleanup and self.doTearDownCleanups:
- module = builder_module()
if self.dicts:
for dict in reversed(self.dicts):
- if not module.cleanup(self, dictionary=dict):
- raise Exception("Don't know how to do cleanup with dictionary: " + dict)
+ self.cleanup(dictionary=dict)
# Decide whether to dump the session info.
self.dumpSessionInfo()
@@ -832,27 +828,35 @@ class Base(unittest2.TestCase):
def buildDefault(self, architecture=None, compiler=None, dictionary=None):
"""Platform specific way to build the default binaries."""
+ if lldb.skip_build_and_cleanup:
+ return
module = builder_module()
if not module.buildDefault(self, architecture, compiler, dictionary):
raise Exception("Don't know how to build default binary")
def buildDsym(self, architecture=None, compiler=None, dictionary=None):
"""Platform specific way to build binaries with dsym info."""
+ if lldb.skip_build_and_cleanup:
+ return
module = builder_module()
if not module.buildDsym(self, architecture, compiler, dictionary):
raise Exception("Don't know how to build binary with dsym")
def buildDwarf(self, architecture=None, compiler=None, dictionary=None):
"""Platform specific way to build binaries with dwarf maps."""
+ if lldb.skip_build_and_cleanup:
+ return
module = builder_module()
if not module.buildDwarf(self, architecture, compiler, dictionary):
raise Exception("Don't know how to build binary with dwarf")
def cleanup(self, dictionary=None):
"""Platform specific way to do cleanup after build."""
+ if lldb.skip_build_and_cleanup:
+ return
module = builder_module()
if not module.cleanup(self, dictionary):
- raise Exception("Don't know how to do cleanup")
+ raise Exception("Don't know how to do cleanup with dictionary: "+dictionary)
class TestBase(Base):
OpenPOWER on IntegriCloud