[llvm] [lldb][test] Mark gtest cases as XFAIL if the test is XFAIL (PR #102986)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 12 17:05:59 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-testing-tools
Author: Kendal Harland (kendalharland)
<details>
<summary>Changes</summary>
When a test case inside of a gtest suite fails, we report a failure which causes the entire `ninja check-lldb` invocation to fail, even if the outer test case is marked as XFAIL - each test case result is reported as its own lit test run. This PR make lit check whether each test case's parent test suite is XFAIL before setting the status to FAIL.
---
Full diff: https://github.com/llvm/llvm-project/pull/102986.diff
1 Files Affected:
- (modified) llvm/utils/lit/lit/formats/googletest.py (+1-1)
``````````diff
diff --git a/llvm/utils/lit/lit/formats/googletest.py b/llvm/utils/lit/lit/formats/googletest.py
index 8037094a910678..6427354107daf5 100644
--- a/llvm/utils/lit/lit/formats/googletest.py
+++ b/llvm/utils/lit/lit/formats/googletest.py
@@ -334,7 +334,7 @@ def remove_gtest(tests):
returnCode = lit.Test.SKIPPED
elif "failures" in testinfo:
has_failure_in_shard = True
- returnCode = lit.Test.FAIL
+ returnCode = lit.Test.XFAIL if test.isExpectedToFail() else lit.Test.FAIL
output = header
for fail in testinfo["failures"]:
output += fail["failure"] + "\n"
``````````
</details>
https://github.com/llvm/llvm-project/pull/102986
More information about the llvm-commits
mailing list