[lit] Allow more file extensions for test cases.

This commit splits the file extensions before determining the test
format.  This allows libc++abi to add assembly-based test cases.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Logan Chien 2016-10-03 16:00:22 +00:00
parent 83050e50f7
commit 8fe453ab55

View File

@ -65,9 +65,11 @@ class LibcxxTestFormat(object):
def _execute(self, test, lit_config):
name = test.path_in_suite[-1]
is_sh_test = name.endswith('.sh.cpp')
name_root, name_ext = os.path.splitext(name)
is_sh_test = name_root.endswith('.sh')
is_pass_test = name.endswith('.pass.cpp')
is_fail_test = name.endswith('.fail.cpp')
assert is_sh_test or name_ext == '.cpp', 'non-cpp file must be sh test'
if test.config.unsupported:
return (lit.Test.UNSUPPORTED,