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

#include <gtest.h>

Public Member Functions

int Run () GTEST_MUST_USE_RESULT_
 
const char * original_working_dir () const
 
const TestCasecurrent_test_case () const GTEST_LOCK_EXCLUDED_(mutex_)
 
const TestInfocurrent_test_info () const GTEST_LOCK_EXCLUDED_(mutex_)
 
int random_seed () const
 
internal::ParameterizedTestCaseRegistryparameterized_test_registry () GTEST_LOCK_EXCLUDED_(mutex_)
 
int successful_test_case_count () const
 
int failed_test_case_count () const
 
int total_test_case_count () const
 
int test_case_to_run_count () 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 total_test_count () const
 
int test_to_run_count () const
 
TimeInMillis start_timestamp () const
 
TimeInMillis elapsed_time () const
 
bool Passed () const
 
bool Failed () const
 
const TestCaseGetTestCase (int i) const
 
const TestResultad_hoc_test_result () const
 
TestEventListenerslisteners ()
 

Static Public Member Functions

static UnitTestGetInstance ()
 

Private Member Functions

EnvironmentAddEnvironment (Environment *env)
 
void AddTestPartResult (TestPartResult::Type result_type, const char *file_name, int line_number, const std::string &message, const std::string &os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_)
 
void RecordProperty (const std::string &key, const std::string &value)
 
TestCaseGetMutableTestCase (int i)
 
internal::UnitTestImplimpl ()
 
const internal::UnitTestImplimpl () const
 
 UnitTest ()
 
virtual ~UnitTest ()
 
void PushGTestTrace (const internal::TraceInfo &trace) GTEST_LOCK_EXCLUDED_(mutex_)
 
void PopGTestTrace () GTEST_LOCK_EXCLUDED_(mutex_)
 
 GTEST_DISALLOW_COPY_AND_ASSIGN_ (UnitTest)
 

Private Attributes

internal::Mutex mutex_
 
internal::UnitTestImplimpl_
 

Friends

class Test
 
class internal::AssertHelper
 
class internal::ScopedTrace
 
class internal::StreamingListenerTest
 
class internal::UnitTestRecordPropertyTestHelper
 
EnvironmentAddGlobalTestEnvironment (Environment *env)
 
internal::UnitTestImplinternal::GetUnitTestImpl ()
 
void internal::ReportFailureInUnknownLocation (TestPartResult::Type result_type, const std::string &message)
 

Detailed Description

Definition at line 18532 of file gtest.h.

Constructor & Destructor Documentation

◆ UnitTest()

testing::UnitTest::UnitTest ( )
private

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

References impl_.

Referenced by GetInstance().

◆ ~UnitTest()

testing::UnitTest::~UnitTest ( )
privatevirtual

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

References impl_.

Member Function Documentation

◆ ad_hoc_test_result()

const TestResult & testing::UnitTest::ad_hoc_test_result ( ) const

◆ AddEnvironment()

Environment * testing::UnitTest::AddEnvironment ( Environment env)
private

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

References testing::internal::UnitTestImpl::environments(), and impl_.

◆ AddTestPartResult()

void testing::UnitTest::AddTestPartResult ( TestPartResult::Type  result_type,
const char *  file_name,
int  line_number,
const std::string &  message,
const std::string &  os_stack_trace 
)
private

◆ current_test_case()

const TestCase * testing::UnitTest::current_test_case ( ) const

◆ current_test_info()

const TestInfo * testing::UnitTest::current_test_info ( ) const

◆ disabled_test_count()

int testing::UnitTest::disabled_test_count ( ) const

◆ elapsed_time()

internal::TimeInMillis testing::UnitTest::elapsed_time ( ) const

◆ Failed()

bool testing::UnitTest::Failed ( ) const

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

References testing::internal::UnitTestImpl::Failed(), and impl().

◆ failed_test_case_count()

int testing::UnitTest::failed_test_case_count ( ) const

◆ failed_test_count()

int testing::UnitTest::failed_test_count ( ) const

◆ GetInstance()

UnitTest * testing::UnitTest::GetInstance ( )
static

◆ GetMutableTestCase()

TestCase * testing::UnitTest::GetMutableTestCase ( int  i)
private

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

References testing::internal::UnitTestImpl::GetMutableTestCase(), i, and impl().

◆ GetTestCase()

const TestCase * testing::UnitTest::GetTestCase ( int  i) const

◆ GTEST_DISALLOW_COPY_AND_ASSIGN_()

testing::UnitTest::GTEST_DISALLOW_COPY_AND_ASSIGN_ ( UnitTest  )
private

◆ impl() [1/2]

internal::UnitTestImpl* testing::UnitTest::impl ( )
inlineprivate

◆ impl() [2/2]

const internal::UnitTestImpl* testing::UnitTest::impl ( ) const
inlineprivate

Definition at line 18669 of file gtest.h.

◆ listeners()

TestEventListeners & testing::UnitTest::listeners ( )

◆ original_working_dir()

const char * testing::UnitTest::original_working_dir ( ) const

◆ parameterized_test_registry()

internal::ParameterizedTestCaseRegistry& testing::UnitTest::parameterized_test_registry ( )

◆ Passed()

bool testing::UnitTest::Passed ( ) const

◆ PopGTestTrace()

void testing::UnitTest::PopGTestTrace ( )
private

◆ PushGTestTrace()

void testing::UnitTest::PushGTestTrace ( const internal::TraceInfo trace)
private

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

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

◆ random_seed()

int testing::UnitTest::random_seed ( ) const

◆ RecordProperty()

void testing::UnitTest::RecordProperty ( const std::string &  key,
const std::string &  value 
)
private

◆ reportable_disabled_test_count()

int testing::UnitTest::reportable_disabled_test_count ( ) const

◆ reportable_test_count()

int testing::UnitTest::reportable_test_count ( ) const

◆ Run()

int testing::UnitTest::Run ( )

◆ start_timestamp()

internal::TimeInMillis testing::UnitTest::start_timestamp ( ) const

◆ successful_test_case_count()

int testing::UnitTest::successful_test_case_count ( ) const

◆ successful_test_count()

int testing::UnitTest::successful_test_count ( ) const

◆ test_case_to_run_count()

int testing::UnitTest::test_case_to_run_count ( ) const

◆ test_to_run_count()

int testing::UnitTest::test_to_run_count ( ) const

◆ total_test_case_count()

int testing::UnitTest::total_test_case_count ( ) const

◆ total_test_count()

int testing::UnitTest::total_test_count ( ) const

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

References impl(), and testing::internal::UnitTestImpl::total_test_count().

Friends And Related Function Documentation

◆ AddGlobalTestEnvironment

Environment* AddGlobalTestEnvironment ( Environment env)
friend

Definition at line 18731 of file gtest.h.

◆ internal::AssertHelper

friend class internal::AssertHelper
friend

Definition at line 18674 of file gtest.h.

◆ internal::GetUnitTestImpl

◆ internal::ReportFailureInUnknownLocation

void internal::ReportFailureInUnknownLocation ( TestPartResult::Type  result_type,
const std::string &  message 
)
friend

◆ internal::ScopedTrace

friend class internal::ScopedTrace
friend

Definition at line 18675 of file gtest.h.

◆ internal::StreamingListenerTest

friend class internal::StreamingListenerTest
friend

Definition at line 18676 of file gtest.h.

◆ internal::UnitTestRecordPropertyTestHelper

friend class internal::UnitTestRecordPropertyTestHelper
friend

Definition at line 18677 of file gtest.h.

◆ Test

friend class Test
friend

Definition at line 18673 of file gtest.h.

Member Data Documentation

◆ impl_

internal::UnitTestImpl* testing::UnitTest::impl_
private

◆ mutex_

internal::Mutex testing::UnitTest::mutex_
mutableprivate

Definition at line 18701 of file gtest.h.

Referenced by current_test_case(), current_test_info(), and PopGTestTrace().


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