Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Removed redundant MetaTestRunner

Commit
ca7292e3a74d4a6e99309618ad483171f428a35b
Author
Phil Nash ·
Parents
200197f0b2ec

Files · Download .tar.gz

Changes

 projects/SelfTest/ExceptionTests.cpp               |   2 -
 projects/SelfTest/MiscTests.cpp                    |   1 -
 projects/SelfTest/TestMain.cpp                     |  17 +-
 projects/SelfTest/catch_self_test.cpp              |  31 ----
 projects/SelfTest/catch_self_test.hpp              | 177 ---------------------
 projects/VS2008/TestCatch/TestCatch/ReadMe.txt     |  33 ----
 .../VS2008/TestCatch/TestCatch/TestCatch.vcproj    |  12 --
 projects/VS2010/TestCatch/TestCatch/TestCatch.cpp  |   8 -
 .../VS2010/TestCatch/TestCatch/TestCatch.vcxproj   |   2 -
 .../CatchSelfTest.xcodeproj/project.pbxproj        |   6 -
 10 files changed, 8 insertions(+), 281 deletions(-)

diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp
index d15c3f67..2dac0c15 100644
--- a/projects/SelfTest/ExceptionTests.cpp
+++ b/projects/SelfTest/ExceptionTests.cpp
@@ -11,8 +11,6 @@
 #include <string>
 #include <stdexcept>
 
-#include "catch_self_test.hpp"
-
 namespace
 {
     inline int thisThrows()
diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp
index 4a9f172f..cb93eb55 100644
--- a/projects/SelfTest/MiscTests.cpp
+++ b/projects/SelfTest/MiscTests.cpp
@@ -7,7 +7,6 @@
  */
 
 #include "catch.hpp"
-#include "catch_self_test.hpp"
 
 #include <iostream>
 
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp
index 00796e93..1d7211e5 100644
--- a/projects/SelfTest/TestMain.cpp
+++ b/projects/SelfTest/TestMain.cpp
@@ -5,22 +5,21 @@
  *  Distributed under the Boost Software License, Version 1.0. (See accompanying
  *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  */
+
+#define CATCH_CONFIG_MAIN
+#include "catch.hpp"
+
 #ifdef __clang__
 #pragma clang diagnostic ignored "-Wpadded"
+#pragma clang diagnostic ignored "-Wweak-vtables"
 #endif
 
-#include "catch_self_test.hpp"
 #include "internal/catch_text.h"
 #include "internal/catch_console_colour.hpp"
+#include "internal/catch_commandline.hpp"
+#include "internal/catch_test_spec.h"
 
-
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#endif
-
-#include "../../include/internal/catch_commandline.hpp"
-#include "../../include/internal/catch_test_spec.h"
-#include "../../include/reporters/catch_reporter_xml.hpp"
+#include "reporters/catch_reporter_xml.hpp"
 
 template<size_t size>
 void parseIntoConfig( const char * (&argv)[size], Catch::ConfigData& config ) {
diff --git a/projects/SelfTest/catch_self_test.cpp b/projects/SelfTest/catch_self_test.cpp
deleted file mode 100644
index c5153d68..00000000
--- a/projects/SelfTest/catch_self_test.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  Created by Phil on 14/02/2012.
- *  Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#define CATCH_CONFIG_MAIN
-#include "catch_self_test.hpp"
-
-namespace Catch{
-    
-    NullStreamingReporter::~NullStreamingReporter() {}
-
-    Totals EmbeddedRunner::runMatching( const std::string& rawTestSpec, std::size_t groupIndex, std::size_t groupsCount, const std::string& ) {
-        std::ostringstream oss;
-        Ptr<Config> config = new Config();
-        config->setStreamBuf( oss.rdbuf() );
-        
-        Totals totals;
-
-        // Scoped because RunContext doesn't report EndTesting until its destructor
-        {
-            RunContext runner( config.get(), m_reporter.get() );
-            totals = runner.runMatching( rawTestSpec, groupIndex, groupsCount );
-        }
-        return totals;
-    }
-
-}
diff --git a/projects/SelfTest/catch_self_test.hpp b/projects/SelfTest/catch_self_test.hpp
deleted file mode 100644
index 1629644d..00000000
--- a/projects/SelfTest/catch_self_test.hpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- *  Created by Phil on 14/01/2011.
- *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_SELF_TEST_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_SELF_TEST_HPP_INCLUDED
-
-#include "catch.hpp"
-
-// Use this external guard here as if we're using the single header version
-// this will already be defined
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
-#include "catch_interfaces_registry_hub.h"
-#endif
-
-#include "set"
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace Catch {
-
-    class NullStreamingReporter : public SharedImpl<IStreamingReporter> {
-    public:
-
-        virtual ~NullStreamingReporter();
-
-        static std::string getDescription() {
-            return "null reporter";
-        }
-        
-    private: // IStreamingReporter
-        
-        virtual ReporterPreferences getPreferences() const {
-            return ReporterPreferences();
-        }
-
-        virtual void noMatchingTestCases( std::string const& ) {}
-        virtual void testRunStarting( TestRunInfo const& ) {}
-        virtual void testGroupStarting( GroupInfo const& ) {}
-        virtual void testCaseStarting( TestCaseInfo const& ) {}
-        virtual void sectionStarting( SectionInfo const& ) {}
-        virtual void assertionStarting( AssertionInfo const& ) {}
-        virtual bool assertionEnded( AssertionStats const& ) { return false; }
-        virtual void sectionEnded( SectionStats const& ) {}
-        virtual void testCaseEnded( TestCaseStats const& ) {}
-        virtual void testGroupEnded( TestGroupStats const& ) {}
-        virtual void testRunEnded( TestRunStats const& ) {}
-    };
-
-    class EmbeddedRunner {
-
-    public:
-        EmbeddedRunner() : m_reporter( new NullStreamingReporter() ) {}
-        
-        Totals runMatching( const std::string& rawTestSpec,
-                            std::size_t groupIndex,
-                            std::size_t groupsCount,
-                            const std::string& reporter = "console" );
-        
-    private:
-        Ptr<IStreamingReporter> m_reporter;
-    };
-
-    class MetaTestRunner {
-
-    public:
-        struct Expected { enum Result {
-            ToSucceed,
-            ToFail
-        }; };
-        
-        MetaTestRunner( Expected::Result expectedResult, std::size_t groupIndex, std::size_t groupsCount )
-        :   m_expectedResult( expectedResult ),
-            m_groupIndex( groupIndex ),
-            m_groupsCount( groupsCount )
-        {}
-        
-        static void runMatching(    const std::string& testSpec, 
-                                    Expected::Result expectedResult,
-                                    std::size_t groupIndex,
-                                    std::size_t groupsCount ) {
-            forEach(    getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ), 
-                        MetaTestRunner( expectedResult, groupIndex, groupsCount ) );
-        }
-        
-        void operator()( const TestCase& testCase ) {
-            std::string name;
-            Totals totals;
-            {
-                EmbeddedRunner runner;
-                name = testCase.getTestCaseInfo().name;
-                totals = runner.runMatching( name, m_groupIndex, m_groupsCount );
-            }
-            switch( m_expectedResult ) {
-                case Expected::ToSucceed:
-                    if( totals.assertions.failed > 0 ) {
-                        FAIL( "Expected test case '"
-                             << name
-                             << "' to succeed but there was/ were " 
-                             << totals.assertions.failed << " failure(s)" );
-                    }
-                    else {
-                        SUCCEED( "Tests passed, as expected" );
-                    }
-                    break;
-                case Expected::ToFail:
-                    if( totals.assertions.failed == 0 ) {
-                        FAIL( "Expected test case '"
-                             << name
-                             << "' to fail but there was/ were " 
-                             << totals.assertions.passed << " success(es)" );
-                    }
-                    else {
-                        SUCCEED( "Tests failed, as expected" );
-                    }
-                    break;
-            }        
-        }
-
-    private:
-        Expected::Result m_expectedResult;
-        std::size_t m_groupIndex;
-        std::size_t m_groupsCount;
-    };
-    
-
-    struct LineInfoRegistry {
-
-        static LineInfoRegistry& get() {
-            static LineInfoRegistry s_instance;
-            return s_instance;
-        }
-        
-        void registerLineInfo(  const std::string& name, 
-                                const SourceLineInfo& info ) {
-            m_registry.insert( std::make_pair( name, info ) );
-        }
-        
-        const SourceLineInfo* find( const std::string& name ) const {
-            std::map<std::string, SourceLineInfo>::const_iterator it = m_registry.find( name );
-            return it == m_registry.end() ? NULL : &(it->second);
-        }
-
-        const std::string infoForName( const std::string& name ) const {
-            std::map<std::string, SourceLineInfo>::const_iterator it = m_registry.find( name );
-            if( it == m_registry.end() )
-                return "";
-            std::ostringstream oss;
-            oss << it->second;
-            return oss.str();
-        }
-        
-        std::map<std::string, SourceLineInfo> m_registry;
-    };
-    
-    struct LineInfoRegistrar {
-        LineInfoRegistrar( const char* name, const SourceLineInfo& lineInfo ) {
-            LineInfoRegistry::get().registerLineInfo( name, lineInfo );
-        }
-    };
-    
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#define CATCH_REGISTER_LINE_INFO( name ) ::Catch::LineInfoRegistrar INTERNAL_CATCH_UNIQUE_NAME( lineRegistrar )( name, ::Catch::SourceLineInfo( __FILE__, __LINE__ ) );
-#define CATCH_GET_LINE_INFO( name ) ::Catch::LineInfoRegistry::get().infoForName( name )
-
-#endif // TWOBLUECUBES_CATCH_SELF_TEST_HPP_INCLUDED
diff --git a/projects/VS2008/TestCatch/TestCatch/ReadMe.txt b/projects/VS2008/TestCatch/TestCatch/ReadMe.txt
deleted file mode 100644
index 139e3319..00000000
--- a/projects/VS2008/TestCatch/TestCatch/ReadMe.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-========================================================================
-    CONSOLE APPLICATION : TestCatch Project Overview
-========================================================================
-
-AppWizard has created this TestCatch application for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your TestCatch application.
-
-
-TestCatch.vcproj
-    This is the main project file for VC++ projects generated using an Application Wizard.
-    It contains information about the version of Visual C++ that generated the file, and
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-TestCatch.cpp
-    This is the main application source file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named TestCatch.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj b/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj
index 434c7411..d40c925d 100644
--- a/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj
+++ b/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj
@@ -296,10 +296,6 @@
 					RelativePath="..\..\..\..\include\internal\catch_section.hpp"
 					>
 				</File>
-				<File
-					RelativePath="..\..\..\..\include\internal\catch_self_test.hpp"
-					>
-				</File>
 				<File
 					RelativePath="..\..\..\..\include\internal\catch_stream.hpp"
 					>
@@ -351,10 +347,6 @@
 				RelativePath="..\..\..\SelfTest\BDDTests.cpp"
 				>
 			</File>
-			<File
-				RelativePath="..\..\..\SelfTest\catch_self_test.cpp"
-				>
-			</File>
 			<File
 				RelativePath="..\..\..\SelfTest\ClassTests.cpp"
 				>
@@ -396,10 +388,6 @@
 				>
 			</File>
 		</Filter>
-		<File
-			RelativePath=".\ReadMe.txt"
-			>
-		</File>
 	</Files>
 	<Globals>
 	</Globals>
diff --git a/projects/VS2010/TestCatch/TestCatch/TestCatch.cpp b/projects/VS2010/TestCatch/TestCatch/TestCatch.cpp
deleted file mode 100644
index 8dd2067d..00000000
--- a/projects/VS2010/TestCatch/TestCatch/TestCatch.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// TestCatch.cpp : Defines the entry point for the console application.
-//
-
-int main(int argc, char* argv[])
-{
-	return 0;
-}
-
diff --git a/projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj b/projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj
index 619378e1..a8f60653 100644
--- a/projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj
+++ b/projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj
@@ -96,7 +96,6 @@
     <ClCompile Include="..\..\..\SelfTest\CmdLineTests.cpp" />
     <ClCompile Include="..\..\..\SelfTest\SectionTrackerTests.cpp" />
     <ClCompile Include="..\..\..\SelfTest\TestMain.cpp" />
-    <ClCompile Include="..\..\..\SelfTest\catch_self_test.cpp" />
     <ClCompile Include="..\..\..\SelfTest\ClassTests.cpp" />
     <ClCompile Include="..\..\..\SelfTest\ConditionTests.cpp" />
     <ClCompile Include="..\..\..\SelfTest\ExceptionTests.cpp" />
@@ -135,7 +134,6 @@
     <ClInclude Include="..\..\..\..\include\internal\catch_resultinfo.hpp" />
     <ClInclude Include="..\..\..\..\include\internal\catch_runner_impl.hpp" />
     <ClInclude Include="..\..\..\..\include\internal\catch_section.hpp" />
-    <ClInclude Include="..\..\..\..\include\internal\catch_self_test.hpp" />
     <ClInclude Include="..\..\..\..\include\internal\catch_stream.hpp" />
     <ClInclude Include="..\..\..\..\include\internal\catch_test_case_info.hpp" />
     <ClInclude Include="..\..\..\..\include\internal\catch_test_case_registry_impl.hpp" />
diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
index 16b0a4af..30b0b29e 100644
--- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
+++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
@@ -36,7 +36,6 @@
 		4AB3D9A01616219100C9A0F8 /* catch_interfaces_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AB3D99F1616219100C9A0F8 /* catch_interfaces_config.cpp */; };
 		4AB3D9A2161621B500C9A0F8 /* catch_interfaces_generators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AB3D9A1161621B500C9A0F8 /* catch_interfaces_generators.cpp */; };
 		4ACE21CC166CA1B300FB5509 /* catch_option.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACE21CA166CA1B300FB5509 /* catch_option.cpp */; };
-		4AE1840B14EE4F230066340D /* catch_self_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AE1840A14EE4F230066340D /* catch_self_test.cpp */; };
 		4AEE032016142F910071E950 /* catch_common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AEE031F16142F910071E950 /* catch_common.cpp */; };
 		4AEE032316142FC70071E950 /* catch_debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AEE032216142FC70071E950 /* catch_debugger.cpp */; };
 		4AEE032516142FF10071E950 /* catch_stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AEE032416142FF10071E950 /* catch_stream.cpp */; };
@@ -95,7 +94,6 @@
 		4A6D0C20149B3D3B00DB3EAA /* CatchSelfTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CatchSelfTest; sourceTree = BUILT_PRODUCTS_DIR; };
 		4A6D0C26149B3D3B00DB3EAA /* CatchSelfTest.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = CatchSelfTest.1; sourceTree = "<group>"; };
 		4A6D0C2D149B3D9E00DB3EAA /* ApproxTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ApproxTests.cpp; path = ../../../SelfTest/ApproxTests.cpp; sourceTree = "<group>"; };
-		4A6D0C2E149B3D9E00DB3EAA /* catch_self_test.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = catch_self_test.hpp; path = ../../../SelfTest/catch_self_test.hpp; sourceTree = "<group>"; };
 		4A6D0C2F149B3D9E00DB3EAA /* ClassTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClassTests.cpp; path = ../../../SelfTest/ClassTests.cpp; sourceTree = "<group>"; };
 		4A6D0C30149B3D9E00DB3EAA /* ConditionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConditionTests.cpp; path = ../../../SelfTest/ConditionTests.cpp; sourceTree = "<group>"; };
 		4A6D0C31149B3D9E00DB3EAA /* ExceptionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExceptionTests.cpp; path = ../../../SelfTest/ExceptionTests.cpp; sourceTree = "<group>"; };
@@ -163,7 +161,6 @@
 		4AC91CD0155D8DA600DC5117 /* catch_expression_decomposer.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_decomposer.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
 		4ACE21C8166CA19700FB5509 /* catch_option.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_option.hpp; sourceTree = "<group>"; };
 		4ACE21CA166CA1B300FB5509 /* catch_option.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_option.cpp; path = ../../../SelfTest/SurrogateCpps/catch_option.cpp; sourceTree = "<group>"; };
-		4AE1840A14EE4F230066340D /* catch_self_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_self_test.cpp; path = ../../../SelfTest/catch_self_test.cpp; sourceTree = "<group>"; };
 		4AEE031F16142F910071E950 /* catch_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_common.cpp; path = ../../../SelfTest/SurrogateCpps/catch_common.cpp; sourceTree = "<group>"; };
 		4AEE032216142FC70071E950 /* catch_debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_debugger.cpp; path = ../../../SelfTest/SurrogateCpps/catch_debugger.cpp; sourceTree = "<group>"; };
 		4AEE032416142FF10071E950 /* catch_stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_stream.cpp; path = ../../../SelfTest/SurrogateCpps/catch_stream.cpp; sourceTree = "<group>"; };
@@ -220,8 +217,6 @@
 			isa = PBXGroup;
 			children = (
 				4A6D0C35149B3D9E00DB3EAA /* TestMain.cpp */,
-				4A6D0C2E149B3D9E00DB3EAA /* catch_self_test.hpp */,
-				4AE1840A14EE4F230066340D /* catch_self_test.cpp */,
 				266E9AD317290E710061DAB2 /* Introspective Tests */,
 				4A6D0C40149B3DAB00DB3EAA /* Tests */,
 				4A6D0C41149B3DE900DB3EAA /* Catch */,
@@ -499,7 +494,6 @@
 				4A6D0C3D149B3D9E00DB3EAA /* MiscTests.cpp in Sources */,
 				4A6D0C3E149B3D9E00DB3EAA /* TestMain.cpp in Sources */,
 				4A6D0C3F149B3D9E00DB3EAA /* TrickyTests.cpp in Sources */,
-				4AE1840B14EE4F230066340D /* catch_self_test.cpp in Sources */,
 				4A8E4DD2160A352200194CBD /* catch_tags.cpp in Sources */,
 				4AEE032016142F910071E950 /* catch_common.cpp in Sources */,
 				4AEE032316142FC70071E950 /* catch_debugger.cpp in Sources */,