10#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TESTING_GTEST_CONDITIONAL_ASSERTIONS_HPP_
11#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TESTING_GTEST_CONDITIONAL_ASSERTIONS_HPP_
16#include <gtest/gtest.h>
19#include "arene/base/compiler_support/preprocessor.hpp"
20#include "arene/base/testing/gtest/static_assertions_config.hpp"
22#if ARENE_IS_ON(ARENE_GTEST_STATIC_ASSERTIONS)
23#include "arene/base/testing/gtest/detail/conditional_assertions_with_static.hpp"
25#include "arene/base/testing/gtest/detail/conditional_assertions_without_static.hpp"
37#define COND_STATIC_ASSERT_UNARY(assertion_type, ...)
38 struct ARENE_CONCATENATE(condition_impl_, __LINE__) {
39 constexpr static auto body() -> decltype(auto) { return __VA_ARGS__; }
41 static_cast<void>((ARENE_CONDITIONAL_ASSERTER((assertion_type))::do_assert()))
45#define COND_STATIC_ASSERT_TRUE(...)
50#define COND_STATIC_ASSERT_FALSE(...)
57#define COND_STATIC_ASSERT_BINARY(left_arg, right_arg, assertion_type)
58 struct ARENE_CONCATENATE(condition_impl_, __LINE__) {
59 constexpr static auto left() -> decltype(auto) { return left_arg; }
60 constexpr static auto right() -> decltype(auto) { return right_arg; }
62 static_cast<void>((ARENE_CONDITIONAL_ASSERTER((assertion_type))::do_assert()))
67#define COND_STATIC_ASSERT_EQ(left_arg, right_arg)
73#define COND_STATIC_ASSERT_NE(left_arg, right_arg)
79#define COND_STATIC_ASSERT_LT(left_arg, right_arg)
85#define COND_STATIC_ASSERT_LE(left_arg, right_arg)
91#define COND_STATIC_ASSERT_GT(left_arg, right_arg)
97#define COND_STATIC_ASSERT_GE(left_arg, right_arg)
107#define ARENE_INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteBaseName, SuiteSuffix, Types)
108 INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteBaseName##SuiteSuffix, Types, )
115#define ARENE_INSTANTIATE_TESTS(Prefix, SuiteBaseName, Types)
118 using namespace ::arene::base::testing;
122 static_assert(true, "Dummy static assert to absorb the semicolon after invoking the macro")
#define ARENE_INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteBaseName, SuiteSuffix, Types)
Call the Google Test suite instantiation macro with the given arguments This exists to avoid having m...
Definition conditional_assertions.hpp:107
#define COND_STATIC_ASSERT_BINARY(left_arg, right_arg, assertion_type)
Call a Google Test binary assertion macro at runtime, and statically if TypeParam is compatible.
Definition conditional_assertions.hpp:57
#define COND_STATIC_ASSERT_UNARY(assertion_type,...)
Call a Google Test unary assertion macro at runtime, and statically if TypeParam is compatible.
Definition conditional_assertions.hpp:37