Skip to content

Conversation

@hovinen
Copy link
Contributor

@hovinen hovinen commented Jul 7, 2023

Previously the function generated by the #[googletest] macro would be (). This resulted in a Clippy warning that () did not implement std::errror::Error. It would also result in a slightly confusing test failure output:

...test assertion failure output...

Error: ()

The new empty struct TestFailure implements std::error::Error and displays to a more helpful message referring to the test assertion failure output above.

hovinen added 2 commits July 7, 2023 17:50
…output even if there are preceding non-fatal errors in the test.

There was a bug in which, if a test had a mix of fatal and non-fatal assertions, and a non-fatal assertion failed, then the test assertion failure message of a subsequent fatal assertion failure would not be output. This did not affect the overall test result but would be confusing and misleading by not including all failure messages. This change fixes the bug and introduces an integration test to protect against it.
…unction of `#[googletest]` tests.

Previously the function generated by the `#[googletest]` macro would be `()`. This resulted in a Clippy warning that `()` did not implement `std::errror::Error`. It would also result in a slightly confusing test failure output:

```
...test assertion failure output...

Error: ()
```

The new empty struct `TestFailure` implements `std::error::Error` and displays to a more helpful message referring to the test assertion failure output above.
@copybara-service copybara-service bot merged commit a7de523 into main Jul 7, 2023
@gribozavr gribozavr deleted the replace-test-return-type branch February 17, 2025 18:29
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