iceoryx2
C++ Bindings
Loading...
Searching...
No Matches
testing_support.hpp File Reference
#include <gtest/gtest.h>
#include "iox2/bb/static_function.hpp"
#include "iox2/bb/testing/testing_error_handler.hpp"
#include <thread>
#include <utility>

Go to the source code of this file.

Namespaces

namespace  iox2
namespace  iox2::bb
namespace  iox2::bb::testing

Macros

#define IOX2_TESTING_ASSERT_OK()
#define IOX2_TESTING_ASSERT_NO_PANIC()
#define IOX2_TESTING_ASSERT_PANIC()
#define IOX2_TESTING_ASSERT_ERROR(code)
#define IOX2_TESTING_ASSERT_NO_ERROR()
#define IOX2_TESTING_ASSERT_VIOLATION()
#define IOX2_TESTING_ASSERT_NO_VIOLATION()
#define IOX2_TESTING_ASSERT_ASSERT_VIOLATION()
#define IOX2_TESTING_ASSERT_ENFORCE_VIOLATION()
#define IOX2_TESTING_EXPECT_OK()
#define IOX2_TESTING_EXPECT_NO_PANIC()
#define IOX2_TESTING_EXPECT_PANIC()
#define IOX2_TESTING_EXPECT_ERROR(code)
#define IOX2_TESTING_EXPECT_NO_ERROR()
#define IOX2_TESTING_EXPECT_VIOLATION()
#define IOX2_TESTING_EXPECT_NO_VIOLATION()
#define IOX2_TESTING_EXPECT_ASSERT_VIOLATION()
#define IOX2_TESTING_EXPECT_ENFORCE_VIOLATION()

Functions

template<typename Code>
auto iox2::bb::testing::has_error (Code &&code) -> bool
 indicates whether the test error handler registered a specific error
auto iox2::bb::testing::has_panicked () -> bool
 indicates whether the test error handler invoked panic
auto iox2::bb::testing::has_error () -> bool
 indicates whether the test error handler registered any error
auto iox2::bb::testing::has_enforce_violation () -> bool
 indicates whether the test error handler registered an enforce violation
auto iox2::bb::testing::has_assert_violation () -> bool
 indicates whether the test error handler registered an assert violation
auto iox2::bb::testing::has_violation () -> bool
 indicates whether the test error handler registered violation (there are only two kinds).
auto iox2::bb::testing::is_in_normal_state () -> bool
 indicates there is no error, violation or panic.
auto iox2::bb::testing::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

Macro Definition Documentation

◆ IOX2_TESTING_ASSERT_ASSERT_VIOLATION

#define IOX2_TESTING_ASSERT_ASSERT_VIOLATION ( )
Value:
auto has_assert_violation() -> bool
indicates whether the test error handler registered an assert violation

Definition at line 108 of file testing_support.hpp.

◆ IOX2_TESTING_ASSERT_ENFORCE_VIOLATION

#define IOX2_TESTING_ASSERT_ENFORCE_VIOLATION ( )
Value:
auto has_enforce_violation() -> bool
indicates whether the test error handler registered an enforce violation

Definition at line 110 of file testing_support.hpp.

◆ IOX2_TESTING_ASSERT_ERROR

#define IOX2_TESTING_ASSERT_ERROR ( code)
Value:
ASSERT_TRUE(iox2::bb::testing::has_error(code))
auto has_error(Code &&code) -> bool
indicates whether the test error handler registered a specific error

Definition at line 100 of file testing_support.hpp.

◆ IOX2_TESTING_ASSERT_NO_ERROR

#define IOX2_TESTING_ASSERT_NO_ERROR ( )
Value:

Definition at line 102 of file testing_support.hpp.

◆ IOX2_TESTING_ASSERT_NO_PANIC

#define IOX2_TESTING_ASSERT_NO_PANIC ( )
Value:
auto has_panicked() -> bool
indicates whether the test error handler invoked panic

Definition at line 96 of file testing_support.hpp.

◆ IOX2_TESTING_ASSERT_NO_VIOLATION

#define IOX2_TESTING_ASSERT_NO_VIOLATION ( )
Value:
auto has_violation() -> bool
indicates whether the test error handler registered violation (there are only two kinds).

Definition at line 106 of file testing_support.hpp.

◆ IOX2_TESTING_ASSERT_OK

#define IOX2_TESTING_ASSERT_OK ( )
Value:
auto is_in_normal_state() -> bool
indicates there is no error, violation or panic.

Definition at line 94 of file testing_support.hpp.

◆ IOX2_TESTING_ASSERT_PANIC

#define IOX2_TESTING_ASSERT_PANIC ( )
Value:

Definition at line 98 of file testing_support.hpp.

◆ IOX2_TESTING_ASSERT_VIOLATION

#define IOX2_TESTING_ASSERT_VIOLATION ( )
Value:

Definition at line 104 of file testing_support.hpp.

◆ IOX2_TESTING_EXPECT_ASSERT_VIOLATION

#define IOX2_TESTING_EXPECT_ASSERT_VIOLATION ( )
Value:

Definition at line 128 of file testing_support.hpp.

◆ IOX2_TESTING_EXPECT_ENFORCE_VIOLATION

#define IOX2_TESTING_EXPECT_ENFORCE_VIOLATION ( )
Value:

Definition at line 130 of file testing_support.hpp.

◆ IOX2_TESTING_EXPECT_ERROR

#define IOX2_TESTING_EXPECT_ERROR ( code)
Value:
EXPECT_TRUE(iox2::bb::testing::has_error(code))

Definition at line 120 of file testing_support.hpp.

◆ IOX2_TESTING_EXPECT_NO_ERROR

#define IOX2_TESTING_EXPECT_NO_ERROR ( )
Value:

Definition at line 122 of file testing_support.hpp.

◆ IOX2_TESTING_EXPECT_NO_PANIC

#define IOX2_TESTING_EXPECT_NO_PANIC ( )
Value:

Definition at line 116 of file testing_support.hpp.

◆ IOX2_TESTING_EXPECT_NO_VIOLATION

#define IOX2_TESTING_EXPECT_NO_VIOLATION ( )
Value:

Definition at line 126 of file testing_support.hpp.

◆ IOX2_TESTING_EXPECT_OK

#define IOX2_TESTING_EXPECT_OK ( )
Value:

Definition at line 114 of file testing_support.hpp.

◆ IOX2_TESTING_EXPECT_PANIC

#define IOX2_TESTING_EXPECT_PANIC ( )

◆ IOX2_TESTING_EXPECT_VIOLATION

#define IOX2_TESTING_EXPECT_VIOLATION ( )
Value:

Definition at line 124 of file testing_support.hpp.