26 #include "../../pmr/new_delete_resource.h"
31 #ifdef EMLABCPP_USE_GTEST
33 #include <gtest/gtest.h>
38 inline ::testing::AssertionResult gtest_predicate(
char const*, test_result
const& tres )
41 ::testing::AssertionResult
res = ::testing::AssertionSuccess();
42 switch ( tres.status ) {
47 return ::testing::AssertionFailure() <<
"Test produced a failure, stopping";
49 return ::testing::AssertionFailure() <<
"Test errored";
55 class gtest :
public ::testing::Test
61 gtest( controller& cont,
test_id tid )
69 cont_.start_test( tid_ );
70 while ( cont_.is_test_running() )
75 inline void register_gtests( controller& cont )
77 std::string
const suite_name = std::string{ cont.suite_name() };
78 for (
auto [tid, name] : cont.get_tests() ) {
79 std::string
const sname{ name.begin(), name.end() };
81 ::testing::RegisterTest(
89 return new gtest( cont, test_id );
MIT License.
Definition: base.h:37
uint16_t test_id
Definition: base.h:54
T res
Definition: algorithm.h:505