[LIT] Add support for UNSUPPORTED tag to TestRunner.parseIntegratedTestScript

Summary:
This patch gives me just enough to leverage the existing functionality in `TestRunner` for use in `libc++` and `libc++abi` .

It does the following:
* Adds the `UNSUPPORTED` tag to `TestRunner.parseIntegratedTestScript`.
* Allows `parseIntegratedTestScript` to return an empty script if a script is not required by the caller.



Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, llvm-commits

Differential Revision: http://reviews.llvm.org/D6589

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223915 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2014-12-10 03:42:09 +00:00
parent fda17198fd
commit bd11260981
2 changed files with 29 additions and 19 deletions

View File

@@ -7,6 +7,15 @@ import signal
import subprocess
import sys
def to_bytes(str):
# Encode to UTF-8 to get binary data.
return str.encode('utf-8')
def to_string(bytes):
if isinstance(bytes, str):
return bytes
return to_bytes(bytes)
def detectCPUs():
"""
Detects the number of CPUs on a system. Cribbed from pp.
@@ -156,11 +165,6 @@ def executeCommand(command, cwd=None, env=None):
if exitCode == -signal.SIGINT:
raise KeyboardInterrupt
def to_string(bytes):
if isinstance(bytes, str):
return bytes
return bytes.encode('utf-8')
# Ensure the resulting output is always of string type.
try:
out = to_string(out.decode('utf-8'))