mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Merges objc top level headers into main headers (using #ifdef __OBJC__)
This commit is contained in:
parent
38edb9fa95
commit
95419e935c
@ -30,6 +30,10 @@
|
|||||||
#include "internal/catch_generators.hpp"
|
#include "internal/catch_generators.hpp"
|
||||||
#include "internal/catch_interfaces_exception.h"
|
#include "internal/catch_interfaces_exception.h"
|
||||||
|
|
||||||
|
#ifdef __OBJC__
|
||||||
|
#include "internal/catch_objc.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
//////
|
//////
|
||||||
|
|
||||||
#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, false, true, "REQUIRE" )
|
#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, false, true, "REQUIRE" )
|
||||||
|
@ -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
|
|
@ -17,7 +17,22 @@
|
|||||||
|
|
||||||
int main (int argc, char * const argv[])
|
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 );
|
return Catch::Main( argc, argv );
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TWOBLUECUBES_CATCH_WITH_MAIN_HPP_INCLUDED
|
#endif // TWOBLUECUBES_CATCH_WITH_MAIN_HPP_INCLUDED
|
||||||
|
@ -183,6 +183,7 @@ namespace Catch
|
|||||||
if( m_args.size() != 0 )
|
if( m_args.size() != 0 )
|
||||||
return setErrorMode( m_command + " does not accept arguments" );
|
return setErrorMode( m_command + " does not accept arguments" );
|
||||||
m_config.setShouldDebugBreak( true );
|
m_config.setShouldDebugBreak( true );
|
||||||
|
break;
|
||||||
case modeName:
|
case modeName:
|
||||||
if( m_args.size() != 1 )
|
if( m_args.size() != 1 )
|
||||||
return setErrorMode( m_command + " requires exactly one argument (a name)" );
|
return setErrorMode( m_command + " requires exactly one argument (a name)" );
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#import <objc/runtime.h>
|
#import <objc/runtime.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "catch.hpp"
|
|
||||||
#include "internal/catch_test_case_info.hpp"
|
#include "internal/catch_test_case_info.hpp"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
@ -8,7 +8,7 @@
|
|||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
// 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)
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include "catch_objc.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import "TestObj.h"
|
#import "TestObj.h"
|
||||||
|
@ -1 +1 @@
|
|||||||
#import "catch_objc_main.hpp"
|
#import "catch_with_main.hpp"
|
||||||
|
@ -37,8 +37,9 @@
|
|||||||
4A5953B6128E95D6009DC1B9 /* OCTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OCTest.mm; sourceTree = "<group>"; };
|
4A5953B6128E95D6009DC1B9 /* OCTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OCTest.mm; sourceTree = "<group>"; };
|
||||||
4A5953EF128E9A61009DC1B9 /* CatchOCTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CatchOCTestCase.h; sourceTree = "<group>"; };
|
4A5953EF128E9A61009DC1B9 /* CatchOCTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CatchOCTestCase.h; sourceTree = "<group>"; };
|
||||||
4A5953F0128E9A61009DC1B9 /* CatchOCTestCase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CatchOCTestCase.mm; sourceTree = "<group>"; };
|
4A5953F0128E9A61009DC1B9 /* CatchOCTestCase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CatchOCTestCase.mm; sourceTree = "<group>"; };
|
||||||
4ADB5B8913655AA4001EB00B /* catch_objc_main.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_objc_main.hpp; path = ../../../include/catch_objc_main.hpp; sourceTree = SOURCE_ROOT; };
|
4A97DB2813673E3100C8087C /* catch_objc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_objc.hpp; path = ../../../include/internal/catch_objc.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
4ADB5B8A13655AA4001EB00B /* catch_objc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_objc.hpp; path = ../../../include/catch_objc.hpp; sourceTree = SOURCE_ROOT; };
|
4A97DB2B13673E4700C8087C /* catch.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch.hpp; path = ../../../include/catch.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A97DB3613673EA300C8087C /* catch_with_main.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_with_main.hpp; path = ../../../include/catch_with_main.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
8DD76FA10486AA7600D96B5E /* OCTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = OCTest; sourceTree = BUILT_PRODUCTS_DIR; };
|
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 = "<group>"; };
|
C6859EA3029092ED04C91782 /* OCTest.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = OCTest.1; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
@ -69,8 +70,6 @@
|
|||||||
08FB7795FE84155DC02AAC07 /* Source */ = {
|
08FB7795FE84155DC02AAC07 /* Source */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
4ADB5B8913655AA4001EB00B /* catch_objc_main.hpp */,
|
|
||||||
4ADB5B8A13655AA4001EB00B /* catch_objc.hpp */,
|
|
||||||
4AFDF58212CA9E2800F15202 /* Catch */,
|
4AFDF58212CA9E2800F15202 /* Catch */,
|
||||||
32A70AAB03705E1F00C91783 /* OCTest_Prefix.pch */,
|
32A70AAB03705E1F00C91783 /* OCTest_Prefix.pch */,
|
||||||
08FB7796FE84155DC02AAC07 /* Main.mm */,
|
08FB7796FE84155DC02AAC07 /* Main.mm */,
|
||||||
@ -102,6 +101,9 @@
|
|||||||
4AFDF58212CA9E2800F15202 /* Catch */ = {
|
4AFDF58212CA9E2800F15202 /* Catch */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
4A97DB3613673EA300C8087C /* catch_with_main.hpp */,
|
||||||
|
4A97DB2B13673E4700C8087C /* catch.hpp */,
|
||||||
|
4A97DB2813673E3100C8087C /* catch_objc.hpp */,
|
||||||
);
|
);
|
||||||
name = Catch;
|
name = Catch;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
Loading…
Reference in New Issue
Block a user