summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/dotest.py
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2016-09-23 21:32:47 +0000
committerFrancis Ricci <francisjricci@gmail.com>2016-09-23 21:32:47 +0000
commit6951707943c771422c4e22ee8b7cd653642272ce (patch)
treeecf078549a7a0299badf57741d893e8822026990 /lldb/packages/Python/lldbsuite/test/dotest.py
parent497ef1772f24b1c137ce8936ef9e0875aff4dc72 (diff)
downloadbcm5719-llvm-6951707943c771422c4e22ee8b7cd653642272ce.tar.gz
bcm5719-llvm-6951707943c771422c4e22ee8b7cd653642272ce.zip
Allow for tests to be disabled at runtime
Summary: The current implementation of the test suite allows the user to run a certain subset of tests using '-p', but does not allow the inverse, where a user wants to run all but some number of known failing tests. Implement this functionality. Reviewers: labath, zturner, tfiala Subscribers: jingham, sas, lldb-commits Differential Revision: https://reviews.llvm.org/D24629 llvm-svn: 282298
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/dotest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py52
1 files changed, 51 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 7075f2a812f..a37fff5ff1d 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -26,6 +26,7 @@ import atexit
import os
import errno
import platform
+import re
import signal
import socket
import subprocess
@@ -202,6 +203,48 @@ o GDB_REMOTE_LOG: if defined, specifies the log file pathname for the
sys.exit(0)
+def parseExclusion(exclusion_file):
+ """Parse an exclusion file, of the following format, where
+ 'skip files', 'skip methods', 'xfail files', and 'xfail methods'
+ are the possible list heading values:
+
+ skip files
+ <file name>
+ <file name>
+
+ xfail methods
+ <method name>
+ """
+ excl_type = None
+ case_type = None
+
+ with open(exclusion_file) as f:
+ for line in f:
+ if not excl_type:
+ [excl_type, case_type] = line.split()
+ continue
+
+ line = line.strip()
+ if not line:
+ excl_type = None
+ elif excl_type == 'skip' and case_type == 'files':
+ if not configuration.skip_files:
+ configuration.skip_files = []
+ configuration.skip_files.append(line)
+ elif excl_type == 'skip' and case_type == 'methods':
+ if not configuration.skip_methods:
+ configuration.skip_methods = []
+ configuration.skip_methods.append(line)
+ elif excl_type == 'xfail' and case_type == 'files':
+ if not configuration.xfail_files:
+ configuration.xfail_files = []
+ configuration.xfail_files.append(line)
+ elif excl_type == 'xfail' and case_type == 'methods':
+ if not configuration.xfail_methods:
+ configuration.xfail_methods = []
+ configuration.xfail_methods.append(line)
+
+
def parseOptionsAndInitTestdirs():
"""Initialize the list of directories containing our unittest scripts.
@@ -331,6 +374,9 @@ def parseOptionsAndInitTestdirs():
if args.executable:
lldbtest_config.lldbExec = os.path.realpath(args.executable)
+ if args.excluded:
+ parseExclusion(args.excluded)
+
if args.p:
if args.p.startswith('-'):
usage(parser)
@@ -749,11 +795,15 @@ def setupSysPath():
def visit_file(dir, name):
# Try to match the regexp pattern, if specified.
if configuration.regexp:
- import re
if not re.search(configuration.regexp, name):
# We didn't match the regex, we're done.
return
+ if configuration.skip_files:
+ for file_regexp in configuration.skip_files:
+ if re.search(file_regexp, name):
+ return
+
# We found a match for our test. Add it to the suite.
# Update the sys.path first.
OpenPOWER on IntegriCloud