Skip to content

Commit

Permalink
Merge "Make --filter work for libc++ tests."
Browse files Browse the repository at this point in the history
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Mar 4, 2017
2 parents 864a497 + ca243c5 commit ee76735
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def find_tests(self, path, name):
tests = []
for config in self.device_configurations:
tests.append(LibcxxTest(
name, path, config.abi, config.api, config.toolchain,
'libc++', path, config.abi, config.api, config.toolchain,
config.force_deprecated_headers, config.device,
config.device_api, config.skip_run))
return tests
Expand Down Expand Up @@ -1304,13 +1304,15 @@ def __init__(self, name, test_dir, abi, api, toolchain, deprecated_headers,

def run(self, out_dir, test_filters):
xunit_output = os.path.join(out_dir, 'xunit.xml')
ndk_path = os.environ['NDK']
libcxx_subpath = 'sources/cxx-stl/llvm-libc++/test'
cmd = [
'python', '../test_libcxx.py',
'--abi', self.abi,
'--platform', str(self.api),
'--xunit-xml-output=' + xunit_output,
'--timeout=600',
'--ndk=' + os.environ['NDK'],
'--ndk=' + ndk_path,

# We don't want the progress bar since we're already printing our
# own output, so we need --show-all so we get *some* output,
Expand All @@ -1326,6 +1328,19 @@ def run(self, out_dir, test_filters):
if self.skip_run:
cmd.append('--build-only')

# The libc++ test runner's filters are path based. Assemble the path to
# the test based on the late_filters (early filters for a libc++ test
# would be simply "libc++", so that's not interesting at this stage).
for late_filter in test_filters.late_filters:
filter_pattern = late_filter.pattern
if not filter_pattern.startswith('libc++.'):
continue

_, _, path = filter_pattern.partition('.')
if not os.path.isabs(path):
path = os.path.join(ndk_path, libcxx_subpath, path)
cmd.append(path)

# Ignore the exit code. We do most XFAIL processing outside the test
# runner so expected failures in the test runner will still cause a
# non-zero exit status. This "test" only fails if we encounter a Python
Expand Down

0 comments on commit ee76735

Please sign in to comment.