|
iceoryx2
C++ Language Bindings
|
Namespaces | |
| namespace | detail |
Classes | |
| class | ErrorHandlerSetup |
| This class hooks into gTest to automatically resets the error handler on the start of a test. More... | |
| class | LogPrinter |
| This class hooks into gTest to automatically clear the log messages on the start of a test an print the cached log messages from failed tests. More... | |
| class | TestingErrorHandler |
| Defines the test reaction of dynamic error handling. More... | |
| class | TestingLogger |
| This logger is used for tests. It caches all the log messages and prints them to the console when a test fails. For debug purposes this behaviour can be overwritten with the 'IOX2_TESTING_ALLOW_LOG' environment variable, e.g. 'IOX2_TESTING_ALLOW_LOG=ON ./hoofs_moduletests –gtest_filter=SharedMemoryObject_Test*'. Furthermore, it can also be used to check for the occurrence on specific log messages, e.g. when a function is expected to log an error. More... | |
Typedefs | |
| using | ErrorHandler = legacy::StaticLifetimeGuard< TestingErrorHandler > |
Functions | |
| template<typename ErrorType , std::enable_if_t<!std::is_same< ErrorType, legacy::er::FatalKind >::value &&!std::is_same< ErrorType, legacy::er::EnforceViolationKind >::value &&!std::is_same< ErrorType, legacy::er::AssertViolationKind >::value, bool > = true> | |
| auto | expect_fatal_failure (const bb::StaticFunction< void()> &test_function, const ErrorType expected_error) -> bool |
| This function is used in cases a fatal failure is expected. The function only works in combination with the iceoryx error handler. It is not recommended to use this function directly but the IOX2_TESTING_EXPECT_FATAL_FAILURE macro instead. | |
| auto | expect_no_fatal_failure (const bb::StaticFunction< void()> &test_function) -> bool |
| This function is used in cases no fatal failure is expected but could potentially occur. The function only works in combination with the iceoryx error handler. It is not recommended to use this function directly but the IOX2_TESTING_EXPECT_NO_FATAL_FAILURE macro instead. | |
| template<typename Code > | |
| auto | has_error (Code &&code) -> bool |
| indicates whether the test error handler registered a specific error | |
| auto | has_panicked () -> bool |
| indicates whether the test error handler invoked panic | |
| auto | has_error () -> bool |
| indicates whether the test error handler registered any error | |
| auto | has_enforce_violation () -> bool |
| indicates whether the test error handler registered an enforce violation | |
| auto | has_assert_violation () -> bool |
| indicates whether the test error handler registered an assert violation | |
| auto | has_violation () -> bool |
| indicates whether the test error handler registered violation (there are only two kinds). | |
| auto | is_in_normal_state () -> bool |
| indicates there is no error, violation or panic. | |
| auto | run_in_test_thread (const bb::StaticFunction< void()> test_function) -> void |
| runs test_function in a test context that can detect fatal failures; runs in a separate thread | |
Definition at line 198 of file testing_error_handler.hpp.
|
inline |
This function is used in cases a fatal failure is expected. The function only works in combination with the iceoryx error handler. It is not recommended to use this function directly but the IOX2_TESTING_EXPECT_FATAL_FAILURE macro instead.
in] ErrorType The error type which is expected, e.g. 'iox2::legacy::HoofsError'
| [in] | test_function | This function will be executed as SUT and is expected to call the error handler |
| [in] | expected_error | The error value which triggered the fatal failure |
Definition at line 48 of file fatal_failure.hpp.
References iox2::Error, has_error(), has_panicked(), iox2::legacy::StaticLifetimeGuard< T >::instance(), IOX2_LOG, IOX2_TESTING_EXPECT_PANIC, and run_in_test_thread().
|
inline |
This function is used in cases no fatal failure is expected but could potentially occur. The function only works in combination with the iceoryx error handler. It is not recommended to use this function directly but the IOX2_TESTING_EXPECT_NO_FATAL_FAILURE macro instead.
| [in] | test_function | This function will be executed as SUT and is not expected to call the error handler |
Definition at line 128 of file fatal_failure.hpp.
References has_panicked(), and run_in_test_thread().
|
inline |
indicates whether the test error handler registered an assert violation
Definition at line 53 of file testing_support.hpp.
References iox2::legacy::er::ASSERT_VIOLATION, iox2::legacy::er::Violation::code(), and iox2::legacy::StaticLifetimeGuard< T >::instance().
Referenced by has_violation().
|
inline |
indicates whether the test error handler registered an enforce violation
Definition at line 47 of file testing_support.hpp.
References iox2::legacy::er::Violation::code(), iox2::legacy::er::ENFORCE_VIOLATION, and iox2::legacy::StaticLifetimeGuard< T >::instance().
Referenced by has_violation().
|
inline |
indicates whether the test error handler registered any error
Definition at line 42 of file testing_support.hpp.
References iox2::legacy::StaticLifetimeGuard< T >::instance().
Referenced by expect_fatal_failure(), and is_in_normal_state().
|
inline |
indicates whether the test error handler registered a specific error
Definition at line 31 of file testing_support.hpp.
References iox2::bb::err(), iox2::legacy::StaticLifetimeGuard< T >::instance(), and iox2::legacy::er::toError().
|
inline |
indicates whether the test error handler invoked panic
Definition at line 37 of file testing_support.hpp.
References iox2::legacy::StaticLifetimeGuard< T >::instance().
Referenced by expect_fatal_failure(), expect_no_fatal_failure(), and is_in_normal_state().
|
inline |
indicates whether the test error handler registered violation (there are only two kinds).
Definition at line 59 of file testing_support.hpp.
References has_assert_violation(), and has_enforce_violation().
Referenced by is_in_normal_state().
|
inline |
indicates there is no error, violation or panic.
Definition at line 64 of file testing_support.hpp.
References has_error(), has_panicked(), and has_violation().
|
inline |
runs test_function in a test context that can detect fatal failures; runs in a separate thread
Definition at line 71 of file testing_support.hpp.
References iox2::legacy::StaticLifetimeGuard< T >::instance().
Referenced by expect_fatal_failure(), and expect_no_fatal_failure().