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

const TestResultad_hoc_test_result () const
 
const TestCasecurrent_test_case () const GTEST_LOCK_EXCLUDED_(mutex_)
 
const TestInfocurrent_test_info () const GTEST_LOCK_EXCLUDED_(mutex_)
 
int disabled_test_count () const
 
TimeInMillis elapsed_time () const
 
bool Failed () const
 
int failed_test_case_count () const
 
int failed_test_count () const
 
const TestCaseGetTestCase (int i) const
 
TestEventListenerslisteners ()
 
const char * original_working_dir () const
 
bool Passed () const
 
int random_seed () const
 
int reportable_disabled_test_count () const
 
int reportable_test_count () const
 
int Run () GTEST_MUST_USE_RESULT_
 
TimeInMillis start_timestamp () const
 
int successful_test_case_count () const
 
int successful_test_count () const
 
int test_case_to_run_count () const
 
int test_to_run_count () const
 
int total_test_case_count () const
 
int total_test_count () const
 

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_)
 
TestCaseGetMutableTestCase (int i)
 
 GTEST_DISALLOW_COPY_AND_ASSIGN_ (UnitTest)
 
internal::UnitTestImplimpl ()
 
const internal::UnitTestImplimpl () const
 
void PopGTestTrace () GTEST_LOCK_EXCLUDED_(mutex_)
 
void PushGTestTrace (const internal::TraceInfo &trace) GTEST_LOCK_EXCLUDED_(mutex_)
 
void RecordProperty (const std::string &key, const std::string &value)
 
 UnitTest ()
 
virtual ~UnitTest ()
 

Private Attributes

internal::UnitTestImplimpl_
 
internal::Mutex mutex_
 

Friends

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

Detailed Description

Definition at line 1119 of file gtest.h.

Constructor & Destructor Documentation

◆ UnitTest()

testing::UnitTest::UnitTest ( )
private

Definition at line 3971 of file gtest.cc.

◆ ~UnitTest()

testing::UnitTest::~UnitTest ( )
privatevirtual

Definition at line 3976 of file gtest.cc.

Member Function Documentation

◆ ad_hoc_test_result()

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

Definition at line 3741 of file gtest.cc.

◆ AddEnvironment()

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

Definition at line 3767 of file gtest.cc.

◆ 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

Definition at line 3780 of file gtest.cc.

◆ current_test_case()

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

Definition at line 3943 of file gtest.cc.

◆ current_test_info()

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

Definition at line 3951 of file gtest.cc.

◆ disabled_test_count()

int testing::UnitTest::disabled_test_count ( ) const

Definition at line 3700 of file gtest.cc.

◆ elapsed_time()

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

Definition at line 3722 of file gtest.cc.

◆ Failed()

bool testing::UnitTest::Failed ( ) const

Definition at line 3731 of file gtest.cc.

◆ failed_test_case_count()

int testing::UnitTest::failed_test_case_count ( ) const

Definition at line 3671 of file gtest.cc.

◆ failed_test_count()

int testing::UnitTest::failed_test_count ( ) const

Definition at line 3692 of file gtest.cc.

◆ GetInstance()

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

Definition at line 3644 of file gtest.cc.

◆ GetMutableTestCase()

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

Definition at line 3747 of file gtest.cc.

◆ GetTestCase()

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

Definition at line 3735 of file gtest.cc.

◆ GTEST_DISALLOW_COPY_AND_ASSIGN_()

testing::UnitTest::GTEST_DISALLOW_COPY_AND_ASSIGN_ ( UnitTest  )
private

◆ impl() [1/2]

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

Definition at line 1255 of file gtest.h.

◆ impl() [2/2]

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

Definition at line 1256 of file gtest.h.

◆ listeners()

TestEventListeners & testing::UnitTest::listeners ( )

Definition at line 3753 of file gtest.cc.

◆ original_working_dir()

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

Definition at line 3937 of file gtest.cc.

◆ Passed()

bool testing::UnitTest::Passed ( ) const

Definition at line 3727 of file gtest.cc.

◆ PopGTestTrace()

void testing::UnitTest::PopGTestTrace ( )
private

Definition at line 3989 of file gtest.cc.

◆ PushGTestTrace()

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

Definition at line 3982 of file gtest.cc.

◆ random_seed()

int testing::UnitTest::random_seed ( ) const

Definition at line 3958 of file gtest.cc.

◆ RecordProperty()

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

Definition at line 3847 of file gtest.cc.

◆ reportable_disabled_test_count()

int testing::UnitTest::reportable_disabled_test_count ( ) const

Definition at line 3695 of file gtest.cc.

◆ reportable_test_count()

int testing::UnitTest::reportable_test_count ( ) const

Definition at line 3705 of file gtest.cc.

◆ Run()

int testing::UnitTest::Run ( )

Definition at line 3857 of file gtest.cc.

◆ start_timestamp()

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

Definition at line 3717 of file gtest.cc.

◆ successful_test_case_count()

int testing::UnitTest::successful_test_case_count ( ) const

Definition at line 3666 of file gtest.cc.

◆ successful_test_count()

int testing::UnitTest::successful_test_count ( ) const

Definition at line 3687 of file gtest.cc.

◆ test_case_to_run_count()

int testing::UnitTest::test_case_to_run_count ( ) const

Definition at line 3682 of file gtest.cc.

◆ test_to_run_count()

int testing::UnitTest::test_to_run_count ( ) const

Definition at line 3713 of file gtest.cc.

◆ total_test_case_count()

int testing::UnitTest::total_test_case_count ( ) const

Definition at line 3676 of file gtest.cc.

◆ total_test_count()

int testing::UnitTest::total_test_count ( ) const

Definition at line 3710 of file gtest.cc.

Friends And Related Function Documentation

◆ AddGlobalTestEnvironment

Environment* AddGlobalTestEnvironment ( Environment env)
friend

Definition at line 1318 of file gtest.h.

◆ internal::AssertHelper

friend class internal::AssertHelper
friend

Definition at line 1261 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 1262 of file gtest.h.

◆ internal::StreamingListenerTest

friend class internal::StreamingListenerTest
friend

Definition at line 1263 of file gtest.h.

◆ internal::UnitTestRecordPropertyTestHelper

friend class internal::UnitTestRecordPropertyTestHelper
friend

Definition at line 1264 of file gtest.h.

◆ Test

friend class Test
friend

Definition at line 1260 of file gtest.h.

Member Data Documentation

◆ impl_

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

Definition at line 1294 of file gtest.h.

◆ mutex_

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

Definition at line 1288 of file gtest.h.


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


fcl
Author(s):
autogenerated on Wed Feb 17 2021 03:40:11