lit: Remove support for XTARGET.

- The XTARGET feature (inherited from old DG tests) was just confusing (and
   barely ever used). The same effect can now be achieved with a combination of
   the more useful REQUIRES and XFAIL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166305 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2012-10-19 20:29:27 +00:00
parent f854597fc1
commit f793fbc569
5 changed files with 15 additions and 28 deletions

View File

@ -1,3 +0,0 @@
; RUN: true
; XFAIL: *
; XTARGET: darwin

View File

@ -77,7 +77,7 @@ for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')):
excludes = [] excludes = []
# Provide target_triple for use in XFAIL and XTARGET. # Provide target_triple for use in XFAIL.
config.target_triple = site_exp['target_triplet'] config.target_triple = site_exp['target_triplet']
# Provide llvm_supports_target for use in local configs. # Provide llvm_supports_target for use in local configs.

View File

@ -77,7 +77,7 @@ for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')):
excludes = [] excludes = []
# Provide target_triple for use in XFAIL and XTARGET. # Provide target_triple for use in XFAIL.
config.target_triple = site_exp['target_triplet'] config.target_triple = site_exp['target_triplet']
# Provide llvm_supports_target for use in local configs. # Provide llvm_supports_target for use in local configs.

View File

@ -370,32 +370,27 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
return executeCommand(command, cwd=cwd, env=test.config.environment) return executeCommand(command, cwd=cwd, env=test.config.environment)
def isExpectedFail(test, xfails, xtargets): def isExpectedFail(test, xfails):
# If the xfail matches an available feature, it always fails. # Check if any of the xfails match an available feature or the target.
for item in xfails: for item in xfails:
# If this is the wildcard, it always fails.
if item == '*':
return True
# If this is an exact match for one of the features, it fails.
if item in test.config.available_features: if item in test.config.available_features:
return True return True
# Otherwise, check if any xfail matches this target. # If this is a part of the target triple, it fails.
for item in xfails: if item in test.suite.config.target_triple:
if item == '*' or item in test.suite.config.target_triple: return True
break
else:
return False
# If so, see if it is expected to pass on this target. return False
#
# FIXME: Rename XTARGET to something that makes sense, like XPASS.
for item in xtargets:
if item == '*' or item in test.suite.config.target_triple:
return False
return True
def parseIntegratedTestScript(test, normalize_slashes=False, def parseIntegratedTestScript(test, normalize_slashes=False,
extra_substitutions=[]): extra_substitutions=[]):
"""parseIntegratedTestScript - Scan an LLVM/Clang style integrated test """parseIntegratedTestScript - Scan an LLVM/Clang style integrated test
script and extract the lines to 'RUN' as well as 'XFAIL' and 'XTARGET' script and extract the lines to 'RUN' as well as 'XFAIL' and 'REQUIRES'
information. The RUN lines also will have variable substitution performed. information. The RUN lines also will have variable substitution performed.
""" """
@ -436,7 +431,6 @@ def parseIntegratedTestScript(test, normalize_slashes=False,
# Collect the test lines from the script. # Collect the test lines from the script.
script = [] script = []
xfails = [] xfails = []
xtargets = []
requires = [] requires = []
for ln in open(sourcepath): for ln in open(sourcepath):
if 'RUN:' in ln: if 'RUN:' in ln:
@ -455,9 +449,6 @@ def parseIntegratedTestScript(test, normalize_slashes=False,
elif 'XFAIL:' in ln: elif 'XFAIL:' in ln:
items = ln[ln.index('XFAIL:') + 6:].split(',') items = ln[ln.index('XFAIL:') + 6:].split(',')
xfails.extend([s.strip() for s in items]) xfails.extend([s.strip() for s in items])
elif 'XTARGET:' in ln:
items = ln[ln.index('XTARGET:') + 8:].split(',')
xtargets.extend([s.strip() for s in items])
elif 'REQUIRES:' in ln: elif 'REQUIRES:' in ln:
items = ln[ln.index('REQUIRES:') + 9:].split(',') items = ln[ln.index('REQUIRES:') + 9:].split(',')
requires.extend([s.strip() for s in items]) requires.extend([s.strip() for s in items])
@ -496,7 +487,7 @@ def parseIntegratedTestScript(test, normalize_slashes=False,
return (Test.UNSUPPORTED, return (Test.UNSUPPORTED,
"Test requires the following features: %s" % msg) "Test requires the following features: %s" % msg)
isXFail = isExpectedFail(test, xfails, xtargets) isXFail = isExpectedFail(test, xfails)
return script,isXFail,tmpBase,execdir return script,isXFail,tmpBase,execdir
def formatTestOutput(status, out, err, exitCode, failDueToStderr, script): def formatTestOutput(status, out, err, exitCode, failDueToStderr, script):

View File

@ -79,7 +79,6 @@ syn match llvmSpecialComment /;\s*RUN:.*$/
syn match llvmSpecialComment /;\s*PR\d*\s*$/ syn match llvmSpecialComment /;\s*PR\d*\s*$/
syn match llvmSpecialComment /;\s*END\.\s*$/ syn match llvmSpecialComment /;\s*END\.\s*$/
syn match llvmSpecialComment /;\s*XFAIL:.*$/ syn match llvmSpecialComment /;\s*XFAIL:.*$/
syn match llvmSpecialComment /;\s*XTARGET:.*$/
if version >= 508 || !exists("did_c_syn_inits") if version >= 508 || !exists("did_c_syn_inits")
if version < 508 if version < 508