test/lit.cfg: Add .xfail.pass.cpp, to expect compiling successfully and to fail to run.

This commit is contained in:
NAKAMURA Takumi
2011-04-20 16:44:23 +09:00
parent b3e839d7bc
commit 297be35c48

View File

@@ -43,6 +43,7 @@ class LibcxxTestFormat(lit.formats.FileBasedTest):
# Check what kind of test this is.
assert name.endswith('.pass.cpp') or name.endswith('.fail.cpp')
expected_compile_fail = name.endswith('.fail.cpp')
expected_run_fail = name.endswith('.xfail.pass.cpp')
# If this is a compile (failure) test, build it and check for failure.
if expected_compile_fail:
@@ -84,6 +85,11 @@ class LibcxxTestFormat(lit.formats.FileBasedTest):
cmd = [exec_path]
out, err, exitCode = self.execute_command(cmd)
if expected_run_fail:
if (exitCode != 0):
return lit.Test.XFAIL, ""
else:
return lit.Test.XPASS, ""
if exitCode != 0:
report = """Compiled With: %s\n""" % ' '.join(["'%s'" % a
for a in compile_cmd])