From 2b5f88496c3a7bf562a4cb12175781b6deef43f4 Mon Sep 17 00:00:00 2001 From: Lukasz Forynski Date: Tue, 17 Dec 2013 14:54:38 +0000 Subject: [PATCH] Re-added (unintentionly removed) OBJC main entry point implementation --- README.md | 2 +- include/internal/catch_default_main.hpp | 18 ++++++++++++++++++ include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 23 ++++++++++++++++++++--- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 42767531..14a391d0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](catch-logo-small.png) -*v1.0 build 24 (master branch)* +*v1.0 build 25 (master branch)* Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) diff --git a/include/internal/catch_default_main.hpp b/include/internal/catch_default_main.hpp index 95955ad9..672893b8 100644 --- a/include/internal/catch_default_main.hpp +++ b/include/internal/catch_default_main.hpp @@ -147,6 +147,24 @@ int main (int argc, char * const argv[]) { return ret; } +#else // __OBJC__ + +// Objective-C entry point +int main (int argc, char * const argv[]) { +#if !CATCH_ARC_ENABLED + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; +#endif + + Catch::registerTestMethods(); + int result = Catch::Session().run( argc, (char* const*)argv ); + +#if !CATCH_ARC_ENABLED + [pool drain]; +#endif + + return result; + + #endif // __OBJC__ #endif // TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 67390ce8..2fcf72d1 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 24, "master" ); + Version libraryVersion( 1, 0, 25, "master" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index fdda4825..a3b0d798 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v1.0 build 24 (master branch) - * Generated: 2013-12-17 14:45:19.329049 + * CATCH v1.0 build 25 (master branch) + * Generated: 2013-12-17 14:51:52.643587 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -6166,7 +6166,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 24, "master" ); + Version libraryVersion( 1, 0, 25, "master" ); } // #included from: catch_text.hpp @@ -8041,6 +8041,23 @@ int main (int argc, char * const argv[]) { return ret; } +#else // __OBJC__ + +// Objective-C entry point +int main (int argc, char * const argv[]) { +#if !CATCH_ARC_ENABLED + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; +#endif + + Catch::registerTestMethods(); + int result = Catch::Session().run( argc, (char* const*)argv ); + +#if !CATCH_ARC_ENABLED + [pool drain]; +#endif + + return result; + #endif // __OBJC__ #endif // CATCH_CONFIG_MAIN