Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhil Nash2012-11-22 19:17:20 +0000
committerPhil Nash2012-11-22 19:17:20 +0000
commit06a671a34909c19a1a4849a9d9c55ef141b654d2 (patch)
tree40f3556d67d6ed9a42727446bfd9342912a66e8f
parent37f3820747eb7fd4e1d937e100de6f5fafcdb83c (diff)
downloadcatch3-06a671a34909c19a1a4849a9d9c55ef141b654d2.tar.gz
Renamed TestCaseInfo -> TestCase
-rw-r--r--include/catch_runner.hpp6
-rw-r--r--include/internal/catch_context.h2
-rw-r--r--include/internal/catch_interfaces_capture.h2
-rw-r--r--include/internal/catch_interfaces_registry_hub.h4
-rw-r--r--include/internal/catch_interfaces_reporter.h54
-rw-r--r--include/internal/catch_interfaces_runner.h2
-rw-r--r--include/internal/catch_interfaces_testcase.h6
-rw-r--r--include/internal/catch_list.hpp6
-rw-r--r--include/internal/catch_objc.hpp2
-rw-r--r--include/internal/catch_registry_hub.hpp2
-rw-r--r--include/internal/catch_runner_impl.hpp18
-rw-r--r--include/internal/catch_running_test.hpp6
-rw-r--r--include/internal/catch_test_case_info.h20
-rw-r--r--include/internal/catch_test_case_info.hpp36
-rw-r--r--include/internal/catch_test_case_registry_impl.hpp34
-rw-r--r--include/internal/catch_test_spec.h6
-rw-r--r--include/reporters/catch_reporter_basic.hpp4
-rw-r--r--include/reporters/catch_reporter_junit.hpp9
-rw-r--r--include/reporters/catch_reporter_xml.hpp4
-rw-r--r--projects/SelfTest/TestMain.cpp12
-rw-r--r--projects/SelfTest/catch_self_test.hpp6
21 files changed, 146 insertions, 95 deletions
diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp
index d8311968..7c993c09 100644
--- a/include/catch_runner.hpp
+++ b/include/catch_runner.hpp
@@ -56,8 +56,8 @@ namespace Catch {
Totals runTestsForGroup( Runner& context, const TestCaseFilters& filterGroup ) {
Totals totals;
- std::vector<TestCaseInfo>::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin();
- std::vector<TestCaseInfo>::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end();
+ std::vector<TestCase>::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin();
+ std::vector<TestCase>::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end();
int testsRunForGroup = 0;
for(; it != itEnd; ++it ) {
if( filterGroup.shouldInclude( *it ) ) {
@@ -114,7 +114,7 @@ namespace Catch {
const ConfigData& m_config;
std::ofstream m_ofs;
Ptr<IReporter> m_reporter;
- std::set<TestCaseInfo> m_testsAlreadyRun;
+ std::set<TestCase> m_testsAlreadyRun;
};
inline int Main( Config& configWrapper ) {
diff --git a/include/internal/catch_context.h b/include/internal/catch_context.h
index 51716733..831d22a3 100644
--- a/include/internal/catch_context.h
+++ b/include/internal/catch_context.h
@@ -16,7 +16,7 @@
namespace Catch {
- class TestCaseInfo;
+ class TestCase;
class Stream;
struct IResultCapture;
struct IRunner;
diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h
index 3cbbb88e..3f01bd0b 100644
--- a/include/internal/catch_interfaces_capture.h
+++ b/include/internal/catch_interfaces_capture.h
@@ -15,7 +15,7 @@
namespace Catch {
- class TestCaseInfo;
+ class TestCase;
class ScopedInfo;
class ExpressionResultBuilder;
class AssertionResult;
diff --git a/include/internal/catch_interfaces_registry_hub.h b/include/internal/catch_interfaces_registry_hub.h
index da2d7fd4..7d932bde 100644
--- a/include/internal/catch_interfaces_registry_hub.h
+++ b/include/internal/catch_interfaces_registry_hub.h
@@ -15,7 +15,7 @@
namespace Catch {
- class TestCaseInfo;
+ class TestCase;
struct ITestCaseRegistry;
struct IExceptionTranslatorRegistry;
struct IExceptionTranslator;
@@ -31,7 +31,7 @@ namespace Catch {
struct IMutableRegistryHub {
virtual ~IMutableRegistryHub();
virtual void registerReporter( const std::string& name, IReporterFactory* factory ) = 0;
- virtual void registerTest( const TestCaseInfo& testInfo ) = 0;
+ virtual void registerTest( const TestCase& testInfo ) = 0;
virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
};
diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h
index 847016ad..96075933 100644
--- a/include/internal/catch_interfaces_reporter.h
+++ b/include/internal/catch_interfaces_reporter.h
@@ -12,6 +12,8 @@
#include "catch_totals.hpp"
#include "catch_ptr.hpp"
#include "catch_config.hpp"
+#include "catch_test_case_info.h"
+#include "catch_assertionresult.h"
#include <string>
#include <ostream>
@@ -47,10 +49,54 @@ namespace Catch
private:
void operator=(const ReporterConfig&);
};
+
+ struct AssertionStats {
+ AssertionInfo assertionInfo;
+ AssertionResult assertionResult;
+ Totals totals;
+ };
+
+ struct TestCaseStats {
+ TestCase testInfo;
+ Totals totals;
+ std::string stdOut;
+ std::string stdErr;
+ bool aborting;
+ };
- class TestCaseInfo;
- class AssertionResult;
+ struct TestGroupStats {
+ std::string groupName;
+ Totals totals;
+ bool aborting;
+ };
+ struct TestRunStats {
+ std::string runName;
+ Totals totals;
+ bool aborting;
+ };
+
+ // !Work In progress
+ struct IStreamingReporter : IShared {
+ virtual void testRunStarting( const std::string& runName ) = 0;
+ virtual void testGroupStarting( const std::string& groupName ) = 0;
+
+ // !TBD: include section info (perhaps TestCase has an isSection flag and/ or a parent pointer
+ virtual void testCaseStarting( const TestCase& testInfo ) = 0;
+ virtual void assertionStarting( const AssertionInfo& assertionInfo ) = 0;
+
+ virtual void assertionEnding( const AssertionStats& assertionStats ) = 0;
+ virtual void testCaseEnding( const TestCaseStats& testCaseStats ) = 0;
+ virtual void testGroupEnding( const TestGroupStats& testGroupStats ) = 0;
+ virtual void testRunEnding( const TestRunStats& testRunStats ) = 0;
+ };
+ // !TBD: Derived helper that implements the streaming interface but holds the stats
+ // - declares a new interface where methods are called at the end of each event
+ // - this would be used by the JUnit reporter, for example.
+ // - it may be used by the basic reporter, too, but that would clear down the stack
+ // as it goes
+
+
struct IReporter : IShared {
virtual ~IReporter();
@@ -62,9 +108,9 @@ namespace Catch
virtual void StartGroup( const std::string& groupName ) = 0;
virtual void EndGroup( const std::string& groupName, const Totals& totals ) = 0;
- virtual void StartTestCase( const TestCaseInfo& testInfo ) = 0;
+ virtual void StartTestCase( const TestCase& testInfo ) = 0;
// TestCaseResult
- virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0;
+ virtual void EndTestCase( const TestCase& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0;
// SectionInfo
virtual void StartSection( const std::string& sectionName, const std::string& description ) = 0;
diff --git a/include/internal/catch_interfaces_runner.h b/include/internal/catch_interfaces_runner.h
index e59d64f2..bb81ffb4 100644
--- a/include/internal/catch_interfaces_runner.h
+++ b/include/internal/catch_interfaces_runner.h
@@ -13,7 +13,7 @@
#include <string>
namespace Catch {
- class TestCaseInfo;
+ class TestCase;
struct IRunner {
virtual ~IRunner();
diff --git a/include/internal/catch_interfaces_testcase.h b/include/internal/catch_interfaces_testcase.h
index 94ddf6f7..3f0c7078 100644
--- a/include/internal/catch_interfaces_testcase.h
+++ b/include/internal/catch_interfaces_testcase.h
@@ -22,12 +22,12 @@ namespace Catch {
virtual ~ITestCase();
};
- class TestCaseInfo;
+ class TestCase;
struct ITestCaseRegistry {
virtual ~ITestCaseRegistry();
- virtual const std::vector<TestCaseInfo>& getAllTests() const = 0;
- virtual std::vector<TestCaseInfo> getMatchingTestCases( const std::string& rawTestSpec ) const = 0;
+ virtual const std::vector<TestCase>& getAllTests() const = 0;
+ virtual std::vector<TestCase> getMatchingTestCases( const std::string& rawTestSpec ) const = 0;
};
}
diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp
index 82586a1b..2b41cda8 100644
--- a/include/internal/catch_list.hpp
+++ b/include/internal/catch_list.hpp
@@ -12,7 +12,7 @@
#include <limits>
namespace Catch {
- inline bool matchesFilters( const std::vector<TestCaseFilters>& filters, const TestCaseInfo& testCase ) {
+ inline bool matchesFilters( const std::vector<TestCaseFilters>& filters, const TestCase& testCase ) {
std::vector<TestCaseFilters>::const_iterator it = filters.begin();
std::vector<TestCaseFilters>::const_iterator itEnd = filters.end();
for(; it != itEnd; ++it )
@@ -38,8 +38,8 @@ namespace Catch {
std::cout << "All available test cases:\n";
else
std::cout << "Matching test cases:\n";
- std::vector<TestCaseInfo>::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin();
- std::vector<TestCaseInfo>::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end();
+ std::vector<TestCase>::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin();
+ std::vector<TestCase>::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end();
std::size_t matchedTests = 0;
for(; it != itEnd; ++it ) {
if( matchesFilters( config.filters, *it ) ) {
diff --git a/include/internal/catch_objc.hpp b/include/internal/catch_objc.hpp
index fabfda8f..dbc5a97f 100644
--- a/include/internal/catch_objc.hpp
+++ b/include/internal/catch_objc.hpp
@@ -93,7 +93,7 @@ namespace Catch {
std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
- getMutableRegistryHub().registerTest( TestCaseInfo( new OcMethod( cls, selector ), name.c_str(), desc.c_str(), SourceLineInfo() ) );
+ getMutableRegistryHub().registerTest( TestCase( new OcMethod( cls, selector ), name.c_str(), desc.c_str(), SourceLineInfo() ) );
noTestMethods++;
}
}
diff --git a/include/internal/catch_registry_hub.hpp b/include/internal/catch_registry_hub.hpp
index d66205de..05d602e1 100644
--- a/include/internal/catch_registry_hub.hpp
+++ b/include/internal/catch_registry_hub.hpp
@@ -40,7 +40,7 @@ namespace Catch {
virtual void registerReporter( const std::string& name, IReporterFactory* factory ) {
m_reporterRegistry.registerReporter( name, factory );
}
- virtual void registerTest( const TestCaseInfo& testInfo ) {
+ virtual void registerTest( const TestCase& testInfo ) {
m_testCaseRegistry.registerTest( testInfo );
}
virtual void registerTranslator( const IExceptionTranslator* translator ) {
diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp
index 5d4c2145..596fc1b8 100644
--- a/include/internal/catch_runner_impl.hpp
+++ b/include/internal/catch_runner_impl.hpp
@@ -81,14 +81,14 @@ namespace Catch {
Totals runMatching( const std::string& testSpec ) {
- std::vector<TestCaseInfo> matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec );
+ std::vector<TestCase> matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec );
Totals totals;
m_reporter->StartGroup( testSpec );
- std::vector<TestCaseInfo>::const_iterator it = matchingTests.begin();
- std::vector<TestCaseInfo>::const_iterator itEnd = matchingTests.end();
+ std::vector<TestCase>::const_iterator it = matchingTests.begin();
+ std::vector<TestCase>::const_iterator itEnd = matchingTests.end();
for(; it != itEnd; ++it )
totals += runTest( *it );
// !TBD use std::accumulate?
@@ -97,7 +97,7 @@ namespace Catch {
return totals;
}
- Totals runTest( const TestCaseInfo& testInfo ) {
+ Totals runTest( const TestCase& testInfo ) {
Totals prevTotals = m_totals;
std::string redirectedCout;
@@ -120,7 +120,7 @@ namespace Catch {
( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) ) {
m_totals.assertions.failed++;
deltaTotals = m_totals.delta( prevTotals );
- m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCaseInfo().getName() );
+ m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCase().getName() );
}
m_totals.testCases += deltaTotals.testCases;
@@ -228,7 +228,7 @@ namespace Catch {
virtual std::string getCurrentTestName() const {
return m_runningTest
- ? m_runningTest->getTestCaseInfo().getName()
+ ? m_runningTest->getTestCase().getName()
: "";
}
@@ -262,15 +262,15 @@ namespace Catch {
void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) {
try {
- m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal );
+ m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getLineInfo(), "", ResultDisposition::Normal );
m_runningTest->reset();
if( m_reporter->shouldRedirectStdout() ) {
StreamRedirect coutRedir( std::cout, redirectedCout );
StreamRedirect cerrRedir( std::cerr, redirectedCerr );
- m_runningTest->getTestCaseInfo().invoke();
+ m_runningTest->getTestCase().invoke();
}
else {
- m_runningTest->getTestCaseInfo().invoke();
+ m_runningTest->getTestCase().invoke();
}
m_runningTest->ranToCompletion();
}
diff --git a/include/internal/catch_running_test.hpp b/include/internal/catch_running_test.hpp
index 3fce399e..2bda148c 100644
--- a/include/internal/catch_running_test.hpp
+++ b/include/internal/catch_running_test.hpp
@@ -24,7 +24,7 @@ namespace Catch {
};
public:
- explicit RunningTest( const TestCaseInfo* info = NULL )
+ explicit RunningTest( const TestCase* info = NULL )
: m_info( info ),
m_runStatus( RanAtLeastOneSection ),
m_currentSection( &m_rootSection ),
@@ -97,7 +97,7 @@ namespace Catch {
m_currentSection = m_currentSection->getParent();
}
- const TestCaseInfo& getTestCaseInfo() const {
+ const TestCase& getTestCase() const {
return *m_info;
}
@@ -107,7 +107,7 @@ namespace Catch {
}
private:
- const TestCaseInfo* m_info;
+ const TestCase* m_info;
RunStatus m_runStatus;
SectionInfo m_rootSection;
SectionInfo* m_currentSection;
diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h
index 1fce27fb..5a7d7438 100644
--- a/include/internal/catch_test_case_info.h
+++ b/include/internal/catch_test_case_info.h
@@ -16,20 +16,20 @@
namespace Catch {
struct ITestCase;
-
- class TestCaseInfo {
+
+ class TestCase {
public:
- TestCaseInfo();
+ TestCase();
- TestCaseInfo( ITestCase* testCase,
+ TestCase( ITestCase* testCase,
const std::string& className,
const std::string& name,
const std::string& description,
const SourceLineInfo& lineInfo );
- TestCaseInfo( const TestCaseInfo& other, const std::string& name );
- TestCaseInfo( const TestCaseInfo& other );
+ TestCase( const TestCase& other, const std::string& name );
+ TestCase( const TestCase& other );
void invoke() const;
@@ -42,10 +42,10 @@ namespace Catch {
bool matchesTags( const std::string& tagPattern ) const;
const std::set<std::string>& getTags() const;
- void swap( TestCaseInfo& other );
- bool operator == ( const TestCaseInfo& other ) const;
- bool operator < ( const TestCaseInfo& other ) const;
- TestCaseInfo& operator = ( const TestCaseInfo& other );
+ void swap( TestCase& other );
+ bool operator == ( const TestCase& other ) const;
+ bool operator < ( const TestCase& other ) const;
+ TestCase& operator = ( const TestCase& other );
private:
Ptr<ITestCase> m_test;
diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp
index bb50759a..3d782e11 100644
--- a/include/internal/catch_test_case_info.hpp
+++ b/include/internal/catch_test_case_info.hpp
@@ -15,7 +15,7 @@
namespace Catch {
- TestCaseInfo::TestCaseInfo( ITestCase* testCase,
+ TestCase::TestCase( ITestCase* testCase,
const std::string& className,
const std::string& name,
const std::string& description,
@@ -32,7 +32,7 @@ namespace Catch {
m_isHidden = true;
}
- TestCaseInfo::TestCaseInfo()
+ TestCase::TestCase()
: m_test( NULL ),
m_className(),
m_name(),
@@ -40,7 +40,7 @@ namespace Catch {
m_isHidden( false )
{}
- TestCaseInfo::TestCaseInfo( const TestCaseInfo& other, const std::string& name )
+ TestCase::TestCase( const TestCase& other, const std::string& name )
: m_test( other.m_test ),
m_className( other.m_className ),
m_name( name ),
@@ -50,7 +50,7 @@ namespace Catch {
m_isHidden( other.m_isHidden )
{}
- TestCaseInfo::TestCaseInfo( const TestCaseInfo& other )
+ TestCase::TestCase( const TestCase& other )
: m_test( other.m_test ),
m_className( other.m_className ),
m_name( other.m_name ),
@@ -60,40 +60,40 @@ namespace Catch {
m_isHidden( other.m_isHidden )
{}
- void TestCaseInfo::invoke() const {
+ void TestCase::invoke() const {
m_test->invoke();
}
- const std::string& TestCaseInfo::getClassName() const {
+ const std::string& TestCase::getClassName() const {
return m_className;
}
- const std::string& TestCaseInfo::getName() const {
+ const std::string& TestCase::getName() const {
return m_name;
}
- const std::string& TestCaseInfo::getDescription() const {
+ const std::string& TestCase::getDescription() const {
return m_description;
}
- const SourceLineInfo& TestCaseInfo::getLineInfo() const {
+ const SourceLineInfo& TestCase::getLineInfo() const {
return m_lineInfo;
}
- bool TestCaseInfo::isHidden() const {
+ bool TestCase::isHidden() const {
return m_isHidden;
}
- bool TestCaseInfo::hasTag( const std::string& tag ) const {
+ bool TestCase::hasTag( const std::string& tag ) const {
return m_tags.find( tag ) != m_tags.end();
}
- bool TestCaseInfo::matchesTags( const std::string& tagPattern ) const {
+ bool TestCase::matchesTags( const std::string& tagPattern ) const {
TagExpression exp;
TagExpressionParser( exp ).parse( tagPattern );
return exp.matches( m_tags );
}
- const std::set<std::string>& TestCaseInfo::getTags() const {
+ const std::set<std::string>& TestCase::getTags() const {
return m_tags;
}
- void TestCaseInfo::swap( TestCaseInfo& other ) {
+ void TestCase::swap( TestCase& other ) {
m_test.swap( other.m_test );
m_className.swap( other.m_className );
m_name.swap( other.m_name );
@@ -101,17 +101,17 @@ namespace Catch {
std::swap( m_lineInfo, other.m_lineInfo );
}
- bool TestCaseInfo::operator == ( const TestCaseInfo& other ) const {
+ bool TestCase::operator == ( const TestCase& other ) const {
return m_test.get() == other.m_test.get() &&
m_name == other.m_name &&
m_className == other.m_className;
}
- bool TestCaseInfo::operator < ( const TestCaseInfo& other ) const {
+ bool TestCase::operator < ( const TestCase& other ) const {
return m_name < other.m_name;
}
- TestCaseInfo& TestCaseInfo::operator = ( const TestCaseInfo& other ) {
- TestCaseInfo temp( other );
+ TestCase& TestCase::operator = ( const TestCase& other ) {
+ TestCase temp( other );
swap( temp );
return *this;
}
diff --git a/include/internal/catch_test_case_registry_impl.hpp b/include/internal/catch_test_case_registry_impl.hpp
index adaefc35..715a96e9 100644
--- a/include/internal/catch_test_case_registry_impl.hpp
+++ b/include/internal/catch_test_case_registry_impl.hpp
@@ -25,11 +25,11 @@ namespace Catch {
TestRegistry() : m_unnamedCount( 0 ) {}
virtual ~TestRegistry();
- virtual void registerTest( const TestCaseInfo& testInfo ) {
+ virtual void registerTest( const TestCase& testInfo ) {
if( testInfo.getName() == "" ) {
std::ostringstream oss;
oss << testInfo.getName() << "unnamed/" << ++m_unnamedCount;
- return registerTest( TestCaseInfo( testInfo, oss.str() ) );
+ return registerTest( TestCase( testInfo, oss.str() ) );
}
if( m_functions.find( testInfo ) == m_functions.end() ) {
@@ -39,7 +39,7 @@ namespace Catch {
m_nonHiddenFunctions.push_back( testInfo );
}
else {
- const TestCaseInfo& prev = *m_functions.find( testInfo );
+ const TestCase& prev = *m_functions.find( testInfo );
std::cerr << "error: TEST_CASE( \"" << testInfo.getName() << "\" ) already defined.\n"
<< "\tFirst seen at " << SourceLineInfo( prev.getLineInfo() ) << "\n"
<< "\tRedefined at " << SourceLineInfo( testInfo.getLineInfo() ) << std::endl;
@@ -47,36 +47,36 @@ namespace Catch {
}
}
- virtual const std::vector<TestCaseInfo>& getAllTests() const {
+ virtual const std::vector<TestCase>& getAllTests() const {
return m_functionsInOrder;
}
- virtual const std::vector<TestCaseInfo>& getAllNonHiddenTests() const {
+ virtual const std::vector<TestCase>& getAllNonHiddenTests() const {
return m_nonHiddenFunctions;
}
// !TBD deprecated
- virtual std::vector<TestCaseInfo> getMatchingTestCases( const std::string& rawTestSpec ) const {
- std::vector<TestCaseInfo> matchingTests;
+ virtual std::vector<TestCase> getMatchingTestCases( const std::string& rawTestSpec ) const {
+ std::vector<TestCase> matchingTests;
getMatchingTestCases( rawTestSpec, matchingTests );
return matchingTests;
}
// !TBD deprecated
- virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector<TestCaseInfo>& matchingTestsOut ) const {
+ virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector<TestCase>& matchingTestsOut ) const {
TestCaseFilter filter( rawTestSpec );
- std::vector<TestCaseInfo>::const_iterator it = m_functionsInOrder.begin();
- std::vector<TestCaseInfo>::const_iterator itEnd = m_functionsInOrder.end();
+ std::vector<TestCase>::const_iterator it = m_functionsInOrder.begin();
+ std::vector<TestCase>::const_iterator itEnd = m_functionsInOrder.end();
for(; it != itEnd; ++it ) {
if( filter.shouldInclude( *it ) ) {
matchingTestsOut.push_back( *it );
}
}
}
- virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector<TestCaseInfo>& matchingTestsOut ) const {
- std::vector<TestCaseInfo>::const_iterator it = m_functionsInOrder.begin();
- std::vector<TestCaseInfo>::const_iterator itEnd = m_functionsInOrder.end();
+ virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector<TestCase>& matchingTestsOut ) const {
+ std::vector<TestCase>::const_iterator it = m_functionsInOrder.begin();
+ std::vector<TestCase>::const_iterator itEnd = m_functionsInOrder.end();
// !TBD: replace with algorithm
for(; it != itEnd; ++it )
if( filters.shouldInclude( *it ) )
@@ -85,9 +85,9 @@ namespace Catch {
private:
- std::set<TestCaseInfo> m_functions;
- std::vector<TestCaseInfo> m_functionsInOrder;
- std::vector<TestCaseInfo> m_nonHiddenFunctions;
+ std::set<TestCase> m_functions;
+ std::vector<TestCase> m_functionsInOrder;
+ std::vector<TestCase> m_nonHiddenFunctions;
size_t m_unnamedCount;
};
@@ -138,7 +138,7 @@ namespace Catch {
const char* description,
const SourceLineInfo& lineInfo ) {
- getMutableRegistryHub().registerTest( TestCaseInfo( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) );
+ getMutableRegistryHub().registerTest( TestCase( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) );
}
} // end namespace Catch
diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h
index 2c028d4e..3e726d8c 100644
--- a/include/internal/catch_test_spec.h
+++ b/include/internal/catch_test_spec.h
@@ -64,7 +64,7 @@ namespace Catch {
return m_filterType;
}
- bool shouldInclude( const TestCaseInfo& testCase ) const {
+ bool shouldInclude( const TestCase& testCase ) const {
return isMatch( testCase ) == (m_filterType == IfFilterMatches::IncludeTests);
}
private:
@@ -74,7 +74,7 @@ namespace Catch {
#pragma clang diagnostic ignored "-Wunreachable-code"
#endif
- bool isMatch( const TestCaseInfo& testCase ) const {
+ bool isMatch( const TestCase& testCase ) const {
const std::string& name = testCase.getName();
switch( m_wildcardPosition ) {
@@ -121,7 +121,7 @@ namespace Catch {
m_tagExpressions.push_back( exp );
}
- bool shouldInclude( const TestCaseInfo& testCase ) const {
+ bool shouldInclude( const TestCase& testCase ) const {
if( !m_tagExpressions.empty() ) {
std::vector<TagExpression>::const_iterator it = m_tagExpressions.begin();
std::vector<TagExpression>::const_iterator itEnd = m_tagExpressions.end();
diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp
index 647fede5..508d18e5 100644
--- a/include/reporters/catch_reporter_basic.hpp
+++ b/include/reporters/catch_reporter_basic.hpp
@@ -120,7 +120,7 @@ namespace Catch {
}
}
- virtual void StartTestCase( const TestCaseInfo& testInfo ) {
+ virtual void StartTestCase( const TestCase& testInfo ) {
m_testSpan = testInfo.getName();
}
@@ -264,7 +264,7 @@ namespace Catch {
m_config.stream << std::endl;
}
- virtual void EndTestCase( const TestCaseInfo& testInfo,
+ virtual void EndTestCase( const TestCas