llvm.org GIT mirror llvm / f793fbc
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 Daniel Dunbar 6 years ago
5 changed file(s) with 16 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
+0
-3
utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/bar-test.ll less more
None ; RUN: true
1 ; XFAIL: *
2 ; XTARGET: darwin
7676
7777 excludes = []
7878
79 # Provide target_triple for use in XFAIL and XTARGET.
79 # Provide target_triple for use in XFAIL.
8080 config.target_triple = site_exp['target_triplet']
8181
8282 # Provide llvm_supports_target for use in local configs.
7676
7777 excludes = []
7878
79 # Provide target_triple for use in XFAIL and XTARGET.
79 # Provide target_triple for use in XFAIL.
8080 config.target_triple = site_exp['target_triplet']
8181
8282 # Provide llvm_supports_target for use in local configs.
369369
370370 return executeCommand(command, cwd=cwd, env=test.config.environment)
371371
372 def isExpectedFail(test, xfails, xtargets):
373 # If the xfail matches an available feature, it always fails.
372 def isExpectedFail(test, xfails):
373 # Check if any of the xfails match an available feature or the target.
374374 for item in xfails:
375 # If this is the wildcard, it always fails.
376 if item == '*':
377 return True
378
379 # If this is an exact match for one of the features, it fails.
375380 if item in test.config.available_features:
376381 return True
377382
378 # Otherwise, check if any xfail matches this target.
379 for item in xfails:
380 if item == '*' or item in test.suite.config.target_triple:
381 break
382 else:
383 return False
384
385 # If so, see if it is expected to pass on this target.
386 #
387 # FIXME: Rename XTARGET to something that makes sense, like XPASS.
388 for item in xtargets:
389 if item == '*' or item in test.suite.config.target_triple:
390 return False
391
392 return True
383 # If this is a part of the target triple, it fails.
384 if item in test.suite.config.target_triple:
385 return True
386
387 return False
393388
394389 def parseIntegratedTestScript(test, normalize_slashes=False,
395390 extra_substitutions=[]):
396391 """parseIntegratedTestScript - Scan an LLVM/Clang style integrated test
397 script and extract the lines to 'RUN' as well as 'XFAIL' and 'XTARGET'
392 script and extract the lines to 'RUN' as well as 'XFAIL' and 'REQUIRES'
398393 information. The RUN lines also will have variable substitution performed.
399394 """
400395
435430 # Collect the test lines from the script.
436431 script = []
437432 xfails = []
438 xtargets = []
439433 requires = []
440434 for ln in open(sourcepath):
441435 if 'RUN:' in ln:
454448 elif 'XFAIL:' in ln:
455449 items = ln[ln.index('XFAIL:') + 6:].split(',')
456450 xfails.extend([s.strip() for s in items])
457 elif 'XTARGET:' in ln:
458 items = ln[ln.index('XTARGET:') + 8:].split(',')
459 xtargets.extend([s.strip() for s in items])
460451 elif 'REQUIRES:' in ln:
461452 items = ln[ln.index('REQUIRES:') + 9:].split(',')
462453 requires.extend([s.strip() for s in items])
495486 return (Test.UNSUPPORTED,
496487 "Test requires the following features: %s" % msg)
497488
498 isXFail = isExpectedFail(test, xfails, xtargets)
489 isXFail = isExpectedFail(test, xfails)
499490 return script,isXFail,tmpBase,execdir
500491
501492 def formatTestOutput(status, out, err, exitCode, failDueToStderr, script):
7878 syn match llvmSpecialComment /;\s*PR\d*\s*$/
7979 syn match llvmSpecialComment /;\s*END\.\s*$/
8080 syn match llvmSpecialComment /;\s*XFAIL:.*$/
81 syn match llvmSpecialComment /;\s*XTARGET:.*$/
8281
8382 if version >= 508 || !exists("did_c_syn_inits")
8483 if version < 508