tesseract v5.3.3.20231005
testing::TestSuite Class Reference

#include <gtest.h>

Public Member Functions

 TestSuite (const char *name, const char *a_type_param, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc)
 
virtual ~TestSuite ()
 
const char * name () const
 
const char * type_param () const
 
bool should_run () const
 
int successful_test_count () const
 
int skipped_test_count () const
 
int failed_test_count () const
 
int reportable_disabled_test_count () const
 
int disabled_test_count () const
 
int reportable_test_count () const
 
int test_to_run_count () const
 
int total_test_count () const
 
bool Passed () const
 
bool Failed () const
 
TimeInMillis elapsed_time () const
 
TimeInMillis start_timestamp () const
 
const TestInfoGetTestInfo (int i) const
 
const TestResultad_hoc_test_result () const
 

Friends

class Test
 
class internal::UnitTestImpl
 

Detailed Description

Definition at line 842 of file gtest.h.

Constructor & Destructor Documentation

◆ TestSuite()

testing::TestSuite::TestSuite ( const char *  name,
const char *  a_type_param,
internal::SetUpTestSuiteFunc  set_up_tc,
internal::TearDownTestSuiteFunc  tear_down_tc 
)

Definition at line 2954 of file gtest.cc.

2957 : name_(a_name),
2958 type_param_(a_type_param ? new std::string(a_type_param) : nullptr),
2959 set_up_tc_(set_up_tc),
2960 tear_down_tc_(tear_down_tc),
2961 should_run_(false),
2962 start_timestamp_(0),
2963 elapsed_time_(0) {}

◆ ~TestSuite()

testing::TestSuite::~TestSuite ( )
virtual

Definition at line 2966 of file gtest.cc.

2966 {
2967 // Deletes every Test in the collection.
2968 ForEach(test_info_list_, internal::Delete<TestInfo>);
2969}

Member Function Documentation

◆ ad_hoc_test_result()

const TestResult & testing::TestSuite::ad_hoc_test_result ( ) const
inline

Definition at line 921 of file gtest.h.

921{ return ad_hoc_test_result_; }

◆ disabled_test_count()

int testing::TestSuite::disabled_test_count ( ) const

Definition at line 2926 of file gtest.cc.

2926 {
2927 return CountIf(test_info_list_, TestDisabled);
2928}

◆ elapsed_time()

TimeInMillis testing::TestSuite::elapsed_time ( ) const
inline

Definition at line 909 of file gtest.h.

909{ return elapsed_time_; }

◆ Failed()

bool testing::TestSuite::Failed ( ) const
inline

Definition at line 904 of file gtest.h.

904 {
905 return failed_test_count() > 0 || ad_hoc_test_result().Failed();
906 }
bool Failed() const
Definition: gtest.cc:2375
const TestResult & ad_hoc_test_result() const
Definition: gtest.h:921
int failed_test_count() const
Definition: gtest.cc:2916

◆ failed_test_count()

int testing::TestSuite::failed_test_count ( ) const

Definition at line 2916 of file gtest.cc.

2916 {
2917 return CountIf(test_info_list_, TestFailed);
2918}

◆ GetTestInfo()

const TestInfo * testing::TestSuite::GetTestInfo ( int  i) const

Definition at line 2973 of file gtest.cc.

2973 {
2974 const int index = GetElementOr(test_indices_, i, -1);
2975 return index < 0 ? nullptr : test_info_list_[static_cast<size_t>(index)];
2976}

◆ name()

const char * testing::TestSuite::name ( ) const
inline

Definition at line 864 of file gtest.h.

864{ return name_.c_str(); }

◆ Passed()

bool testing::TestSuite::Passed ( ) const
inline

Definition at line 901 of file gtest.h.

901{ return !Failed(); }
bool Failed() const
Definition: gtest.h:904

◆ reportable_disabled_test_count()

int testing::TestSuite::reportable_disabled_test_count ( ) const

Definition at line 2921 of file gtest.cc.

2921 {
2922 return CountIf(test_info_list_, TestReportableDisabled);
2923}

◆ reportable_test_count()

int testing::TestSuite::reportable_test_count ( ) const

Definition at line 2931 of file gtest.cc.

2931 {
2932 return CountIf(test_info_list_, TestReportable);
2933}

◆ should_run()

bool testing::TestSuite::should_run ( ) const
inline

Definition at line 874 of file gtest.h.

874{ return should_run_; }

◆ skipped_test_count()

int testing::TestSuite::skipped_test_count ( ) const

Definition at line 2911 of file gtest.cc.

2911 {
2912 return CountIf(test_info_list_, TestSkipped);
2913}

◆ start_timestamp()

TimeInMillis testing::TestSuite::start_timestamp ( ) const
inline

Definition at line 913 of file gtest.h.

913{ return start_timestamp_; }

◆ successful_test_count()

int testing::TestSuite::successful_test_count ( ) const

Definition at line 2906 of file gtest.cc.

2906 {
2907 return CountIf(test_info_list_, TestPassed);
2908}

◆ test_to_run_count()

int testing::TestSuite::test_to_run_count ( ) const

Definition at line 2936 of file gtest.cc.

2936 {
2937 return CountIf(test_info_list_, ShouldRunTest);
2938}

◆ total_test_count()

int testing::TestSuite::total_test_count ( ) const

Definition at line 2941 of file gtest.cc.

2941 {
2942 return static_cast<int>(test_info_list_.size());
2943}

◆ type_param()

const char * testing::TestSuite::type_param ( ) const
inline

Definition at line 868 of file gtest.h.

868 {
869 if (type_param_.get() != nullptr) return type_param_->c_str();
870 return nullptr;
871 }

Friends And Related Function Documentation

◆ internal::UnitTestImpl

friend class internal::UnitTestImpl
friend

Definition at line 925 of file gtest.h.

◆ Test

friend class Test
friend

Definition at line 924 of file gtest.h.


The documentation for this class was generated from the following files: