Skip to content

Cherry-pick: [lldb][test] Mark gtest cases as XFAIL if the test suite is XFAIL (#102986) #9253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kendalharland
Copy link

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 updates lit so it checks whether each test case's parent test suite is XFAIL before setting the status to FAIL.

This is especially problematic because the failing tests can't manually be marked as XFAIL, due to
llvm#102264.

Fixes llvm#102265

Repro instructions

  1. Modify any gtest test case to generate a failure.
  2. Mark the outer lit test with XFAIL using either --xfail-tests flag or LIT_XFAIL env var.
  3. Run the tests
  4. Observe the lit test is XFAIL as expected, but the failed child test cases show up as separate failures.

Co-authored-by: kendal [email protected]
(cherry picked from commit 9f89d31)

…vm#102986)

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 updates lit so it checks
whether each test case's parent test suite is XFAIL before setting the
status to FAIL.

This is especially problematic because the failing tests can't manually
be marked as XFAIL, due to
llvm#102264.

Fixes llvm#102265

### Repro instructions

1. Modify any gtest test case to generate a failure.
2. Mark the outer lit test with XFAIL using either `--xfail-tests` flag
or `LIT_XFAIL` env var.
3. Run the tests
4. Observe the lit test is XFAIL as expected, but the failed child test
cases show up as separate failures.

Co-authored-by: kendal <[email protected]>
(cherry picked from commit 9f89d31)
@compnerd
Copy link
Member

@swift-ci please test

@compnerd
Copy link
Member

@swift-ci please test llvm

@compnerd compnerd merged commit ec2c548 into swiftlang:stable/20230725 Sep 17, 2024
5 checks passed
@kendalharland
Copy link
Author

Thanks @compnerd !

@kendalharland kendalharland deleted the kendal/fix-gtest-xfail branch September 17, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants