mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
merge
This commit is contained in:
commit
ceab2a63bd
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
Test/build
|
*.build
|
||||||
*.pbxuser
|
*.pbxuser
|
||||||
*.mode1v3
|
*.mode1v3
|
||||||
*.ncb
|
*.ncb
|
||||||
|
@ -61,7 +61,17 @@ int main (int argc, char * const argv[])
|
|||||||
|
|
||||||
if( result == 0 )
|
if( result == 0 )
|
||||||
{
|
{
|
||||||
std::cout << "All " << runner.getSuccessCount() + runner.getFailureCount() << " tests completed successfully" << std::endl;
|
const size_t expectedTestCaseCount = 99; // !TBD factor this out
|
||||||
|
size_t testCaseCount = runner.getSuccessCount() + runner.getFailureCount();
|
||||||
|
std::cout << "All " << testCaseCount << " tests completed successfully" << std::endl;
|
||||||
|
if( testCaseCount != expectedTestCaseCount )
|
||||||
|
{
|
||||||
|
std::cerr << "- but we were expecting " << expectedTestCaseCount
|
||||||
|
<< " test to run. Where some added or removed, or were they not compiled in?"
|
||||||
|
<< std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -42,3 +42,22 @@ TEST_CASE( "succeeding/Tricky/complex lhs", "Where the LHS is not a simple value
|
|||||||
EXPECT( a == 2 || b == 2 );
|
EXPECT( a == 2 || b == 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct Opaque
|
||||||
|
{
|
||||||
|
int val;
|
||||||
|
bool operator ==( const Opaque& o )
|
||||||
|
{
|
||||||
|
return val == o.val;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_CASE( "failing/Tricky/non streamable type", "A failing expression with a non streamable type is still captured" )
|
||||||
|
{
|
||||||
|
|
||||||
|
Opaque o1, o2;
|
||||||
|
o1.val = 7;
|
||||||
|
o2.val = 8;
|
||||||
|
|
||||||
|
CHECK( &o1 == &o2 );
|
||||||
|
CHECK( o1 == o2 );
|
||||||
|
}
|
||||||
|
19
Test/Xcode/OCTest/CatchOCTestCase.h
Normal file
19
Test/Xcode/OCTest/CatchOCTestCase.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// CatchOCTestCase.h
|
||||||
|
// OCTest
|
||||||
|
//
|
||||||
|
// Created by Phil on 13/11/2010.
|
||||||
|
// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "../../../catch_objc.hpp"
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import "TestObj.h"
|
||||||
|
|
||||||
|
@interface TestFixture : NSObject <OcFixture>
|
||||||
|
{
|
||||||
|
TestObj* obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
43
Test/Xcode/OCTest/CatchOCTestCase.mm
Normal file
43
Test/Xcode/OCTest/CatchOCTestCase.mm
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
//
|
||||||
|
// CatchOCTestCase.mm
|
||||||
|
// OCTest
|
||||||
|
//
|
||||||
|
// Created by Phil Nash on 13/11/2010.
|
||||||
|
// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "CatchOCTestCase.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation TestFixture
|
||||||
|
|
||||||
|
|
||||||
|
-(void) setUp
|
||||||
|
{
|
||||||
|
obj = [[TestObj alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void) tearDown
|
||||||
|
{
|
||||||
|
[obj release];
|
||||||
|
}
|
||||||
|
|
||||||
|
OC_TEST_CASE( "OCTest/test1", "This is a test case" )
|
||||||
|
{
|
||||||
|
EXPECT( obj.int_val == 0 );
|
||||||
|
|
||||||
|
obj.int_val = 1;
|
||||||
|
|
||||||
|
EXPECT( obj.int_val == 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
OC_TEST_CASE( "OCTest/test2", "This is another test case" )
|
||||||
|
{
|
||||||
|
EXPECT( obj.int_val == 0 );
|
||||||
|
|
||||||
|
obj.int_val = 2;
|
||||||
|
|
||||||
|
EXPECT( obj.int_val == 2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
17
Test/Xcode/OCTest/Main.mm
Normal file
17
Test/Xcode/OCTest/Main.mm
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#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;
|
||||||
|
}
|
79
Test/Xcode/OCTest/OCTest.1
Normal file
79
Test/Xcode/OCTest/OCTest.1
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples.
|
||||||
|
.\"See Also:
|
||||||
|
.\"man mdoc.samples for a complete listing of options
|
||||||
|
.\"man mdoc for the short list of editing options
|
||||||
|
.\"/usr/share/misc/mdoc.template
|
||||||
|
.Dd 13/11/2010 \" DATE
|
||||||
|
.Dt OCTest 1 \" Program name and manual section number
|
||||||
|
.Os Darwin
|
||||||
|
.Sh NAME \" Section Header - required - don't modify
|
||||||
|
.Nm OCTest,
|
||||||
|
.\" The following lines are read in generating the apropos(man -k) database. Use only key
|
||||||
|
.\" words here as the database is built based on the words here and in the .ND line.
|
||||||
|
.Nm Other_name_for_same_program(),
|
||||||
|
.Nm Yet another name for the same program.
|
||||||
|
.\" Use .Nm macro to designate other names for the documented program.
|
||||||
|
.Nd This line parsed for whatis database.
|
||||||
|
.Sh SYNOPSIS \" Section Header - required - don't modify
|
||||||
|
.Nm
|
||||||
|
.Op Fl abcd \" [-abcd]
|
||||||
|
.Op Fl a Ar path \" [-a path]
|
||||||
|
.Op Ar file \" [file]
|
||||||
|
.Op Ar \" [file ...]
|
||||||
|
.Ar arg0 \" Underlined argument - use .Ar anywhere to underline
|
||||||
|
arg2 ... \" Arguments
|
||||||
|
.Sh DESCRIPTION \" Section Header - required - don't modify
|
||||||
|
Use the .Nm macro to refer to your program throughout the man page like such:
|
||||||
|
.Nm
|
||||||
|
Underlining is accomplished with the .Ar macro like this:
|
||||||
|
.Ar underlined text .
|
||||||
|
.Pp \" Inserts a space
|
||||||
|
A list of items with descriptions:
|
||||||
|
.Bl -tag -width -indent \" Begins a tagged list
|
||||||
|
.It item a \" Each item preceded by .It macro
|
||||||
|
Description of item a
|
||||||
|
.It item b
|
||||||
|
Description of item b
|
||||||
|
.El \" Ends the list
|
||||||
|
.Pp
|
||||||
|
A list of flags and their descriptions:
|
||||||
|
.Bl -tag -width -indent \" Differs from above in tag removed
|
||||||
|
.It Fl a \"-a flag as a list item
|
||||||
|
Description of -a flag
|
||||||
|
.It Fl b
|
||||||
|
Description of -b flag
|
||||||
|
.El \" Ends the list
|
||||||
|
.Pp
|
||||||
|
.\" .Sh ENVIRONMENT \" May not be needed
|
||||||
|
.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1
|
||||||
|
.\" .It Ev ENV_VAR_1
|
||||||
|
.\" Description of ENV_VAR_1
|
||||||
|
.\" .It Ev ENV_VAR_2
|
||||||
|
.\" Description of ENV_VAR_2
|
||||||
|
.\" .El
|
||||||
|
.Sh FILES \" File used or created by the topic of the man page
|
||||||
|
.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact
|
||||||
|
.It Pa /usr/share/file_name
|
||||||
|
FILE_1 description
|
||||||
|
.It Pa /Users/joeuser/Library/really_long_file_name
|
||||||
|
FILE_2 description
|
||||||
|
.El \" Ends the list
|
||||||
|
.\" .Sh DIAGNOSTICS \" May not be needed
|
||||||
|
.\" .Bl -diag
|
||||||
|
.\" .It Diagnostic Tag
|
||||||
|
.\" Diagnostic informtion here.
|
||||||
|
.\" .It Diagnostic Tag
|
||||||
|
.\" Diagnostic informtion here.
|
||||||
|
.\" .El
|
||||||
|
.Sh SEE ALSO
|
||||||
|
.\" List links in ascending order by section, alphabetically within a section.
|
||||||
|
.\" Please do not reference files that do not exist without filing a bug report
|
||||||
|
.Xr a 1 ,
|
||||||
|
.Xr b 1 ,
|
||||||
|
.Xr c 1 ,
|
||||||
|
.Xr a 2 ,
|
||||||
|
.Xr b 2 ,
|
||||||
|
.Xr a 3 ,
|
||||||
|
.Xr b 3
|
||||||
|
.\" .Sh BUGS \" Document known, unremedied bugs
|
||||||
|
.\" .Sh HISTORY \" Document history if command behaves in a unique manner
|
25
Test/Xcode/OCTest/OCTest.mm
Normal file
25
Test/Xcode/OCTest/OCTest.mm
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* OCTest.mm
|
||||||
|
* OCTest
|
||||||
|
*
|
||||||
|
* Created by Phil on 13/11/2010.
|
||||||
|
* Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "../../../catch.hpp"
|
||||||
|
|
||||||
|
#import "TestObj.h"
|
||||||
|
|
||||||
|
TEST_CASE( "OCTest/TestObj", "tests TestObj" )
|
||||||
|
{
|
||||||
|
TestObj* obj = [[TestObj alloc] init];
|
||||||
|
|
||||||
|
EXPECT( obj.int_val == 0 );
|
||||||
|
|
||||||
|
obj.int_val = 1;
|
||||||
|
|
||||||
|
EXPECT( obj.int_val == 1 );
|
||||||
|
|
||||||
|
[obj release];
|
||||||
|
}
|
237
Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj
Normal file
237
Test/Xcode/OCTest/OCTest.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 45;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
4A5953B5128E95B8009DC1B9 /* TestObj.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5953B4128E95B8009DC1B9 /* TestObj.m */; };
|
||||||
|
4A5953B7128E95D6009DC1B9 /* OCTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A5953B6128E95D6009DC1B9 /* OCTest.mm */; };
|
||||||
|
4A5953F1128E9A61009DC1B9 /* CatchOCTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A5953F0128E9A61009DC1B9 /* CatchOCTestCase.mm */; };
|
||||||
|
8DD76F9A0486AA7600D96B5E /* Main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* Main.mm */; settings = {ATTRIBUTES = (); }; };
|
||||||
|
8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
|
||||||
|
8DD76F9F0486AA7600D96B5E /* OCTest.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859EA3029092ED04C91782 /* OCTest.1 */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
8DD76F9E0486AA7600D96B5E /* CopyFiles */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 8;
|
||||||
|
dstPath = /usr/share/man/man1/;
|
||||||
|
dstSubfolderSpec = 0;
|
||||||
|
files = (
|
||||||
|
8DD76F9F0486AA7600D96B5E /* OCTest.1 in CopyFiles */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 1;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
08FB7796FE84155DC02AAC07 /* Main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Main.mm; sourceTree = "<group>"; };
|
||||||
|
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||||
|
32A70AAB03705E1F00C91783 /* OCTest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCTest_Prefix.pch; sourceTree = "<group>"; };
|
||||||
|
4A5953B3128E95B8009DC1B9 /* TestObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestObj.h; sourceTree = "<group>"; };
|
||||||
|
4A5953B4128E95B8009DC1B9 /* TestObj.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestObj.m; 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>"; };
|
||||||
|
4A5953F0128E9A61009DC1B9 /* CatchOCTestCase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CatchOCTestCase.mm; sourceTree = "<group>"; };
|
||||||
|
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>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
8DD76F9B0486AA7600D96B5E /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
08FB7794FE84155DC02AAC07 /* OCTest */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
08FB7795FE84155DC02AAC07 /* Source */,
|
||||||
|
C6859EA2029092E104C91782 /* Documentation */,
|
||||||
|
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
|
||||||
|
1AB674ADFE9D54B511CA2CBB /* Products */,
|
||||||
|
);
|
||||||
|
name = OCTest;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
08FB7795FE84155DC02AAC07 /* Source */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
32A70AAB03705E1F00C91783 /* OCTest_Prefix.pch */,
|
||||||
|
08FB7796FE84155DC02AAC07 /* Main.mm */,
|
||||||
|
4A5953B3128E95B8009DC1B9 /* TestObj.h */,
|
||||||
|
4A5953B4128E95B8009DC1B9 /* TestObj.m */,
|
||||||
|
4A5953B6128E95D6009DC1B9 /* OCTest.mm */,
|
||||||
|
4A5953EF128E9A61009DC1B9 /* CatchOCTestCase.h */,
|
||||||
|
4A5953F0128E9A61009DC1B9 /* CatchOCTestCase.mm */,
|
||||||
|
);
|
||||||
|
name = Source;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
08FB779EFE84155DC02AAC07 /* Foundation.framework */,
|
||||||
|
);
|
||||||
|
name = "External Frameworks and Libraries";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
1AB674ADFE9D54B511CA2CBB /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
8DD76FA10486AA7600D96B5E /* OCTest */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
C6859EA2029092E104C91782 /* Documentation */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
C6859EA3029092ED04C91782 /* OCTest.1 */,
|
||||||
|
);
|
||||||
|
name = Documentation;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
8DD76F960486AA7600D96B5E /* OCTest */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "OCTest" */;
|
||||||
|
buildPhases = (
|
||||||
|
8DD76F990486AA7600D96B5E /* Sources */,
|
||||||
|
8DD76F9B0486AA7600D96B5E /* Frameworks */,
|
||||||
|
8DD76F9E0486AA7600D96B5E /* CopyFiles */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = OCTest;
|
||||||
|
productInstallPath = "$(HOME)/bin";
|
||||||
|
productName = OCTest;
|
||||||
|
productReference = 8DD76FA10486AA7600D96B5E /* OCTest */;
|
||||||
|
productType = "com.apple.product-type.tool";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "OCTest" */;
|
||||||
|
compatibilityVersion = "Xcode 3.1";
|
||||||
|
hasScannedForEncodings = 1;
|
||||||
|
mainGroup = 08FB7794FE84155DC02AAC07 /* OCTest */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
8DD76F960486AA7600D96B5E /* OCTest */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
8DD76F990486AA7600D96B5E /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
8DD76F9A0486AA7600D96B5E /* Main.mm in Sources */,
|
||||||
|
4A5953B5128E95B8009DC1B9 /* TestObj.m in Sources */,
|
||||||
|
4A5953B7128E95D6009DC1B9 /* OCTest.mm in Sources */,
|
||||||
|
4A5953F1128E9A61009DC1B9 /* CatchOCTestCase.mm in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
1DEB927508733DD40010E9CD /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||||
|
GCC_MODEL_TUNING = G5;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||||
|
GCC_PREFIX_HEADER = OCTest_Prefix.pch;
|
||||||
|
INSTALL_PATH = /usr/local/bin;
|
||||||
|
PRODUCT_NAME = OCTest;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
1DEB927608733DD40010E9CD /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
GCC_MODEL_TUNING = G5;
|
||||||
|
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||||
|
GCC_PREFIX_HEADER = OCTest_Prefix.pch;
|
||||||
|
INSTALL_PATH = /usr/local/bin;
|
||||||
|
PRODUCT_NAME = OCTest;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
1DEB927908733DD40010E9CD /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
PREBINDING = NO;
|
||||||
|
SDKROOT = macosx10.6;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
1DEB927A08733DD40010E9CD /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
PREBINDING = NO;
|
||||||
|
SDKROOT = macosx10.6;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "OCTest" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
1DEB927508733DD40010E9CD /* Debug */,
|
||||||
|
1DEB927608733DD40010E9CD /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "OCTest" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
1DEB927908733DD40010E9CD /* Debug */,
|
||||||
|
1DEB927A08733DD40010E9CD /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
|
||||||
|
}
|
7
Test/Xcode/OCTest/OCTest_Prefix.pch
Normal file
7
Test/Xcode/OCTest/OCTest_Prefix.pch
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
//
|
||||||
|
// Prefix header for all source files of the 'OCTest' target in the 'OCTest' project.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifdef __OBJC__
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#endif
|
19
Test/Xcode/OCTest/TestObj.h
Normal file
19
Test/Xcode/OCTest/TestObj.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// TestObj.h
|
||||||
|
// OCTest
|
||||||
|
//
|
||||||
|
// Created by Phil on 13/11/2010.
|
||||||
|
// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
|
||||||
|
@interface TestObj : NSObject {
|
||||||
|
|
||||||
|
int int_val;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property (nonatomic, assign ) int int_val;
|
||||||
|
|
||||||
|
@end
|
16
Test/Xcode/OCTest/TestObj.m
Normal file
16
Test/Xcode/OCTest/TestObj.m
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// TestObj.m
|
||||||
|
// OCTest
|
||||||
|
//
|
||||||
|
// Created by Phil on 13/11/2010.
|
||||||
|
// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "TestObj.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation TestObj
|
||||||
|
|
||||||
|
@synthesize int_val;
|
||||||
|
|
||||||
|
@end
|
364
Test/Xcode/Test.xcodeproj/project.pbxproj
Normal file
364
Test/Xcode/Test.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,364 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 45;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
<<<<<<< HEAD:Test/Test.xcodeproj/project.pbxproj
|
||||||
|
4A3BFFB9128DCF06005609E3 /* TestMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A3BFFB8128DCF06005609E3 /* TestMain.cpp */; };
|
||||||
|
4AA7EA9212A438C7005A0B97 /* MiscTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AA7EA9112A438C7005A0B97 /* MiscTests.cpp */; };
|
||||||
|
4AFC38CD12887D80003A0C29 /* ConditionTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AFC38CC12887D80003A0C29 /* ConditionTests.cpp */; };
|
||||||
|
4AFC3A9912893C56003A0C29 /* ExceptionTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AFC3A9812893C56003A0C29 /* ExceptionTests.cpp */; };
|
||||||
|
4AFC3AA912893E54003A0C29 /* MessageTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AFC3AA812893E54003A0C29 /* MessageTests.cpp */; };
|
||||||
|
4AFC3B0B12894114003A0C29 /* ClassTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AFC3B0A12894114003A0C29 /* ClassTests.cpp */; };
|
||||||
|
4AFC3B671289C7E3003A0C29 /* TrickyTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AFC3B661289C7E3003A0C29 /* TrickyTests.cpp */; };
|
||||||
|
=======
|
||||||
|
4A595364128E920B009DC1B9 /* ClassTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A59535F128E920B009DC1B9 /* ClassTests.cpp */; };
|
||||||
|
4A595365128E920B009DC1B9 /* ConditionTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A595360128E920B009DC1B9 /* ConditionTests.cpp */; };
|
||||||
|
4A595366128E920B009DC1B9 /* ExceptionTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A595361128E920B009DC1B9 /* ExceptionTests.cpp */; };
|
||||||
|
4A595367128E920B009DC1B9 /* MessageTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A595362128E920B009DC1B9 /* MessageTests.cpp */; };
|
||||||
|
4A595368128E920B009DC1B9 /* TrickyTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A595363128E920B009DC1B9 /* TrickyTests.cpp */; };
|
||||||
|
4A59537A128E9354009DC1B9 /* TestMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A595379128E9354009DC1B9 /* TestMain.cpp */; };
|
||||||
|
>>>>>>> 5f43a43662c8b9feca25aeccc79d1c7db664c9a0:Test/Xcode/Test.xcodeproj/project.pbxproj
|
||||||
|
8DD76F6A0486A84900D96B5E /* Test.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859E8B029090EE04C91782 /* Test.1 */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
8DD76F690486A84900D96B5E /* CopyFiles */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 8;
|
||||||
|
dstPath = /usr/share/man/man1/;
|
||||||
|
dstSubfolderSpec = 0;
|
||||||
|
files = (
|
||||||
|
8DD76F6A0486A84900D96B5E /* Test.1 in CopyFiles */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 1;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
<<<<<<< HEAD:Test/Test.xcodeproj/project.pbxproj
|
||||||
|
4A3BFFB8128DCF06005609E3 /* TestMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestMain.cpp; sourceTree = "<group>"; };
|
||||||
|
4A3BFFF0128DD23C005609E3 /* catch_runnerconfig.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_runnerconfig.hpp; path = ../internal/catch_runnerconfig.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AA7E968129FA1DF005A0B97 /* catch_reporter_junit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_junit.hpp; path = ../../../Lib/Catch/catch_reporter_junit.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AA7EA9112A438C7005A0B97 /* MiscTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MiscTests.cpp; sourceTree = "<group>"; };
|
||||||
|
4AFC341512809A36003A0C29 /* catch_capture.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_capture.hpp; path = ../internal/catch_capture.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC341612809A36003A0C29 /* catch_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_common.h; path = ../internal/catch_common.h; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC341712809A36003A0C29 /* catch_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_registry.hpp; path = ../internal/catch_registry.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC341812809A36003A0C29 /* catch_reporter_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_registry.hpp; path = ../internal/catch_reporter_registry.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC341912809A36003A0C29 /* catch_resultinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_resultinfo.hpp; path = ../internal/catch_resultinfo.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC341A12809A36003A0C29 /* catch_runner_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_runner_impl.hpp; path = ../internal/catch_runner_impl.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC341B12809A36003A0C29 /* catch_testcaseinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_testcaseinfo.hpp; path = ../internal/catch_testcaseinfo.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC341C12809A45003A0C29 /* 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; };
|
||||||
|
4AFC341D12809A45003A0C29 /* 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; };
|
||||||
|
4AFC341E12809A45003A0C29 /* 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; };
|
||||||
|
4AFC341F12809A45003A0C29 /* catch_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_list.hpp; path = ../internal/catch_list.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC342012809A45003A0C29 /* catch.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch.hpp; path = ../catch.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC346412809D41003A0C29 /* catch_commandline.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_commandline.hpp; path = ../internal/catch_commandline.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC359B1281F00B003A0C29 /* catch_section.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_section.hpp; path = ../internal/catch_section.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC38161284B387003A0C29 /* catch_runner.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_runner.hpp; path = ../catch_runner.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4AFC38CC12887D80003A0C29 /* ConditionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConditionTests.cpp; sourceTree = "<group>"; };
|
||||||
|
4AFC3A9812893C56003A0C29 /* ExceptionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExceptionTests.cpp; sourceTree = "<group>"; };
|
||||||
|
4AFC3AA812893E54003A0C29 /* MessageTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessageTests.cpp; sourceTree = "<group>"; };
|
||||||
|
4AFC3B0A12894114003A0C29 /* ClassTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClassTests.cpp; sourceTree = "<group>"; };
|
||||||
|
4AFC3B661289C7E3003A0C29 /* TrickyTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrickyTests.cpp; sourceTree = "<group>"; };
|
||||||
|
=======
|
||||||
|
4A59535F128E920B009DC1B9 /* ClassTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClassTests.cpp; path = ../ClassTests.cpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595360128E920B009DC1B9 /* ConditionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConditionTests.cpp; path = ../ConditionTests.cpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595361128E920B009DC1B9 /* ExceptionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExceptionTests.cpp; path = ../ExceptionTests.cpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595362128E920B009DC1B9 /* MessageTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MessageTests.cpp; path = ../MessageTests.cpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595363128E920B009DC1B9 /* TrickyTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TrickyTests.cpp; path = ../TrickyTests.cpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595379128E9354009DC1B9 /* TestMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestMain.cpp; path = ../TestMain.cpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A59537F128E93CA009DC1B9 /* 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; };
|
||||||
|
4A595380128E93CA009DC1B9 /* 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; };
|
||||||
|
4A595381128E93CA009DC1B9 /* 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; };
|
||||||
|
4A595382128E93CA009DC1B9 /* catch_runner.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_runner.hpp; path = ../../catch_runner.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595383128E93CA009DC1B9 /* catch.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch.hpp; path = ../../catch.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595384128E93E0009DC1B9 /* catch_capture.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_capture.hpp; path = ../../internal/catch_capture.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595385128E93E1009DC1B9 /* catch_commandline.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_commandline.hpp; path = ../../internal/catch_commandline.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595386128E93E1009DC1B9 /* catch_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_common.h; path = ../../internal/catch_common.h; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595387128E93E1009DC1B9 /* catch_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_list.hpp; path = ../../internal/catch_list.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595388128E93E1009DC1B9 /* catch_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_registry.hpp; path = ../../internal/catch_registry.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A595389128E93E1009DC1B9 /* catch_reporter_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_registry.hpp; path = ../../internal/catch_reporter_registry.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A59538A128E93E1009DC1B9 /* catch_resultinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_resultinfo.hpp; path = ../../internal/catch_resultinfo.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A59538B128E93E1009DC1B9 /* catch_runner_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_runner_impl.hpp; path = ../../internal/catch_runner_impl.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A59538C128E93E1009DC1B9 /* catch_runnerconfig.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_runnerconfig.hpp; path = ../../internal/catch_runnerconfig.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A59538D128E93E1009DC1B9 /* catch_section.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_section.hpp; path = ../../internal/catch_section.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A59538E128E93E1009DC1B9 /* catch_testcaseinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_testcaseinfo.hpp; path = ../../internal/catch_testcaseinfo.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
4A5955C412909CCC009DC1B9 /* catch_objc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_objc.hpp; path = ../../catch_objc.hpp; sourceTree = SOURCE_ROOT; };
|
||||||
|
>>>>>>> 5f43a43662c8b9feca25aeccc79d1c7db664c9a0:Test/Xcode/Test.xcodeproj/project.pbxproj
|
||||||
|
8DD76F6C0486A84900D96B5E /* Test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Test; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
C6859E8B029090EE04C91782 /* Test.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = Test.1; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
8DD76F660486A84900D96B5E /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
08FB7794FE84155DC02AAC07 /* Test */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
08FB7795FE84155DC02AAC07 /* Source */,
|
||||||
|
C6859E8C029090F304C91782 /* Documentation */,
|
||||||
|
1AB674ADFE9D54B511CA2CBB /* Products */,
|
||||||
|
);
|
||||||
|
name = Test;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
08FB7795FE84155DC02AAC07 /* Source */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
<<<<<<< HEAD:Test/Test.xcodeproj/project.pbxproj
|
||||||
|
4AA7E96C129FA2A0005A0B97 /* Tests */,
|
||||||
|
4A3BFFB8128DCF06005609E3 /* TestMain.cpp */,
|
||||||
|
=======
|
||||||
|
4A595379128E9354009DC1B9 /* TestMain.cpp */,
|
||||||
|
4A59535E128E91FA009DC1B9 /* Test Cases */,
|
||||||
|
>>>>>>> 5f43a43662c8b9feca25aeccc79d1c7db664c9a0:Test/Xcode/Test.xcodeproj/project.pbxproj
|
||||||
|
4AFC341312809A12003A0C29 /* Catch */,
|
||||||
|
);
|
||||||
|
name = Source;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
1AB674ADFE9D54B511CA2CBB /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
8DD76F6C0486A84900D96B5E /* Test */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
<<<<<<< HEAD:Test/Test.xcodeproj/project.pbxproj
|
||||||
|
4AA7E96B129FA282005A0B97 /* Reporters */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
4AFC341D12809A45003A0C29 /* catch_reporter_basic.hpp */,
|
||||||
|
4AFC341E12809A45003A0C29 /* catch_reporter_xml.hpp */,
|
||||||
|
4AA7E968129FA1DF005A0B97 /* catch_reporter_junit.hpp */,
|
||||||
|
);
|
||||||
|
name = Reporters;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
4AA7E96C129FA2A0005A0B97 /* Tests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
4AA7EA9112A438C7005A0B97 /* MiscTests.cpp */,
|
||||||
|
4AFC38CC12887D80003A0C29 /* ConditionTests.cpp */,
|
||||||
|
4AFC3A9812893C56003A0C29 /* ExceptionTests.cpp */,
|
||||||
|
4AFC3AA812893E54003A0C29 /* MessageTests.cpp */,
|
||||||
|
4AFC3B0A12894114003A0C29 /* ClassTests.cpp */,
|
||||||
|
4AFC3B661289C7E3003A0C29 /* TrickyTests.cpp */,
|
||||||
|
);
|
||||||
|
name = Tests;
|
||||||
|
=======
|
||||||
|
4A59535E128E91FA009DC1B9 /* Test Cases */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
4A59535F128E920B009DC1B9 /* ClassTests.cpp */,
|
||||||
|
4A595360128E920B009DC1B9 /* ConditionTests.cpp */,
|
||||||
|
4A595361128E920B009DC1B9 /* ExceptionTests.cpp */,
|
||||||
|
4A595362128E920B009DC1B9 /* MessageTests.cpp */,
|
||||||
|
4A595363128E920B009DC1B9 /* TrickyTests.cpp */,
|
||||||
|
);
|
||||||
|
name = "Test Cases";
|
||||||
|
>>>>>>> 5f43a43662c8b9feca25aeccc79d1c7db664c9a0:Test/Xcode/Test.xcodeproj/project.pbxproj
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
4AFC341312809A12003A0C29 /* Catch */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
<<<<<<< HEAD:Test/Test.xcodeproj/project.pbxproj
|
||||||
|
4AFC342012809A45003A0C29 /* catch.hpp */,
|
||||||
|
4AFC341C12809A45003A0C29 /* catch_default_main.hpp */,
|
||||||
|
4AFC38161284B387003A0C29 /* catch_runner.hpp */,
|
||||||
|
4AA7E96B129FA282005A0B97 /* Reporters */,
|
||||||
|
=======
|
||||||
|
4A5955C412909CCC009DC1B9 /* catch_objc.hpp */,
|
||||||
|
4A59537F128E93CA009DC1B9 /* catch_default_main.hpp */,
|
||||||
|
4A595380128E93CA009DC1B9 /* catch_reporter_basic.hpp */,
|
||||||
|
4A595381128E93CA009DC1B9 /* catch_reporter_xml.hpp */,
|
||||||
|
4A595382128E93CA009DC1B9 /* catch_runner.hpp */,
|
||||||
|
4A595383128E93CA009DC1B9 /* catch.hpp */,
|
||||||
|
>>>>>>> 5f43a43662c8b9feca25aeccc79d1c7db664c9a0:Test/Xcode/Test.xcodeproj/project.pbxproj
|
||||||
|
4AFC341412809A1B003A0C29 /* Internal */,
|
||||||
|
);
|
||||||
|
name = Catch;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
4AFC341412809A1B003A0C29 /* Internal */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
4A595384128E93E0009DC1B9 /* catch_capture.hpp */,
|
||||||
|
4A595385128E93E1009DC1B9 /* catch_commandline.hpp */,
|
||||||
|
4A595386128E93E1009DC1B9 /* catch_common.h */,
|
||||||
|
4A595387128E93E1009DC1B9 /* catch_list.hpp */,
|
||||||
|
4A595388128E93E1009DC1B9 /* catch_registry.hpp */,
|
||||||
|
4A595389128E93E1009DC1B9 /* catch_reporter_registry.hpp */,
|
||||||
|
4A59538A128E93E1009DC1B9 /* catch_resultinfo.hpp */,
|
||||||
|
4A59538B128E93E1009DC1B9 /* catch_runner_impl.hpp */,
|
||||||
|
4A59538C128E93E1009DC1B9 /* catch_runnerconfig.hpp */,
|
||||||
|
4A59538D128E93E1009DC1B9 /* catch_section.hpp */,
|
||||||
|
4A59538E128E93E1009DC1B9 /* catch_testcaseinfo.hpp */,
|
||||||
|
);
|
||||||
|
name = Internal;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
C6859E8C029090F304C91782 /* Documentation */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
C6859E8B029090EE04C91782 /* Test.1 */,
|
||||||
|
);
|
||||||
|
name = Documentation;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
8DD76F620486A84900D96B5E /* Test */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "Test" */;
|
||||||
|
buildPhases = (
|
||||||
|
8DD76F640486A84900D96B5E /* Sources */,
|
||||||
|
8DD76F660486A84900D96B5E /* Frameworks */,
|
||||||
|
8DD76F690486A84900D96B5E /* CopyFiles */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Test;
|
||||||
|
productInstallPath = "$(HOME)/bin";
|
||||||
|
productName = Test;
|
||||||
|
productReference = 8DD76F6C0486A84900D96B5E /* Test */;
|
||||||
|
productType = "com.apple.product-type.tool";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "Test" */;
|
||||||
|
compatibilityVersion = "Xcode 3.1";
|
||||||
|
hasScannedForEncodings = 1;
|
||||||
|
mainGroup = 08FB7794FE84155DC02AAC07 /* Test */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
8DD76F620486A84900D96B5E /* Test */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
8DD76F640486A84900D96B5E /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
<<<<<<< HEAD:Test/Test.xcodeproj/project.pbxproj
|
||||||
|
4AFC38CD12887D80003A0C29 /* ConditionTests.cpp in Sources */,
|
||||||
|
4AFC3A9912893C56003A0C29 /* ExceptionTests.cpp in Sources */,
|
||||||
|
4AFC3AA912893E54003A0C29 /* MessageTests.cpp in Sources */,
|
||||||
|
4AFC3B0B12894114003A0C29 /* ClassTests.cpp in Sources */,
|
||||||
|
4AFC3B671289C7E3003A0C29 /* TrickyTests.cpp in Sources */,
|
||||||
|
4A3BFFB9128DCF06005609E3 /* TestMain.cpp in Sources */,
|
||||||
|
4AA7EA9212A438C7005A0B97 /* MiscTests.cpp in Sources */,
|
||||||
|
=======
|
||||||
|
4A595364128E920B009DC1B9 /* ClassTests.cpp in Sources */,
|
||||||
|
4A595365128E920B009DC1B9 /* ConditionTests.cpp in Sources */,
|
||||||
|
4A595366128E920B009DC1B9 /* ExceptionTests.cpp in Sources */,
|
||||||
|
4A595367128E920B009DC1B9 /* MessageTests.cpp in Sources */,
|
||||||
|
4A595368128E920B009DC1B9 /* TrickyTests.cpp in Sources */,
|
||||||
|
4A59537A128E9354009DC1B9 /* TestMain.cpp in Sources */,
|
||||||
|
>>>>>>> 5f43a43662c8b9feca25aeccc79d1c7db664c9a0:Test/Xcode/Test.xcodeproj/project.pbxproj
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
1DEB923208733DC60010E9CD /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||||
|
GCC_MODEL_TUNING = G5;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
INSTALL_PATH = /usr/local/bin;
|
||||||
|
PRODUCT_NAME = Test;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
1DEB923308733DC60010E9CD /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
GCC_MODEL_TUNING = G5;
|
||||||
|
INSTALL_PATH = /usr/local/bin;
|
||||||
|
PRODUCT_NAME = Test;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
1DEB923608733DC60010E9CD /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
PREBINDING = NO;
|
||||||
|
SDKROOT = macosx10.6;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
1DEB923708733DC60010E9CD /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
PREBINDING = NO;
|
||||||
|
SDKROOT = macosx10.6;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "Test" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
1DEB923208733DC60010E9CD /* Debug */,
|
||||||
|
1DEB923308733DC60010E9CD /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "Test" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
1DEB923608733DC60010E9CD /* Debug */,
|
||||||
|
1DEB923708733DC60010E9CD /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
|
||||||
|
}
|
143
catch_objc.hpp
Normal file
143
catch_objc.hpp
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
/*
|
||||||
|
* catch_objc.hpp
|
||||||
|
* Test
|
||||||
|
*
|
||||||
|
* Created by Phil on 14/11/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_HPP_INCLUDED
|
||||||
|
#define TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED
|
||||||
|
|
||||||
|
#import <objc/runtime.h>
|
||||||
|
#include <string>
|
||||||
|
#include "catch.hpp"
|
||||||
|
|
||||||
|
@protocol OcFixture
|
||||||
|
|
||||||
|
@optional
|
||||||
|
|
||||||
|
-(void) setUp;
|
||||||
|
-(void) tearDown;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
namespace Catch
|
||||||
|
{
|
||||||
|
class OcMethod : public TestCase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void invoke() const
|
||||||
|
{
|
||||||
|
id obj = class_createInstance( m_cls, 0 );
|
||||||
|
obj = [obj init];
|
||||||
|
|
||||||
|
if( [obj respondsToSelector: @selector(setUp) ] )
|
||||||
|
[obj performSelector: @selector(setUp)];
|
||||||
|
|
||||||
|
if( [obj respondsToSelector: m_sel] )
|
||||||
|
[obj performSelector: m_sel];
|
||||||
|
|
||||||
|
if( [obj respondsToSelector: @selector(tearDown) ] )
|
||||||
|
[obj performSelector: @selector(tearDown)];
|
||||||
|
|
||||||
|
[obj release];
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual TestCase* clone() const
|
||||||
|
{
|
||||||
|
return new OcMethod( m_cls, m_sel );
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool operator == ( const TestCase& other ) const
|
||||||
|
{
|
||||||
|
const OcMethod* ocmOther = dynamic_cast<const OcMethod*> ( &other );
|
||||||
|
return ocmOther && ocmOther->m_sel == m_sel;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool operator < ( const TestCase& other ) const
|
||||||
|
{
|
||||||
|
const OcMethod* ocmOther = dynamic_cast<const OcMethod*> ( &other );
|
||||||
|
return ocmOther && ocmOther->m_sel < m_sel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Class m_cls;
|
||||||
|
SEL m_sel;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace Detail
|
||||||
|
{
|
||||||
|
|
||||||
|
inline bool startsWith( const std::string& str, const std::string& sub )
|
||||||
|
{
|
||||||
|
return str.length() > sub.length() && str.substr( 0, sub.length() ) == sub;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const char* getAnnotation( Class cls, const std::string& annotationName, const std::string& testCaseName )
|
||||||
|
{
|
||||||
|
NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()];
|
||||||
|
SEL sel = NSSelectorFromString( selStr );
|
||||||
|
[selStr release];
|
||||||
|
if( [cls respondsToSelector: sel] )
|
||||||
|
return (const char*)[cls performSelector: sel];
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline size_t registerTestMethods()
|
||||||
|
{
|
||||||
|
size_t noTestMethods = 0;
|
||||||
|
int noClasses = objc_getClassList( NULL, 0 );
|
||||||
|
|
||||||
|
std::vector<Class> classes( noClasses );
|
||||||
|
objc_getClassList( &classes[0], noClasses );
|
||||||
|
|
||||||
|
for( int c = 0; c < noClasses; c++ )
|
||||||
|
{
|
||||||
|
Class cls = classes[c];
|
||||||
|
{
|
||||||
|
u_int count;
|
||||||
|
Method* methods = class_copyMethodList( cls, &count );
|
||||||
|
for( int m = 0; m < count ; m++ )
|
||||||
|
{
|
||||||
|
SEL selector = method_getName(methods[m]);
|
||||||
|
std::string methodName = sel_getName(selector);
|
||||||
|
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 );
|
||||||
|
|
||||||
|
TestRegistry::instance().registerTest( TestCaseInfo( new OcMethod( cls, selector ), name, desc ) );
|
||||||
|
noTestMethods++;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(methods);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return noTestMethods;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define OC_TEST_CASE( name, desc )\
|
||||||
|
+(const char*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Name_test ) \
|
||||||
|
{\
|
||||||
|
return name; \
|
||||||
|
}\
|
||||||
|
+(const char*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Description_test ) \
|
||||||
|
{ \
|
||||||
|
return desc; \
|
||||||
|
} \
|
||||||
|
-(void) INTERNAL_CATCH_UNIQUE_NAME( Catch_TestCase_test )
|
||||||
|
|
||||||
|
#endif // TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED
|
@ -18,14 +18,67 @@
|
|||||||
|
|
||||||
namespace Catch
|
namespace Catch
|
||||||
{
|
{
|
||||||
|
namespace Detail
|
||||||
|
{
|
||||||
|
// The following code, contributed by Sam Partington, allows us to choose an implementation
|
||||||
|
// of toString() depending on whether a << overload is available
|
||||||
|
|
||||||
|
struct NonStreamable
|
||||||
|
{
|
||||||
|
// allow construction from anything...
|
||||||
|
template<typename Anything>
|
||||||
|
NonStreamable(Anything)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
// a local operator<< which may be called if there isn't a better one elsewhere...
|
||||||
|
inline NonStreamable operator << ( std::ostream&, const NonStreamable& ns )
|
||||||
|
{
|
||||||
|
return ns;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
std::string toString( const T& value )
|
struct IsStreamable
|
||||||
|
{
|
||||||
|
static NoType Deduce( const NonStreamable& );
|
||||||
|
static YesType Deduce( std::ostream& );
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
value = sizeof( Deduce( Synth<std::ostream&>() << Synth<const T&>() ) )
|
||||||
|
== sizeof( YesType )
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// << is available, so use it with ostringstream to make the string
|
||||||
|
template<typename T, bool streamable>
|
||||||
|
struct StringMaker
|
||||||
|
{
|
||||||
|
static std::string apply( const T& value )
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << value;
|
oss << value;
|
||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// << not available - use a default string
|
||||||
|
template<typename T>
|
||||||
|
struct StringMaker<T, false>
|
||||||
|
{
|
||||||
|
static std::string apply( const T& value )
|
||||||
|
{
|
||||||
|
return "{?}";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}// end namespace Detail
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::string toString( const T& value )
|
||||||
|
{
|
||||||
|
return Detail::StringMaker<T, Detail::IsStreamable<T>::value>::apply( value );
|
||||||
|
}
|
||||||
|
|
||||||
class TestFailureException
|
class TestFailureException
|
||||||
{
|
{
|
||||||
|
@ -26,6 +26,12 @@ namespace Catch
|
|||||||
protected:
|
protected:
|
||||||
NonCopyable(){}
|
NonCopyable(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef char NoType;
|
||||||
|
typedef int YesType;
|
||||||
|
|
||||||
|
// create a T for use in sizeof expressions
|
||||||
|
template<typename T> T Synth();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
|
#endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
|
@ -16,8 +16,11 @@
|
|||||||
#include "catch_common.h"
|
#include "catch_common.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <set>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace Catch
|
namespace Catch
|
||||||
{
|
{
|
||||||
class TestRegistry
|
class TestRegistry
|
||||||
@ -32,17 +35,22 @@ public:
|
|||||||
|
|
||||||
void registerTest( const TestCaseInfo& testInfo )
|
void registerTest( const TestCaseInfo& testInfo )
|
||||||
{
|
{
|
||||||
m_functions.push_back( testInfo );
|
if( m_functions.find( testInfo ) == m_functions.end() )
|
||||||
|
{
|
||||||
|
m_functions.insert( testInfo );
|
||||||
|
m_functionsInOrder.push_back( testInfo );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<TestCaseInfo> getAllTests() const
|
std::vector<TestCaseInfo> getAllTests() const
|
||||||
{
|
{
|
||||||
return m_functions;
|
return m_functionsInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::vector<TestCaseInfo> m_functions;
|
std::set<TestCaseInfo> m_functions;
|
||||||
|
std::vector<TestCaseInfo> m_functionsInOrder;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void(*TestFunction)();
|
typedef void(*TestFunction)();
|
||||||
@ -63,6 +71,18 @@ struct FreeFunctionTestCase : TestCase
|
|||||||
return new FreeFunctionTestCase( fun );
|
return new FreeFunctionTestCase( fun );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool operator == ( const TestCase& other ) const
|
||||||
|
{
|
||||||
|
const FreeFunctionTestCase* ffOther = dynamic_cast<const FreeFunctionTestCase*> ( &other );
|
||||||
|
return ffOther && fun == ffOther->fun;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool operator < ( const TestCase& other ) const
|
||||||
|
{
|
||||||
|
const FreeFunctionTestCase* ffOther = dynamic_cast<const FreeFunctionTestCase*> ( &other );
|
||||||
|
return ffOther && fun < ffOther->fun;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TestFunction fun;
|
TestFunction fun;
|
||||||
};
|
};
|
||||||
@ -85,6 +105,18 @@ struct MethodTestCase : TestCase
|
|||||||
return new MethodTestCase<C>( method );
|
return new MethodTestCase<C>( method );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool operator == ( const TestCase& other ) const
|
||||||
|
{
|
||||||
|
const MethodTestCase* mtOther = dynamic_cast<const MethodTestCase*>( &other );
|
||||||
|
return mtOther && method == mtOther->method;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool operator < ( const TestCase& other ) const
|
||||||
|
{
|
||||||
|
const MethodTestCase* mtOther = dynamic_cast<const MethodTestCase*>( &other );
|
||||||
|
return mtOther && &method < &mtOther->method;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void (C::*method)();
|
void (C::*method)();
|
||||||
};
|
};
|
||||||
|
@ -23,6 +23,8 @@ namespace Catch
|
|||||||
virtual ~TestCase(){}
|
virtual ~TestCase(){}
|
||||||
virtual void invoke() const = 0;
|
virtual void invoke() const = 0;
|
||||||
virtual TestCase* clone() const = 0;
|
virtual TestCase* clone() const = 0;
|
||||||
|
virtual bool operator == ( const TestCase& other ) const = 0;
|
||||||
|
virtual bool operator < ( const TestCase& other ) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestCaseInfo
|
class TestCaseInfo
|
||||||
@ -79,6 +81,21 @@ namespace Catch
|
|||||||
description.swap( other.description );
|
description.swap( other.description );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator == ( const TestCaseInfo& other ) const
|
||||||
|
{
|
||||||
|
return *test == *other.test && name == other.name && description == other.description;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator < ( const TestCaseInfo& other ) const
|
||||||
|
{
|
||||||
|
if( name < other.name )
|
||||||
|
return true;
|
||||||
|
if( name > other.name )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return *test < *other.test;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TestCase* test;
|
TestCase* test;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
Loading…
Reference in New Issue
Block a user