diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-12-01 22:47:54 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-12-01 22:47:54 +0000 |
commit | 75739045d344a6c5df94a1692b9d47d9c5d05dcb (patch) | |
tree | 0798a5cc29f08ed5eeb8c116c28c5485e2be5f0e /lldb/test/dotest.py | |
parent | fc5c522864b9e96a5bf557262ebf3fb01c249a82 (diff) | |
download | bcm5719-llvm-75739045d344a6c5df94a1692b9d47d9c5d05dcb.tar.gz bcm5719-llvm-75739045d344a6c5df94a1692b9d47d9c5d05dcb.zip |
Add a '-b blacklistFile' option to the test driver to take a file specifying the
test classes or test cases to be excludued from the test suite.
Check in an example blacklist file: blacklist.py:
"""
'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 = {}
An example of invoking the test driver and specifying a blacklist file:
./dotest.py -b blacklist.py -v types
This runs the tests under 'types' directory but excludes the tests specified in
balcklist.py.
llvm-svn: 120620
Diffstat (limited to 'lldb/test/dotest.py')
-rwxr-xr-x | lldb/test/dotest.py | 26 |
1 files changed, 26 insertions, 0 deletions
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() |