diff --git a/Test/Xcode/OCTest/Main.mm b/Test/Xcode/OCTest/Main.mm index d0d77407..40959372 100644 --- a/Test/Xcode/OCTest/Main.mm +++ b/Test/Xcode/OCTest/Main.mm @@ -1,17 +1 @@ -#import -#import "../../../catch_runner.hpp" - -#import "CatchOCTestCase.h" - - -int main (int argc, const char * argv[]) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - - Catch::registerTestMethods(); - - // insert code here... - int result = Catch::Main( argc, (char* const*)argv ); - - [pool drain]; - return result; -} +#import "../../../catch_objc_main.hpp" diff --git a/Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj b/Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj index bba9255a..b3540761 100644 --- a/Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj +++ b/Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj @@ -37,6 +37,27 @@ 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 = ""; }; /* End PBXFileReference section */ @@ -67,6 +88,7 @@ 08FB7795FE84155DC02AAC07 /* Source */ = { isa = PBXGroup; children = ( + 4AFDF58212CA9E2800F15202 /* Catch */, 32A70AAB03705E1F00C91783 /* OCTest_Prefix.pch */, 08FB7796FE84155DC02AAC07 /* Main.mm */, 4A5953B3128E95B8009DC1B9 /* TestObj.h */, @@ -94,6 +116,43 @@ name = Products; sourceTree = ""; }; + 4AFDF58212CA9E2800F15202 /* Catch */ = { + isa = PBXGroup; + children = ( + 4AFDF59812CA9E8600F15202 /* catch_objc_main.hpp */, + 4AFDF58312CA9E4000F15202 /* catch_default_main.hpp */, + 4AFDF58412CA9E4000F15202 /* catch_objc.hpp */, + 4AFDF58512CA9E4000F15202 /* catch_reporter_basic.hpp */, + 4AFDF58612CA9E4000F15202 /* catch_reporter_junit.hpp */, + 4AFDF58712CA9E4000F15202 /* catch_reporter_xml.hpp */, + 4AFDF58812CA9E4000F15202 /* catch_runner.hpp */, + 4AFDF58912CA9E4000F15202 /* catch.hpp */, + 4AFDF58A12CA9E4000F15202 /* internal */, + ); + name = Catch; + sourceTree = ""; + }; + 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 */, + ); + name = internal; + path = ../../../internal; + sourceTree = SOURCE_ROOT; + }; C6859EA2029092E104C91782 /* Documentation */ = { isa = PBXGroup; children = ( diff --git a/catch_objc_main.hpp b/catch_objc_main.hpp new file mode 100644 index 00000000..1ded44c0 --- /dev/null +++ b/catch_objc_main.hpp @@ -0,0 +1,31 @@ +/* + * catch_objc_main.hpp + * OCTest + * + * Created by Phil on 28/12/2010. + * Copyright 2010 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_OBJC_MAIN_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_OBJC_MAIN_HPP_INCLUDED + +#include "catch_runner.hpp" +#include "catch_objc.hpp" + +int main (int argc, const char * argv[]) +{ + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + Catch::registerTestMethods(); + + int result = Catch::Main( argc, (char* const*)argv ); + + [pool drain]; + return result; +} + +#endif \ No newline at end of file