From 0847a0fa899fb5bdf8a3b094f7b685bb3428410c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 1 Feb 2011 16:09:18 +0000 Subject: [PATCH] Fixed OC bindings project following recent changes --- .../OCTest/OCTest.xcodeproj/project.pbxproj | 84 ++++++++++++------- catch_objc.hpp | 15 ++-- 2 files changed, 64 insertions(+), 35 deletions(-) diff --git a/Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj b/Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj index b354076..838c30b 100644 --- a/Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj +++ b/Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj @@ -32,31 +32,45 @@ 08FB7796FE84155DC02AAC07 /* Main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Main.mm; sourceTree = ""; }; 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32A70AAB03705E1F00C91783 /* OCTest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCTest_Prefix.pch; sourceTree = ""; }; + 4A565D1812F865AD002A820A /* catch_with_main.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_with_main.hpp; path = ../../../catch_with_main.hpp; sourceTree = SOURCE_ROOT; }; + 4A565D1912F865CF002A820A /* catch_capture.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_capture.hpp; sourceTree = ""; }; + 4A565D1A12F865CF002A820A /* catch_commandline.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_commandline.hpp; sourceTree = ""; }; + 4A565D1B12F865CF002A820A /* catch_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_common.h; sourceTree = ""; }; + 4A565D1C12F865CF002A820A /* catch_config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_config.hpp; sourceTree = ""; }; + 4A565D1D12F865CF002A820A /* catch_context.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_context.hpp; sourceTree = ""; }; + 4A565D1E12F865CF002A820A /* catch_debugger.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_debugger.hpp; sourceTree = ""; }; + 4A565D1F12F865CF002A820A /* catch_generators_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_generators_impl.hpp; sourceTree = ""; }; + 4A565D2012F865CF002A820A /* catch_generators.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_generators.hpp; sourceTree = ""; }; + 4A565D2112F865CF002A820A /* catch_hub_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_hub_impl.hpp; sourceTree = ""; }; + 4A565D2212F865CF002A820A /* catch_hub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_hub.h; sourceTree = ""; }; + 4A565D2312F865CF002A820A /* catch_interfaces_capture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_capture.h; sourceTree = ""; }; + 4A565D2412F865CF002A820A /* catch_interfaces_reporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_reporter.h; sourceTree = ""; }; + 4A565D2512F865CF002A820A /* catch_interfaces_runner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_runner.h; sourceTree = ""; }; + 4A565D2612F865CF002A820A /* catch_interfaces_testcase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_testcase.h; sourceTree = ""; }; + 4A565D2712F865CF002A820A /* catch_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_list.hpp; sourceTree = ""; }; + 4A565D2812F865CF002A820A /* catch_reporter_registrars.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_registrars.hpp; sourceTree = ""; }; + 4A565D2912F865CF002A820A /* catch_reporter_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_registry.hpp; sourceTree = ""; }; + 4A565D2A12F865CF002A820A /* catch_result_type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_result_type.h; sourceTree = ""; }; + 4A565D2B12F865CF002A820A /* catch_resultinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_resultinfo.hpp; sourceTree = ""; }; + 4A565D2C12F865CF002A820A /* catch_runner_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_runner_impl.hpp; sourceTree = ""; }; + 4A565D2D12F865CF002A820A /* catch_section.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_section.hpp; sourceTree = ""; }; + 4A565D2E12F865CF002A820A /* catch_self_test.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_self_test.hpp; sourceTree = ""; }; + 4A565D2F12F865CF002A820A /* catch_stream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_stream.hpp; sourceTree = ""; }; + 4A565D3012F865CF002A820A /* catch_test_case_info.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_test_case_info.hpp; sourceTree = ""; }; + 4A565D3112F865CF002A820A /* catch_test_case_registry_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_test_case_registry_impl.hpp; sourceTree = ""; }; + 4A565D3212F865CF002A820A /* catch_test_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_test_registry.hpp; sourceTree = ""; }; + 4A565D3312F865CF002A820A /* catch_xmlwriter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_xmlwriter.hpp; sourceTree = ""; }; 4A5953B3128E95B8009DC1B9 /* TestObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestObj.h; sourceTree = ""; }; 4A5953B4128E95B8009DC1B9 /* TestObj.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestObj.m; sourceTree = ""; }; 4A5953B6128E95D6009DC1B9 /* OCTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OCTest.mm; sourceTree = ""; }; 4A5953EF128E9A61009DC1B9 /* CatchOCTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CatchOCTestCase.h; sourceTree = ""; }; 4A5953F0128E9A61009DC1B9 /* CatchOCTestCase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CatchOCTestCase.mm; sourceTree = ""; }; - 4AFDF58312CA9E4000F15202 /* catch_default_main.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_default_main.hpp; path = ../../../catch_default_main.hpp; sourceTree = SOURCE_ROOT; }; 4AFDF58412CA9E4000F15202 /* catch_objc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_objc.hpp; path = ../../../catch_objc.hpp; sourceTree = SOURCE_ROOT; }; 4AFDF58512CA9E4000F15202 /* catch_reporter_basic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_basic.hpp; path = ../../../catch_reporter_basic.hpp; sourceTree = SOURCE_ROOT; }; 4AFDF58612CA9E4000F15202 /* catch_reporter_junit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_junit.hpp; path = ../../../catch_reporter_junit.hpp; sourceTree = SOURCE_ROOT; }; 4AFDF58712CA9E4000F15202 /* catch_reporter_xml.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_xml.hpp; path = ../../../catch_reporter_xml.hpp; sourceTree = SOURCE_ROOT; }; 4AFDF58812CA9E4000F15202 /* catch_runner.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_runner.hpp; path = ../../../catch_runner.hpp; sourceTree = SOURCE_ROOT; }; 4AFDF58912CA9E4000F15202 /* catch.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch.hpp; path = ../../../catch.hpp; sourceTree = SOURCE_ROOT; }; - 4AFDF58B12CA9E4000F15202 /* catch_capture.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_capture.hpp; sourceTree = ""; }; - 4AFDF58C12CA9E4000F15202 /* catch_commandline.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_commandline.hpp; sourceTree = ""; }; - 4AFDF58D12CA9E4000F15202 /* catch_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_common.h; sourceTree = ""; }; - 4AFDF58E12CA9E4000F15202 /* catch_debugger.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_debugger.hpp; sourceTree = ""; }; - 4AFDF58F12CA9E4000F15202 /* catch_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_list.hpp; sourceTree = ""; }; - 4AFDF59012CA9E4000F15202 /* catch_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_registry.hpp; sourceTree = ""; }; - 4AFDF59112CA9E4000F15202 /* catch_reporter_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_registry.hpp; sourceTree = ""; }; - 4AFDF59212CA9E4000F15202 /* catch_resultinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_resultinfo.hpp; sourceTree = ""; }; - 4AFDF59312CA9E4000F15202 /* catch_runner_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_runner_impl.hpp; sourceTree = ""; }; - 4AFDF59412CA9E4000F15202 /* catch_runnerconfig.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_runnerconfig.hpp; sourceTree = ""; }; - 4AFDF59512CA9E4000F15202 /* catch_section.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_section.hpp; sourceTree = ""; }; - 4AFDF59612CA9E4000F15202 /* catch_testcaseinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_testcaseinfo.hpp; sourceTree = ""; }; - 4AFDF59712CA9E4000F15202 /* catch_xmlwriter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_xmlwriter.hpp; sourceTree = ""; }; 4AFDF59812CA9E8600F15202 /* catch_objc_main.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_objc_main.hpp; path = ../../../catch_objc_main.hpp; sourceTree = SOURCE_ROOT; }; 8DD76FA10486AA7600D96B5E /* OCTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = OCTest; sourceTree = BUILT_PRODUCTS_DIR; }; C6859EA3029092ED04C91782 /* OCTest.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = OCTest.1; sourceTree = ""; }; @@ -119,8 +133,8 @@ 4AFDF58212CA9E2800F15202 /* Catch */ = { isa = PBXGroup; children = ( + 4A565D1812F865AD002A820A /* catch_with_main.hpp */, 4AFDF59812CA9E8600F15202 /* catch_objc_main.hpp */, - 4AFDF58312CA9E4000F15202 /* catch_default_main.hpp */, 4AFDF58412CA9E4000F15202 /* catch_objc.hpp */, 4AFDF58512CA9E4000F15202 /* catch_reporter_basic.hpp */, 4AFDF58612CA9E4000F15202 /* catch_reporter_junit.hpp */, @@ -135,19 +149,33 @@ 4AFDF58A12CA9E4000F15202 /* internal */ = { isa = PBXGroup; children = ( - 4AFDF58B12CA9E4000F15202 /* catch_capture.hpp */, - 4AFDF58C12CA9E4000F15202 /* catch_commandline.hpp */, - 4AFDF58D12CA9E4000F15202 /* catch_common.h */, - 4AFDF58E12CA9E4000F15202 /* catch_debugger.hpp */, - 4AFDF58F12CA9E4000F15202 /* catch_list.hpp */, - 4AFDF59012CA9E4000F15202 /* catch_registry.hpp */, - 4AFDF59112CA9E4000F15202 /* catch_reporter_registry.hpp */, - 4AFDF59212CA9E4000F15202 /* catch_resultinfo.hpp */, - 4AFDF59312CA9E4000F15202 /* catch_runner_impl.hpp */, - 4AFDF59412CA9E4000F15202 /* catch_runnerconfig.hpp */, - 4AFDF59512CA9E4000F15202 /* catch_section.hpp */, - 4AFDF59612CA9E4000F15202 /* catch_testcaseinfo.hpp */, - 4AFDF59712CA9E4000F15202 /* catch_xmlwriter.hpp */, + 4A565D1912F865CF002A820A /* catch_capture.hpp */, + 4A565D1A12F865CF002A820A /* catch_commandline.hpp */, + 4A565D1B12F865CF002A820A /* catch_common.h */, + 4A565D1C12F865CF002A820A /* catch_config.hpp */, + 4A565D1D12F865CF002A820A /* catch_context.hpp */, + 4A565D1E12F865CF002A820A /* catch_debugger.hpp */, + 4A565D1F12F865CF002A820A /* catch_generators_impl.hpp */, + 4A565D2012F865CF002A820A /* catch_generators.hpp */, + 4A565D2112F865CF002A820A /* catch_hub_impl.hpp */, + 4A565D2212F865CF002A820A /* catch_hub.h */, + 4A565D2312F865CF002A820A /* catch_interfaces_capture.h */, + 4A565D2412F865CF002A820A /* catch_interfaces_reporter.h */, + 4A565D2512F865CF002A820A /* catch_interfaces_runner.h */, + 4A565D2612F865CF002A820A /* catch_interfaces_testcase.h */, + 4A565D2712F865CF002A820A /* catch_list.hpp */, + 4A565D2812F865CF002A820A /* catch_reporter_registrars.hpp */, + 4A565D2912F865CF002A820A /* catch_reporter_registry.hpp */, + 4A565D2A12F865CF002A820A /* catch_result_type.h */, + 4A565D2B12F865CF002A820A /* catch_resultinfo.hpp */, + 4A565D2C12F865CF002A820A /* catch_runner_impl.hpp */, + 4A565D2D12F865CF002A820A /* catch_section.hpp */, + 4A565D2E12F865CF002A820A /* catch_self_test.hpp */, + 4A565D2F12F865CF002A820A /* catch_stream.hpp */, + 4A565D3012F865CF002A820A /* catch_test_case_info.hpp */, + 4A565D3112F865CF002A820A /* catch_test_case_registry_impl.hpp */, + 4A565D3212F865CF002A820A /* catch_test_registry.hpp */, + 4A565D3312F865CF002A820A /* catch_xmlwriter.hpp */, ); name = internal; path = ../../../internal; diff --git a/catch_objc.hpp b/catch_objc.hpp index 9a92c31..7f459a7 100644 --- a/catch_objc.hpp +++ b/catch_objc.hpp @@ -16,6 +16,7 @@ #import #include #include "catch.hpp" +#include "internal/catch_test_case_info.hpp" @protocol OcFixture @@ -28,7 +29,7 @@ namespace Catch { - class OcMethod : public TestCase + class OcMethod : public ITestCase { public: OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) @@ -52,18 +53,18 @@ namespace Catch [obj release]; } - virtual TestCase* clone() const + virtual ITestCase* clone() const { return new OcMethod( m_cls, m_sel ); } - virtual bool operator == ( const TestCase& other ) const + virtual bool operator == ( const ITestCase& other ) const { const OcMethod* ocmOther = dynamic_cast ( &other ); return ocmOther && ocmOther->m_sel == m_sel; } - virtual bool operator < ( const TestCase& other ) const + virtual bool operator < ( const ITestCase& other ) const { const OcMethod* ocmOther = dynamic_cast ( &other ); return ocmOther && ocmOther->m_sel < m_sel; @@ -114,10 +115,10 @@ namespace Catch if( Detail::startsWith( methodName, "Catch_TestCase_" ) ) { std::string testCaseName = methodName.substr( 15 ); - std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); - std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); + const char* name = Detail::getAnnotation( cls, "Name", testCaseName ); + const char* desc = Detail::getAnnotation( cls, "Description", testCaseName ); - TestRegistry::instance().registerTest( TestCaseInfo( new OcMethod( cls, selector ), name, desc ) ); + Hub::getTestCaseRegistry().registerTest( TestCaseInfo( new OcMethod( cls, selector ), name, desc ) ); noTestMethods++; }