summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/test/blacklist.py16
-rwxr-xr-xlldb/test/dotest.py26
-rw-r--r--lldb/test/lldbtest.py7
3 files changed, 49 insertions, 0 deletions
diff --git a/lldb/test/blacklist.py b/lldb/test/blacklist.py
new file mode 100644
index 00000000000..5b16dec1449
--- /dev/null
+++ b/lldb/test/blacklist.py
@@ -0,0 +1,16 @@
+"""
+'blacklist' is a Python dictionary, it stores the mapping of a string describing
+either a testclass or a testcase, i.e, testclass.testmethod, to the reason (a
+string) it is blacklisted.
+
+Following is an example which states that test class IntegerTypesExprTestCase
+should be skipped because 'This test class crashed' and the test case
+FoundationTestCase.test_data_type_and_expr_with_dsym should be skipped because
+it is 'Temporarily disabled'.
+
+blacklist = {'IntegerTypesExprTestCase': 'This test class crashed',
+ 'FoundationTestCase.test_data_type_and_expr_with_dsym': 'Temporarily disabled'
+ }
+"""
+
+blacklist = {}
diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py
index c85e2067d5d..cc36ffccb87 100755
--- a/lldb/test/dotest.py
+++ b/lldb/test/dotest.py
@@ -45,6 +45,13 @@ class _WritelnDecorator(object):
# The test suite.
suite = unittest2.TestSuite()
+# The blacklist is optional (-b blacklistFile) and allows a central place to skip
+# testclass's and/or testclass.testmethod's.
+blacklist = None
+
+# The dictionary as a result of sourcing blacklistFile.
+blacklistConfig = {}
+
# The config file is optional.
configFile = None
@@ -103,6 +110,7 @@ def usage():
Usage: dotest.py [option] [args]
where options:
-h : print this help message and exit (also --help)
+-b : read a blacklist file specified after this option
-c : read a config file specified after this option
(see also lldb-trunk/example/test/usage-config)
-d : delay startup for 10 seconds (in order for the debugger to attach)
@@ -219,6 +227,8 @@ def parseOptionsAndInitTestdirs():
'-h/--help as the first option prints out usage info and exit the program.
"""
+ global blacklist
+ global blacklistConfig
global configFile
global count
global delay
@@ -244,6 +254,19 @@ def parseOptionsAndInitTestdirs():
if sys.argv[index].find('-h') != -1:
usage()
+ elif sys.argv[index].startswith('-b'):
+ # Increment by 1 to fetch the blacklist file name option argument.
+ index += 1
+ if index >= len(sys.argv) or sys.argv[index].startswith('-'):
+ usage()
+ blacklistFile = sys.argv[index]
+ if not os.path.isfile(blacklistFile):
+ print "Blacklist file:", blacklistFile, "does not exist!"
+ usage()
+ index += 1
+ # Now read the blacklist contents and assign it to blacklist.
+ execfile(blacklistFile, globals(), blacklistConfig)
+ blacklist = blacklistConfig.get('blacklist')
elif sys.argv[index].startswith('-c'):
# Increment by 1 to fetch the config file name option argument.
index += 1
@@ -593,6 +616,9 @@ atexit.register(lambda: lldb.SBDebugger.Terminate())
# Create a singleton SBDebugger in the lldb namespace.
lldb.DBG = lldb.SBDebugger.Create()
+# And put the blacklist in the lldb namespace, to be used by lldb.TestBase.
+lldb.blacklist = blacklist
+
# Turn on lldb loggings if necessary.
lldbLoggings()
diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py
index 639e348deb4..beabcd6690b 100644
--- a/lldb/test/lldbtest.py
+++ b/lldb/test/lldbtest.py
@@ -451,6 +451,13 @@ class TestBase(unittest2.TestCase):
#import traceback
#traceback.print_stack()
+ className = self.__class__.__name__
+ classAndMethodName = "%s.%s" % (className, self._testMethodName)
+ if className in lldb.blacklist:
+ self.skipTest(lldb.blacklist.get(className))
+ elif classAndMethodName in lldb.blacklist:
+ self.skipTest(lldb.blacklist.get(classAndMethodName))
+
if ("LLDB_WAIT_BETWEEN_TEST_CASES" in os.environ and
os.environ["LLDB_WAIT_BETWEEN_TEST_CASES"] == 'YES'):
time.sleep(1.0)
OpenPOWER on IntegriCloud