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

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2011-04-26 19:00:25 +0100
committerPhil Nash2011-04-26 19:00:25 +0100
commit95419e935cd57f0737ea2b30bb5793c5940a7abc (patch)
treeee2bd418280b9ff806b12ca4af729cd2553536f8 /include
parent38edb9fa956aa1a62916bf19af5ed9ecb01b28bc (diff)
downloadcatch3-95419e935cd57f0737ea2b30bb5793c5940a7abc.tar.gz
Merges objc top level headers into main headers (using #ifdef __OBJC__)
Diffstat (limited to 'include')
-rw-r--r--include/catch.hpp4
-rw-r--r--include/catch_objc_main.hpp31
-rw-r--r--include/catch_with_main.hpp15
-rw-r--r--include/internal/catch_commandline.hpp1
-rw-r--r--include/internal/catch_objc.hpp (renamed from include/catch_objc.hpp)1
5 files changed, 20 insertions, 32 deletions
diff --git a/include/catch.hpp b/include/catch.hpp
index f9ff324c..57fd82c0 100644
--- a/include/catch.hpp
+++ b/include/catch.hpp
@@ -30,6 +30,10 @@
#include "internal/catch_generators.hpp"
#include "internal/catch_interfaces_exception.h"
+#ifdef __OBJC__
+#include "internal/catch_objc.hpp"
+#endif
+
//////
#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, false, true, "REQUIRE" )
diff --git a/include/catch_objc_main.hpp b/include/catch_objc_main.hpp
deleted file mode 100644
index 7933a636..00000000
--- a/include/catch_objc_main.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * catch_objc_main.hpp
- * Catch
- *
- * 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
diff --git a/include/catch_with_main.hpp b/include/catch_with_main.hpp
index ae68c7cc..1c4a37a3 100644
--- a/include/catch_with_main.hpp
+++ b/include/catch_with_main.hpp
@@ -17,7 +17,22 @@
int main (int argc, char * const argv[])
{
+#ifdef __OBJC__
+
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+
+ Catch::registerTestMethods();
+
+ int result = Catch::Main( argc, (char* const*)argv );
+
+ [pool drain];
+ return result;
+
+#else
+
return Catch::Main( argc, argv );
+
+#endif
}
#endif // TWOBLUECUBES_CATCH_WITH_MAIN_HPP_INCLUDED
diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp
index 0eedcb00..6a4d0368 100644
--- a/include/internal/catch_commandline.hpp
+++ b/include/internal/catch_commandline.hpp
@@ -183,6 +183,7 @@ namespace Catch
if( m_args.size() != 0 )
return setErrorMode( m_command + " does not accept arguments" );
m_config.setShouldDebugBreak( true );
+ break;
case modeName:
if( m_args.size() != 1 )
return setErrorMode( m_command + " requires exactly one argument (a name)" );
diff --git a/include/catch_objc.hpp b/include/internal/catch_objc.hpp
index 690ce5d4..8b621695 100644
--- a/include/catch_objc.hpp
+++ b/include/internal/catch_objc.hpp
@@ -16,7 +16,6 @@
#import <objc/runtime.h>
#include <string>
-#include "catch.hpp"
#include "internal/catch_test_case_info.hpp"
///////////////////////////////////////////////////////////////////////////////