userver: userver/utest/utest.hpp File Reference
Loading...
Searching...
No Matches
utest.hpp File Reference

Detailed Description

Versions of gtest macros that run tests in a coroutine environment.

Definition in file utest.hpp.

Go to the source code of this file.

#include <chrono>
#include <functional>
#include <utility>
#include <gtest/gtest.h>
#include <userver/engine/run_in_coro.hpp>
#include <userver/utest/assert_macros.hpp>
#include <userver/utest/test_case_macros.hpp>
#include <userver/utils/assert.hpp>
#include <userver/utils/strong_typedef.hpp>
+ Include dependency graph for utest.hpp:
+ This graph shows which files directly or indirectly include this file:

Namespaces

namespace  utest
 Mocks and test helpers.
 
namespace  formats
 Value formats representation, parsing and serialization.
 
namespace  formats::json
 JSON support.
 
namespace  utils
 Utilities.
 
namespace  decimal64
 Fixed-point decimal data type and related functions.
 

Macros

#define DISABLED_IN_DEBUG_TEST_NAME(name)   DISABLED_##name
 
#define DISABLED_IN_MAC_OS_TEST_NAME(name)   name
 
#define DISABLED_IN_LIBCPP_TEST_NAME(name)   name
 
#define UTEST(test_suite_name, test_name)
 An equivalent of the gtest macro TEST that starts the test body as a coroutine task.
 
#define UTEST_DEATH(test_suite_name, test_name)
 An equivalent of the gtest macro TEST for death tests that starts the test body as a coroutine task.
 
#define UTEST_MT(test_suite_name, test_name, thread_count)
 An equivalent of the gtest macro TEST that starts the test body as a coroutine task.
 
#define UTEST_F(test_suite_name, test_name)
 An equivalent of the gtest macro TEST_F that starts the test body as a coroutine task.
 
#define UTEST_F_DEATH(test_suite_name, test_name)
 An equivalent of the gtest macro TEST_F for death tests that starts the test body as a coroutine task.
 
#define UTEST_F_MT(test_suite_name, test_name, thread_count)
 An equivalent of the gtest macro TEST_F that starts the test body as a coroutine task.
 
#define UTEST_P(test_suite_name, test_name)
 An equivalent of the gtest macro TEST_P that starts the test body as a coroutine task.
 
#define UTEST_P_MT(test_suite_name, test_name, thread_count)
 An equivalent of the gtest macro TEST_P that starts the test body as a coroutine task.
 
#define TYPED_UTEST(test_suite_name, test_name)
 An equivalent of the gtest macro TYPED_TEST that starts the test body as a coroutine task.
 
#define TYPED_UTEST_MT(test_suite_name, test_name, thread_count)
 An equivalent of the gtest macro TYPED_TEST that starts the test body as a coroutine task.
 
#define TYPED_UTEST_P(test_suite_name, test_name)
 An equivalent of the gtest macro TYPED_TEST_P that starts the test body as a coroutine task.
 
#define TYPED_UTEST_P_MT(test_suite_name, test_name, thread_count)
 An equivalent of the gtest macro TYPED_TEST_P that starts the test body as a coroutine task.
 
#define TYPED_UTEST_SUITE(test_suite_name, types)
 An equivalent of the gtest macro TYPED_TEST_SUITE that starts the test body as a coroutine task.
 
#define INSTANTIATE_UTEST_SUITE_P(prefix, test_suite_name, ...)
 An equivalent of the gtest macro INSTANTIATE_TEST_SUITE_P that starts the test body as a coroutine task.
 
#define REGISTER_TYPED_UTEST_SUITE_P(test_suite_name, ...)
 An equivalent of the gtest macro REGISTER_TYPED_TEST_SUITE_P that starts the test body as a coroutine task.
 
#define INSTANTIATE_TYPED_UTEST_SUITE_P(prefix, test_suite_name, types)
 An equivalent of the gtest macro INSTANTIATE_TYPED_TEST_SUITE_P that starts the test body as a coroutine task.
 
#define TYPED_UTEST_SUITE_P(test_suite_name)
 An equivalent of the gtest macro TYPED_TEST_SUITE_P that starts the test body as a coroutine task.
 

Functions

void testing::PrintTo (std::chrono::seconds s, std::ostream *os)
 
void testing::PrintTo (std::chrono::milliseconds ms, std::ostream *os)
 
void testing::PrintTo (std::chrono::microseconds us, std::ostream *os)
 
void testing::PrintTo (std::chrono::nanoseconds ns, std::ostream *os)
 
constexpr std::chrono::seconds utest::kMaxTestWaitTime (20)
 
void formats::json::PrintTo (const Value &, std::ostream *)
 
template<class Tag , class T , StrongTypedefOps Ops>
void utils::PrintTo (const StrongTypedef< Tag, T, Ops > &v, std::ostream *os)
 
template<int Prec, typename RoundPolicy >
void decimal64::PrintTo (const Decimal< Prec, RoundPolicy > &v, std::ostream *os)
 

Macro Definition Documentation

◆ DISABLED_IN_DEBUG_TEST_NAME

#define DISABLED_IN_DEBUG_TEST_NAME ( name)    DISABLED_##name

Definition at line 72 of file utest.hpp.

◆ DISABLED_IN_LIBCPP_TEST_NAME

#define DISABLED_IN_LIBCPP_TEST_NAME ( name)    name

Definition at line 91 of file utest.hpp.

◆ DISABLED_IN_MAC_OS_TEST_NAME

#define DISABLED_IN_MAC_OS_TEST_NAME ( name)    name

Definition at line 83 of file utest.hpp.