Expand description
Re-exports of the symbols in this crate which are most likely to be used.
This includes:
- All assertion macros,
- Traits and type definitions normally used by tests, and
- All built-in matchers.
Typically, one imports everything in the prelude in one’s test module:
mod tests {
use googletest::prelude::*;
}
Re-exports§
pub use super::fixtures::ConsumableFixture;
pub use super::fixtures::Fixture;
pub use super::fixtures::FixtureOf;
pub use super::fixtures::StaticFixture;
pub use super::matcher::Matcher;
pub use super::matcher::MatcherBase;
pub use super::verify_current_test_outcome;
pub use super::GoogleTestSupport;
pub use super::OrFail;
pub use super::Result;
pub use super::matchers::*;
Macros§
- add_
failure - Generates a failure marking the test as failed but continue execution.
- add_
failure_ at - Generates a failure at specified location marking the test as failed but continue execution.
- assert_
pred - Asserts that the given predicate applied to the given arguments returns true, panicking if it does not.
- assert_
that - Matches the given value against the given matcher, panicking if it does not match.
- expect_
eq - Marks test as failed and continues execution if the second argument is not equal to first argument.
- expect_
false - Marks test as failed and continue execution if the expression evaluates to true.
- expect_
float_ eq - Marks test as failed and continues execution if the float given by the first argument is not approximately equal to the float given by the second argument.
- expect_
ge - Marks test as failed and continues execution if the first argument is not greater than or equal to the second argument.
- expect_
gt - Marks test as failed and continues execution if the first argument is not greater than the second argument.
- expect_
le - Marks test as failed and continues execution if the first argument is greater than the second argument.
- expect_
lt - Marks test as failed and continues execution if the first argument is greater or equal to second argument.
- expect_
ne - Marks test as failed and continues execution if the second argument is equal to first argument.
- expect_
near - Marks the test as failed and continues execution if the float given by first argument is not equal to second argument with error tolerance of max_abs_error.
- expect_
pred - Asserts that the given predicate applied to the given arguments returns true, failing the test but continuing execution if not.
- expect_
that - Matches the given value against the given matcher, marking the test as failed but continuing execution if it does not match.
- expect_
true - Marks test as failed and continue execution if the expression evaluates to false.
- fail
- Evaluates to a
Result
which contains anErr
variant with the given test failure message. - succeed
- Generates a success. This does not make the overall test succeed. A test is only considered successful if none of its assertions fail during its execution.
- verify_
eq - Checks whether the second argument is equal to the first argument.
- verify_
false - Verify if the condition evaluates to false and returns
Result
. - verify_
float_ eq - Checks whether the float given by first argument is approximately equal to second argument.
- verify_
ge - Checks whether the first argument is greater than or equal to the second argument.
- verify_
gt - Checks whether the first argument is greater than the second argument.
- verify_
le - Checks whether the first argument is less than or equal to the second argument.
- verify_
lt - Checks whether the first argument is less than second argument.
- verify_
ne - Checks whether the second argument is not equal to the first argument.
- verify_
near - Checks whether the float given by first argument is equal to second argument with error tolerance of max_abs_error.
- verify_
pred - Asserts that the given predicate applied to the given arguments returns true.
- verify_
that - Checks whether the
Matcher
given by the second argument matches the first argument. - verify_
true - Verify if the condition evaluates to true and returns
Result
.
Attribute Macros§
- gtest
- Marks a test to be run by the Google Rust test runner.