Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::TestRegistry Class Reference

#include <catch_test_case_registry_impl.h>

Inheritance diagram for Catch::TestRegistry:
Collaboration diagram for Catch::TestRegistry:

Public Member Functions

virtual ~TestRegistry ()=default
 
virtual void registerTest (TestCase const &testCase)
 
std::vector< TestCase > const & getAllTests () const override
 
std::vector< TestCase > const & getAllTestsSorted (IConfig const &config) const override
 
- Public Member Functions inherited from Catch::ITestCaseRegistry
virtual ~ITestCaseRegistry ()
 
virtual ~ITestCaseRegistry ()
 

Detailed Description

Definition at line 33 of file catch_test_case_registry_impl.h.

Constructor & Destructor Documentation

◆ ~TestRegistry()

virtual Catch::TestRegistry::~TestRegistry ( )
virtualdefault

Member Function Documentation

◆ getAllTests()

std::vector< TestCase > const & Catch::TestRegistry::getAllTests ( ) const
overridevirtual

Implements Catch::ITestCaseRegistry.

Definition at line 79 of file catch_test_case_registry_impl.cpp.

79 {
80 return m_functions;
81 }

◆ getAllTestsSorted()

std::vector< TestCase > const & Catch::TestRegistry::getAllTestsSorted ( IConfig const & config) const
overridevirtual

Implements Catch::ITestCaseRegistry.

Definition at line 82 of file catch_test_case_registry_impl.cpp.

82 {
83 if( m_sortedFunctions.empty() )
84 enforceNoDuplicateTestCases( m_functions );
85
86 if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) {
87 m_sortedFunctions = sortTests( config, m_functions );
88 m_currentSortOrder = config.runOrder();
89 }
90 return m_sortedFunctions;
91 }
void enforceNoDuplicateTestCases(std::vector< TestCase > const &functions)
std::vector< TestCase > sortTests(IConfig const &config, std::vector< TestCase > const &unsortedTestCases)
Here is the call graph for this function:

◆ registerTest()

void Catch::TestRegistry::registerTest ( TestCase const & testCase)
virtual

Definition at line 69 of file catch_test_case_registry_impl.cpp.

69 {
70 std::string name = testCase.getTestCaseInfo().name;
71 if( name.empty() ) {
72 ReusableStringStream rss;
73 rss << "Anonymous test case " << ++m_unnamedCount;
74 return registerTest( testCase.withName( rss.str() ) );
75 }
76 m_functions.push_back( testCase );
77 }
std::string name
virtual void registerTest(TestCase const &testCase)
Here is the call graph for this function:
Here is the caller graph for this function:

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