CHROMA
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
testing::TestCase Class Reference

#include <gtest.h>

Public Member Functions

 TestCase (const char *name, const char *a_type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc)
 
virtual ~TestCase ()
 
const char * name () const
 
const char * type_param () const
 
bool should_run () const
 
int successful_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
 
const TestInfoGetTestInfo (int i) const
 
const TestResultad_hoc_test_result () const
 

Private Member Functions

std::vector< TestInfo * > & test_info_list ()
 
const std::vector< TestInfo * > & test_info_list () const
 
TestInfoGetMutableTestInfo (int i)
 
void set_should_run (bool should)
 
void AddTestInfo (TestInfo *test_info)
 
void ClearResult ()
 
void Run ()
 
void RunSetUpTestCase ()
 
void RunTearDownTestCase ()
 
void ShuffleTests (internal::Random *random)
 
void UnshuffleTests ()
 
 GTEST_DISALLOW_COPY_AND_ASSIGN_ (TestCase)
 

Static Private Member Functions

static void ClearTestCaseResult (TestCase *test_case)
 
static bool TestPassed (const TestInfo *test_info)
 
static bool TestFailed (const TestInfo *test_info)
 
static bool TestReportableDisabled (const TestInfo *test_info)
 
static bool TestDisabled (const TestInfo *test_info)
 
static bool TestReportable (const TestInfo *test_info)
 
static bool ShouldRunTest (const TestInfo *test_info)
 

Private Attributes

std::string name_
 
const internal::scoped_ptr< const ::std::string > type_param_
 
std::vector< TestInfo * > test_info_list_
 
std::vector< int > test_indices_
 
Test::SetUpTestCaseFunc set_up_tc_
 
Test::TearDownTestCaseFunc tear_down_tc_
 
bool should_run_
 
TimeInMillis elapsed_time_
 
TestResult ad_hoc_test_result_
 

Friends

class Test
 
class internal::UnitTestImpl
 

Detailed Description

Definition at line 18159 of file gtest.h.

Constructor & Destructor Documentation

◆ TestCase()

testing::TestCase::TestCase ( const char *  name,
const char *  a_type_param,
Test::SetUpTestCaseFunc  set_up_tc,
Test::TearDownTestCaseFunc  tear_down_tc 
)

Definition at line 3874 of file gtest-all.cc.

◆ ~TestCase()

testing::TestCase::~TestCase ( )
virtual

Definition at line 3886 of file gtest-all.cc.

References testing::internal::ForEach(), and test_info_list_.

Member Function Documentation

◆ ad_hoc_test_result()

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

◆ AddTestInfo()

void testing::TestCase::AddTestInfo ( TestInfo test_info)
private

Definition at line 3907 of file gtest-all.cc.

References test_indices_, and test_info_list_.

◆ ClearResult()

void testing::TestCase::ClearResult ( )
private

◆ ClearTestCaseResult()

static void testing::TestCase::ClearTestCaseResult ( TestCase test_case)
inlinestaticprivate

Definition at line 18259 of file gtest.h.

References ClearResult().

Referenced by testing::internal::UnitTestImpl::ClearNonAdHocTestResult().

◆ disabled_test_count()

int testing::TestCase::disabled_test_count ( ) const

◆ elapsed_time()

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

◆ Failed()

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

Definition at line 18219 of file gtest.h.

Referenced by testing::internal::TestCaseFailed().

◆ failed_test_count()

int testing::TestCase::failed_test_count ( ) const

◆ GetMutableTestInfo()

TestInfo * testing::TestCase::GetMutableTestInfo ( int  i)
private

Definition at line 3900 of file gtest-all.cc.

References testing::internal::GetElementOr(), i, index, test_indices_, and test_info_list_.

Referenced by Run().

◆ GetTestInfo()

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

◆ GTEST_DISALLOW_COPY_AND_ASSIGN_()

testing::TestCase::GTEST_DISALLOW_COPY_AND_ASSIGN_ ( TestCase  )
private

◆ name()

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

◆ Passed()

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

Definition at line 18216 of file gtest.h.

Referenced by testing::internal::TestCasePassed().

◆ reportable_disabled_test_count()

int testing::TestCase::reportable_disabled_test_count ( ) const

◆ reportable_test_count()

int testing::TestCase::reportable_test_count ( ) const

◆ Run()

void testing::TestCase::Run ( )
private

◆ RunSetUpTestCase()

void testing::TestCase::RunSetUpTestCase ( )
inlineprivate

Definition at line 18268 of file gtest.h.

Referenced by Run().

◆ RunTearDownTestCase()

void testing::TestCase::RunTearDownTestCase ( )
inlineprivate

Definition at line 18272 of file gtest.h.

Referenced by Run().

◆ set_should_run()

void testing::TestCase::set_should_run ( bool  should)
inlineprivate

Definition at line 18249 of file gtest.h.

Referenced by testing::internal::UnitTestImpl::FilterTests().

◆ should_run()

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

◆ ShouldRunTest()

static bool testing::TestCase::ShouldRunTest ( const TestInfo test_info)
inlinestaticprivate

Definition at line 18301 of file gtest.h.

References testing::TestInfo::should_run().

Referenced by test_to_run_count().

◆ ShuffleTests()

void testing::TestCase::ShuffleTests ( internal::Random random)
private

Definition at line 3947 of file gtest-all.cc.

References testing::internal::Shuffle(), and test_indices_.

◆ successful_test_count()

int testing::TestCase::successful_test_count ( ) const

◆ test_info_list() [1/2]

std::vector<TestInfo*>& testing::TestCase::test_info_list ( )
inlineprivate

◆ test_info_list() [2/2]

const std::vector<TestInfo*>& testing::TestCase::test_info_list ( ) const
inlineprivate

Definition at line 18240 of file gtest.h.

◆ test_to_run_count()

int testing::TestCase::test_to_run_count ( ) const

◆ TestDisabled()

static bool testing::TestCase::TestDisabled ( const TestInfo test_info)
inlinestaticprivate

Definition at line 18291 of file gtest.h.

References testing::TestInfo::is_disabled_.

Referenced by disabled_test_count().

◆ TestFailed()

static bool testing::TestCase::TestFailed ( const TestInfo test_info)
inlinestaticprivate

◆ TestPassed()

static bool testing::TestCase::TestPassed ( const TestInfo test_info)
inlinestaticprivate

◆ TestReportable()

static bool testing::TestCase::TestReportable ( const TestInfo test_info)
inlinestaticprivate

Definition at line 18296 of file gtest.h.

References testing::TestInfo::is_reportable().

Referenced by reportable_test_count().

◆ TestReportableDisabled()

static bool testing::TestCase::TestReportableDisabled ( const TestInfo test_info)
inlinestaticprivate

◆ total_test_count()

int testing::TestCase::total_test_count ( ) const

◆ type_param()

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

◆ UnshuffleTests()

void testing::TestCase::UnshuffleTests ( )
private

Definition at line 3952 of file gtest-all.cc.

References i, and test_indices_.

Friends And Related Function Documentation

◆ internal::UnitTestImpl

friend class internal::UnitTestImpl
friend

Definition at line 18234 of file gtest.h.

◆ Test

friend class Test
friend

Definition at line 18233 of file gtest.h.

Member Data Documentation

◆ ad_hoc_test_result_

TestResult testing::TestCase::ad_hoc_test_result_
private

Definition at line 18333 of file gtest.h.

Referenced by ClearResult(), and testing::internal::UnitTestImpl::RecordProperty().

◆ elapsed_time_

TimeInMillis testing::TestCase::elapsed_time_
private

Definition at line 18330 of file gtest.h.

Referenced by Run().

◆ name_

std::string testing::TestCase::name_
private

Definition at line 18312 of file gtest.h.

◆ set_up_tc_

Test::SetUpTestCaseFunc testing::TestCase::set_up_tc_
private

Definition at line 18324 of file gtest.h.

◆ should_run_

bool testing::TestCase::should_run_
private

Definition at line 18328 of file gtest.h.

Referenced by Run().

◆ tear_down_tc_

Test::TearDownTestCaseFunc testing::TestCase::tear_down_tc_
private

Definition at line 18326 of file gtest.h.

◆ test_indices_

std::vector<int> testing::TestCase::test_indices_
private

Definition at line 18322 of file gtest.h.

Referenced by AddTestInfo(), GetMutableTestInfo(), GetTestInfo(), ShuffleTests(), and UnshuffleTests().

◆ test_info_list_

std::vector<TestInfo*> testing::TestCase::test_info_list_
private

◆ type_param_

const internal::scoped_ptr<const ::std::string> testing::TestCase::type_param_
private

Definition at line 18315 of file gtest.h.


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