[llvm] [lldb][test] Mark gtest cases as XFAIL if the test suite is XFAIL (PR #102986)
Kendal Harland via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 12 17:13:09 PDT 2024
https://github.com/kendalharland updated https://github.com/llvm/llvm-project/pull/102986
>From efbdcbc0a7aa3bea1e595e23e9d43e6dae78438c Mon Sep 17 00:00:00 2001
From: kendal <kendal at thebrowser.company>
Date: Mon, 12 Aug 2024 16:55:12 -0700
Subject: [PATCH] [lldb][test] Mark gtest cases as XFAIL if the test suite is
XFAIL
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. This change makes lit check
whether each test case's parent test suite is XFAIL before setting the
status to FAIL.
---
llvm/utils/lit/lit/formats/googletest.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/llvm/utils/lit/lit/formats/googletest.py b/llvm/utils/lit/lit/formats/googletest.py
index 8037094a910678..6c29cca891581f 100644
--- a/llvm/utils/lit/lit/formats/googletest.py
+++ b/llvm/utils/lit/lit/formats/googletest.py
@@ -334,7 +334,11 @@ 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"
More information about the llvm-commits
mailing list