From 2a017e5e2180b853e83bf48b63d3d9e04a696367 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Thu, 24 Dec 2015 11:06:08 -0500 Subject: [PATCH 01/14] Specs now import Cedar.h instead of CDRSpecHelper.h This is a modernization bringing them in line with what our spec template has had for a while. We also no longer need to conditional importing with quotes or angle brackets depending on platform --- Spec/CDRExampleGroupSpec.mm | 14 +------------- Spec/CDRExampleSpec.mm | 14 +------------- Spec/CDRSpecFailureSpec.mm | 15 +++------------ Spec/CDRSpecSpec.mm | 12 +----------- Spec/CDRSymbolicatorSpec.mm | 4 +--- Spec/CDRTypeUtilitiesSpec.mm | 2 +- Spec/Doubles/CDRClassFakeSpec.mm | 2 +- Spec/Doubles/CDRProtocolFakeSpec.mm | 2 +- Spec/Doubles/CDRSpySpec.mm | 7 ++----- Spec/Doubles/CedarDoubleARCSharedExamples.mm | 2 +- Spec/Doubles/CedarDoubleSharedExamples.mm | 10 +++++----- Spec/Doubles/CedarNiceFakeSharedExamples.mm | 3 +-- Spec/Doubles/CedarOrdinaryFakeSharedExamples.mm | 3 +-- Spec/Doubles/HaveReceivedSpec.mm | 5 +---- Spec/Focused/FocusedSpec.m | 9 +-------- Spec/Focused/FocusedSpec2.m | 9 +-------- Spec/GlobalBeforeEachSpec.mm | 9 +-------- Spec/Matchers/Base/BeCloseToSpec.mm | 9 +-------- Spec/Matchers/Base/BeFalsySpec.mm | 9 +-------- Spec/Matchers/Base/BeGTESpec.mm | 9 +-------- Spec/Matchers/Base/BeGreaterThanSpec.mm | 9 +-------- Spec/Matchers/Base/BeInstanceOfSpec.mm | 9 +-------- Spec/Matchers/Base/BeLTESpec.mm | 9 +-------- Spec/Matchers/Base/BeLessThanSpec.mm | 9 +-------- Spec/Matchers/Base/BeNilSpec.mm | 9 +-------- Spec/Matchers/Base/BeNil_ARCSpec.mm | 9 +-------- Spec/Matchers/Base/BeSameInstanceAsSpec.mm | 9 +-------- Spec/Matchers/Base/BeSameInstanceAs_ARCSpec.mm | 9 +-------- Spec/Matchers/Base/BeTruthySpec.mm | 9 +-------- Spec/Matchers/Base/ConformToSpec.mm | 9 +-------- Spec/Matchers/Base/EqualSpec.mm | 11 ++--------- Spec/Matchers/Base/ExistSpec.mm | 9 +-------- Spec/Matchers/Base/MutableEqualSpec.mm | 9 +-------- Spec/Matchers/Base/RaiseExceptionSpec.mm | 9 +-------- Spec/Matchers/Base/RespondToSpec.mm | 9 +-------- Spec/Matchers/Container/BeEmptySpec.mm | 13 +------------ Spec/Matchers/Container/ContainSpec.mm | 9 +-------- Spec/Matchers/Container/ContainSubsetSpec.mm | 5 +---- Spec/Matchers/ExpectFailureWithMessage.mm | 2 +- Spec/Matchers/OSX/OSXGeometryEqualSpecSpec.mm | 3 --- Spec/Matchers/UIKit/UIKitContainSpec.mm | 2 +- Spec/Matchers/UIKit/UIKitEqualSpec.mm | 2 +- Spec/Reporters/CDRDefaultReporterSpec.mm | 14 +------------- Spec/Reporters/CDRJUnitXMLReporterSpec.mm | 12 +----------- Spec/Reporters/CDROTestReporterSpec.mm | 13 +------------ Spec/ShouldSyntaxSpec.mm | 12 +----------- Spec/SpecBundle/SpecBundleApplicationTests.mm | 2 +- Spec/SpecSpec.mm | 11 +---------- Spec/iOS/CDRSpyiOSSpec.mm | 2 +- Spec/iOS/CedarApplicationDelegateSpec.mm | 3 +-- Spec/iOS/WeakReferenceCompatibilitySpec.mm | 2 +- Spec/iOS/XCTest/CDRXTestSuiteSpec.mm | 11 +---------- 52 files changed, 59 insertions(+), 345 deletions(-) diff --git a/Spec/CDRExampleGroupSpec.mm b/Spec/CDRExampleGroupSpec.mm index 1643c3bf..99198c8b 100644 --- a/Spec/CDRExampleGroupSpec.mm +++ b/Spec/CDRExampleGroupSpec.mm @@ -1,16 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -#import "CDRExampleBase.h" -#import "CDRExampleGroup.h" -#import "CDRExample.h" -#import "CDRExampleReporter.h" +#import "Cedar.h" #import "SimpleKeyValueObserver.h" #import "FibonacciCalculator.h" #import "CDRReportDispatcher.h" diff --git a/Spec/CDRExampleSpec.mm b/Spec/CDRExampleSpec.mm index 3201795a..15b92d8a 100644 --- a/Spec/CDRExampleSpec.mm +++ b/Spec/CDRExampleSpec.mm @@ -1,16 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -#import "CDRExample.h" -#import "CDRExampleGroup.h" -#import "CDRSpecFailure.h" -#import "CDRExampleReporter.h" +#import "Cedar.h" #import "SimpleKeyValueObserver.h" #import "FibonacciCalculator.h" #import "CDRReportDispatcher.h" diff --git a/Spec/CDRSpecFailureSpec.mm b/Spec/CDRSpecFailureSpec.mm index 227d4bec..68552b54 100644 --- a/Spec/CDRSpecFailureSpec.mm +++ b/Spec/CDRSpecFailureSpec.mm @@ -1,13 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -#import "CDRSpecFailure.h" +#import "Cedar.h" #import "CDRSymbolicator.h" using namespace Cedar::Matchers; @@ -193,8 +184,8 @@ it(@"returns string with symbolicated call stack " "showing originating error location closest to the top", ^{ symbols should contain( - @" *CDRSpecFailureSpec.mm:165\n" - " *CDRSpecFailureSpec.mm:171\n" + @" *CDRSpecFailureSpec.mm:156\n" + " *CDRSpecFailureSpec.mm:162\n" ); }); diff --git a/Spec/CDRSpecSpec.mm b/Spec/CDRSpecSpec.mm index a965e3c7..aeaee689 100644 --- a/Spec/CDRSpecSpec.mm +++ b/Spec/CDRSpecSpec.mm @@ -1,14 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -#import "CDRSpec.h" -#import "CDRExampleGroup.h" +#import "Cedar.h" using namespace Cedar::Matchers; using namespace Cedar::Doubles; diff --git a/Spec/CDRSymbolicatorSpec.mm b/Spec/CDRSymbolicatorSpec.mm index e1bdfbe8..77b64aac 100644 --- a/Spec/CDRSymbolicatorSpec.mm +++ b/Spec/CDRSymbolicatorSpec.mm @@ -1,6 +1,4 @@ -#import "CDRSpecHelper.h" -#import "CDRExample.h" -#import "CDRExampleGroup.h" +#import "Cedar.h" #import "CDRSymbolicator.h" using namespace Cedar::Matchers; diff --git a/Spec/CDRTypeUtilitiesSpec.mm b/Spec/CDRTypeUtilitiesSpec.mm index e81cabaa..154965bb 100644 --- a/Spec/CDRTypeUtilitiesSpec.mm +++ b/Spec/CDRTypeUtilitiesSpec.mm @@ -1,4 +1,4 @@ -#import +#import "Cedar.h" #import "CDRTypeUtilities.h" #import "CDRNil.h" diff --git a/Spec/Doubles/CDRClassFakeSpec.mm b/Spec/Doubles/CDRClassFakeSpec.mm index 8a86fa93..506ac80b 100644 --- a/Spec/Doubles/CDRClassFakeSpec.mm +++ b/Spec/Doubles/CDRClassFakeSpec.mm @@ -1,4 +1,4 @@ -#import +#import "Cedar.h" #import "SimpleIncrementer.h" #import "ObjectWithForwardingTarget.h" #import "ObjectWithWeakDelegate.h" diff --git a/Spec/Doubles/CDRProtocolFakeSpec.mm b/Spec/Doubles/CDRProtocolFakeSpec.mm index 34c6877b..f0af776c 100644 --- a/Spec/Doubles/CDRProtocolFakeSpec.mm +++ b/Spec/Doubles/CDRProtocolFakeSpec.mm @@ -1,4 +1,4 @@ -#import +#import "Cedar.h" #import #import "SimpleIncrementer.h" #import "SimpleMultiplier.h" diff --git a/Spec/Doubles/CDRSpySpec.mm b/Spec/Doubles/CDRSpySpec.mm index b116b1e5..87f65b75 100644 --- a/Spec/Doubles/CDRSpySpec.mm +++ b/Spec/Doubles/CDRSpySpec.mm @@ -1,4 +1,4 @@ -#import +#import "Cedar.h" #import "SimpleIncrementer.h" #import "ObjectWithForwardingTarget.h" #import "ArgumentReleaser.h" @@ -7,13 +7,10 @@ #import "ArgumentReleaser.h" #import "ObjectWithValueEquality.h" #import "DeallocNotifier.h" -#import - -extern "C" { #import "ExpectFailureWithMessage.h" #import "ObjectWithCollections.h" #import "CedarObservedObject.h" -} +#import using namespace Cedar::Matchers; using namespace Cedar::Doubles; diff --git a/Spec/Doubles/CedarDoubleARCSharedExamples.mm b/Spec/Doubles/CedarDoubleARCSharedExamples.mm index f2ad2439..3e053953 100644 --- a/Spec/Doubles/CedarDoubleARCSharedExamples.mm +++ b/Spec/Doubles/CedarDoubleARCSharedExamples.mm @@ -1,4 +1,4 @@ -#import +#import "Cedar.h" #import "SimpleIncrementer.h" #if !__has_feature(objc_arc) diff --git a/Spec/Doubles/CedarDoubleSharedExamples.mm b/Spec/Doubles/CedarDoubleSharedExamples.mm index c24f0173..b8a57809 100644 --- a/Spec/Doubles/CedarDoubleSharedExamples.mm +++ b/Spec/Doubles/CedarDoubleSharedExamples.mm @@ -1,4 +1,4 @@ -#import +#import "Cedar.h" #import "SimpleIncrementer.h" #import "StubbedMethod.h" #import "CedarDoubleImpl.h" @@ -27,7 +27,7 @@ [[myDouble sent_messages] count] should equal(1); }); }); - + describe(@"sent_messages_with_selector", ^{ beforeEach(^{ myDouble stub_method("incrementBy:"); @@ -39,17 +39,17 @@ [myDouble incrementBy:4]; [myDouble incrementByInteger:5]; }); - + it(@"should return all invocations for messages sent that match the given selector", ^{ NSArray *sentMessages = [myDouble sent_messages_with_selector:@selector(incrementBy:)]; sentMessages.count should equal(2); - + NSInvocation *firstInvocation = sentMessages.firstObject; firstInvocation.selector should equal(@selector(incrementBy:)); NSUInteger firstIncrement; [firstInvocation getArgument:&firstIncrement atIndex:2]; firstIncrement should equal(2); - + NSInvocation *secondInvocation = sentMessages.lastObject; secondInvocation.selector should equal(@selector(incrementBy:)); NSUInteger secondIncrement; diff --git a/Spec/Doubles/CedarNiceFakeSharedExamples.mm b/Spec/Doubles/CedarNiceFakeSharedExamples.mm index 92eb0369..24755bbd 100644 --- a/Spec/Doubles/CedarNiceFakeSharedExamples.mm +++ b/Spec/Doubles/CedarNiceFakeSharedExamples.mm @@ -1,6 +1,5 @@ -#import +#import "Cedar.h" #import "SimpleIncrementer.h" -#import "StubbedMethod.h" SHARED_EXAMPLE_GROUPS_BEGIN(CedarNiceFakeSharedExamples) diff --git a/Spec/Doubles/CedarOrdinaryFakeSharedExamples.mm b/Spec/Doubles/CedarOrdinaryFakeSharedExamples.mm index 060f342b..a6d41e0b 100644 --- a/Spec/Doubles/CedarOrdinaryFakeSharedExamples.mm +++ b/Spec/Doubles/CedarOrdinaryFakeSharedExamples.mm @@ -1,6 +1,5 @@ -#import +#import "Cedar.h" #import "SimpleIncrementer.h" -#import "StubbedMethod.h" SHARED_EXAMPLE_GROUPS_BEGIN(CedarOrdinaryFakeSharedExamples) diff --git a/Spec/Doubles/HaveReceivedSpec.mm b/Spec/Doubles/HaveReceivedSpec.mm index b3051a2c..cd49ef3a 100644 --- a/Spec/Doubles/HaveReceivedSpec.mm +++ b/Spec/Doubles/HaveReceivedSpec.mm @@ -1,9 +1,6 @@ -#import +#import "Cedar.h" #import "SimpleIncrementer.h" - -extern "C" { #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; using namespace Cedar::Doubles; diff --git a/Spec/Focused/FocusedSpec.m b/Spec/Focused/FocusedSpec.m index 2876f00e..08d2c6d6 100644 --- a/Spec/Focused/FocusedSpec.m +++ b/Spec/Focused/FocusedSpec.m @@ -1,11 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif +#import "Cedar.h" NSMutableArray *calledInFocusedSpec__ = nil; NSMutableArray *expectedCallsInFocusedSpec__ = nil; diff --git a/Spec/Focused/FocusedSpec2.m b/Spec/Focused/FocusedSpec2.m index ede8414e..fafba6be 100644 --- a/Spec/Focused/FocusedSpec2.m +++ b/Spec/Focused/FocusedSpec2.m @@ -1,11 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif +#import "Cedar.h" NSMutableArray *calledInFocusedSpec2__ = nil; NSMutableArray *expectedCallsInFocusedSpec2__ = nil; diff --git a/Spec/GlobalBeforeEachSpec.mm b/Spec/GlobalBeforeEachSpec.mm index 40f5ad3b..1763dcfa 100644 --- a/Spec/GlobalBeforeEachSpec.mm +++ b/Spec/GlobalBeforeEachSpec.mm @@ -1,11 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif +#import "Cedar.h" static unsigned int globalValue__ = 0; diff --git a/Spec/Matchers/Base/BeCloseToSpec.mm b/Spec/Matchers/Base/BeCloseToSpec.mm index 39bb4edd..fad75dae 100644 --- a/Spec/Matchers/Base/BeCloseToSpec.mm +++ b/Spec/Matchers/Base/BeCloseToSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/BeFalsySpec.mm b/Spec/Matchers/Base/BeFalsySpec.mm index 2c1647ab..47a66ca9 100644 --- a/Spec/Matchers/Base/BeFalsySpec.mm +++ b/Spec/Matchers/Base/BeFalsySpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; using namespace Cedar::Doubles; diff --git a/Spec/Matchers/Base/BeGTESpec.mm b/Spec/Matchers/Base/BeGTESpec.mm index 9b0712ca..c7e1a7cd 100644 --- a/Spec/Matchers/Base/BeGTESpec.mm +++ b/Spec/Matchers/Base/BeGTESpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/BeGreaterThanSpec.mm b/Spec/Matchers/Base/BeGreaterThanSpec.mm index 2c1a7e86..e5969a60 100644 --- a/Spec/Matchers/Base/BeGreaterThanSpec.mm +++ b/Spec/Matchers/Base/BeGreaterThanSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/BeInstanceOfSpec.mm b/Spec/Matchers/Base/BeInstanceOfSpec.mm index 509967cb..b3389b6f 100644 --- a/Spec/Matchers/Base/BeInstanceOfSpec.mm +++ b/Spec/Matchers/Base/BeInstanceOfSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} @interface FooBase : NSObject; @end @implementation FooBase; @end diff --git a/Spec/Matchers/Base/BeLTESpec.mm b/Spec/Matchers/Base/BeLTESpec.mm index d9f0740b..a5bc665f 100644 --- a/Spec/Matchers/Base/BeLTESpec.mm +++ b/Spec/Matchers/Base/BeLTESpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/BeLessThanSpec.mm b/Spec/Matchers/Base/BeLessThanSpec.mm index fa1bc8d3..fb852b77 100644 --- a/Spec/Matchers/Base/BeLessThanSpec.mm +++ b/Spec/Matchers/Base/BeLessThanSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/BeNilSpec.mm b/Spec/Matchers/Base/BeNilSpec.mm index 0b2c1c8e..6e7c6575 100644 --- a/Spec/Matchers/Base/BeNilSpec.mm +++ b/Spec/Matchers/Base/BeNilSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/BeNil_ARCSpec.mm b/Spec/Matchers/Base/BeNil_ARCSpec.mm index 5890d8ed..74569c48 100644 --- a/Spec/Matchers/Base/BeNil_ARCSpec.mm +++ b/Spec/Matchers/Base/BeNil_ARCSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/BeSameInstanceAsSpec.mm b/Spec/Matchers/Base/BeSameInstanceAsSpec.mm index d3ce4ecf..9c018d4d 100644 --- a/Spec/Matchers/Base/BeSameInstanceAsSpec.mm +++ b/Spec/Matchers/Base/BeSameInstanceAsSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/BeSameInstanceAs_ARCSpec.mm b/Spec/Matchers/Base/BeSameInstanceAs_ARCSpec.mm index 3d2da7bc..ed3381be 100644 --- a/Spec/Matchers/Base/BeSameInstanceAs_ARCSpec.mm +++ b/Spec/Matchers/Base/BeSameInstanceAs_ARCSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/BeTruthySpec.mm b/Spec/Matchers/Base/BeTruthySpec.mm index 21b10b23..74d1a4b0 100644 --- a/Spec/Matchers/Base/BeTruthySpec.mm +++ b/Spec/Matchers/Base/BeTruthySpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/ConformToSpec.mm b/Spec/Matchers/Base/ConformToSpec.mm index f009a61f..c2555cab 100644 --- a/Spec/Matchers/Base/ConformToSpec.mm +++ b/Spec/Matchers/Base/ConformToSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} @protocol INonConformer @end diff --git a/Spec/Matchers/Base/EqualSpec.mm b/Spec/Matchers/Base/EqualSpec.mm index 36ec2e26..c8e1c4fb 100644 --- a/Spec/Matchers/Base/EqualSpec.mm +++ b/Spec/Matchers/Base/EqualSpec.mm @@ -1,17 +1,10 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif +#import "Cedar.h" +#import "ExpectFailureWithMessage.h" #ifndef NS_ROOT_CLASS #define NS_ROOT_CLASS #endif -extern "C" { -#import "ExpectFailureWithMessage.h" -} - using namespace Cedar::Matchers; @interface CustomObject : NSObject { diff --git a/Spec/Matchers/Base/ExistSpec.mm b/Spec/Matchers/Base/ExistSpec.mm index 9f5d96d8..1a1d03c6 100644 --- a/Spec/Matchers/Base/ExistSpec.mm +++ b/Spec/Matchers/Base/ExistSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/MutableEqualSpec.mm b/Spec/Matchers/Base/MutableEqualSpec.mm index c3ac7e6e..0a63b905 100644 --- a/Spec/Matchers/Base/MutableEqualSpec.mm +++ b/Spec/Matchers/Base/MutableEqualSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Base/RaiseExceptionSpec.mm b/Spec/Matchers/Base/RaiseExceptionSpec.mm index b88f8dd9..af677362 100644 --- a/Spec/Matchers/Base/RaiseExceptionSpec.mm +++ b/Spec/Matchers/Base/RaiseExceptionSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} @interface CustomException : NSException; @end @implementation CustomException; @end diff --git a/Spec/Matchers/Base/RespondToSpec.mm b/Spec/Matchers/Base/RespondToSpec.mm index 21cceadb..7d2f128d 100644 --- a/Spec/Matchers/Base/RespondToSpec.mm +++ b/Spec/Matchers/Base/RespondToSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} @interface TestResponder : NSObject + (void)classMethod; diff --git a/Spec/Matchers/Container/BeEmptySpec.mm b/Spec/Matchers/Container/BeEmptySpec.mm index 081a905c..03c725f2 100644 --- a/Spec/Matchers/Container/BeEmptySpec.mm +++ b/Spec/Matchers/Container/BeEmptySpec.mm @@ -1,16 +1,5 @@ -#if TARGET_OS_IPHONE -#import "CDRSpecHelper.h" -#else -#import -#endif - -#include -#include -#include - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Container/ContainSpec.mm b/Spec/Matchers/Container/ContainSpec.mm index 43519482..7a2ec21c 100644 --- a/Spec/Matchers/Container/ContainSpec.mm +++ b/Spec/Matchers/Container/ContainSpec.mm @@ -1,12 +1,5 @@ -#if TARGET_OS_IPHONE -#import "CDRSpecHelper.h" -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/Container/ContainSubsetSpec.mm b/Spec/Matchers/Container/ContainSubsetSpec.mm index e130aac5..2f769277 100644 --- a/Spec/Matchers/Container/ContainSubsetSpec.mm +++ b/Spec/Matchers/Container/ContainSubsetSpec.mm @@ -1,8 +1,5 @@ -#import - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; using namespace Cedar::Doubles; diff --git a/Spec/Matchers/ExpectFailureWithMessage.mm b/Spec/Matchers/ExpectFailureWithMessage.mm index 7aea6191..f0bb5bab 100644 --- a/Spec/Matchers/ExpectFailureWithMessage.mm +++ b/Spec/Matchers/ExpectFailureWithMessage.mm @@ -1,5 +1,5 @@ #import "ExpectFailureWithMessage.h" -#import "CDRSpec.h" +#import "CedarMatchers.h" #import "CDRSpecFailure.h" using namespace Cedar::Matchers; diff --git a/Spec/Matchers/OSX/OSXGeometryEqualSpecSpec.mm b/Spec/Matchers/OSX/OSXGeometryEqualSpecSpec.mm index 371a6cff..b259a31f 100644 --- a/Spec/Matchers/OSX/OSXGeometryEqualSpecSpec.mm +++ b/Spec/Matchers/OSX/OSXGeometryEqualSpecSpec.mm @@ -1,9 +1,6 @@ #import #import "Cedar.h" - -extern "C" { #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/Matchers/UIKit/UIKitContainSpec.mm b/Spec/Matchers/UIKit/UIKitContainSpec.mm index f81a6b66..edb7bef9 100644 --- a/Spec/Matchers/UIKit/UIKitContainSpec.mm +++ b/Spec/Matchers/UIKit/UIKitContainSpec.mm @@ -1,4 +1,4 @@ -#import "CDRSpecHelper.h" +#import "Cedar.h" #import "ExpectFailureWithMessage.h" using namespace Cedar::Matchers; diff --git a/Spec/Matchers/UIKit/UIKitEqualSpec.mm b/Spec/Matchers/UIKit/UIKitEqualSpec.mm index 25b925d5..ec78f973 100644 --- a/Spec/Matchers/UIKit/UIKitEqualSpec.mm +++ b/Spec/Matchers/UIKit/UIKitEqualSpec.mm @@ -1,4 +1,4 @@ -#import "CDRSpecHelper.h" +#import "Cedar.h" #import "ExpectFailureWithMessage.h" using namespace Cedar::Matchers; diff --git a/Spec/Reporters/CDRDefaultReporterSpec.mm b/Spec/Reporters/CDRDefaultReporterSpec.mm index 4257e67d..0347f074 100644 --- a/Spec/Reporters/CDRDefaultReporterSpec.mm +++ b/Spec/Reporters/CDRDefaultReporterSpec.mm @@ -1,16 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -#import "CDRExample.h" -#import "CDRExampleGroup.h" -#import "CDRDefaultReporter.h" -#import +#import "Cedar.h" using namespace Cedar::Matchers; using namespace Cedar::Doubles; diff --git a/Spec/Reporters/CDRJUnitXMLReporterSpec.mm b/Spec/Reporters/CDRJUnitXMLReporterSpec.mm index def95992..7b5a29b1 100644 --- a/Spec/Reporters/CDRJUnitXMLReporterSpec.mm +++ b/Spec/Reporters/CDRJUnitXMLReporterSpec.mm @@ -1,14 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -#import "CDRExample.h" -#import "CDRJUnitXMLReporter.h" +#import "Cedar.h" #import "GDataXMLNode.h" #import "ExampleWithPublicRunDates.h" diff --git a/Spec/Reporters/CDROTestReporterSpec.mm b/Spec/Reporters/CDROTestReporterSpec.mm index 9d74e995..80abbfed 100644 --- a/Spec/Reporters/CDROTestReporterSpec.mm +++ b/Spec/Reporters/CDROTestReporterSpec.mm @@ -1,15 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -#import "CDROTestReporter.h" -#import "CDRExampleGroup.h" -#import "CDRExample.h" +#import "Cedar.h" #import "CDRReportDispatcher.h" #import diff --git a/Spec/ShouldSyntaxSpec.mm b/Spec/ShouldSyntaxSpec.mm index b5b18da1..8d171188 100644 --- a/Spec/ShouldSyntaxSpec.mm +++ b/Spec/ShouldSyntaxSpec.mm @@ -1,15 +1,5 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -extern "C" { +#import "Cedar.h" #import "ExpectFailureWithMessage.h" -} using namespace Cedar::Matchers; diff --git a/Spec/SpecBundle/SpecBundleApplicationTests.mm b/Spec/SpecBundle/SpecBundleApplicationTests.mm index 192b1b4d..b76c8ffd 100644 --- a/Spec/SpecBundle/SpecBundleApplicationTests.mm +++ b/Spec/SpecBundle/SpecBundleApplicationTests.mm @@ -1,4 +1,4 @@ -#import "CDRSpecHelper.h" +#import "Cedar.h" #import "iOSHostAppDelegate.h" // should NOT be included in Cedar iOS SpecBundle target using namespace Cedar::Matchers; diff --git a/Spec/SpecSpec.mm b/Spec/SpecSpec.mm index cf3f8df3..0e38ccaa 100644 --- a/Spec/SpecSpec.mm +++ b/Spec/SpecSpec.mm @@ -1,13 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -#import "CDRSpecFailure.h" +#import "Cedar.h" using namespace Cedar::Matchers; diff --git a/Spec/iOS/CDRSpyiOSSpec.mm b/Spec/iOS/CDRSpyiOSSpec.mm index 0ac98e46..0d1574fe 100644 --- a/Spec/iOS/CDRSpyiOSSpec.mm +++ b/Spec/iOS/CDRSpyiOSSpec.mm @@ -1,5 +1,5 @@ #import -#import "CDRSpecHelper.h" +#import "Cedar.h" using namespace Cedar::Matchers; using namespace Cedar::Doubles; diff --git a/Spec/iOS/CedarApplicationDelegateSpec.mm b/Spec/iOS/CedarApplicationDelegateSpec.mm index 53d28ebb..3c5869fd 100644 --- a/Spec/iOS/CedarApplicationDelegateSpec.mm +++ b/Spec/iOS/CedarApplicationDelegateSpec.mm @@ -1,5 +1,4 @@ -#import "CDRSpecHelper.h" -#import "CedarApplicationDelegate.h" +#import "Cedar.h" using namespace Cedar::Matchers; using namespace Cedar::Doubles; diff --git a/Spec/iOS/WeakReferenceCompatibilitySpec.mm b/Spec/iOS/WeakReferenceCompatibilitySpec.mm index 269241c8..365d5fe1 100644 --- a/Spec/iOS/WeakReferenceCompatibilitySpec.mm +++ b/Spec/iOS/WeakReferenceCompatibilitySpec.mm @@ -1,4 +1,4 @@ -#import "CDRSpecHelper.h" +#import "Cedar.h" #import "ObjectWithWeakDelegate.h" #import "ARCViewController.h" diff --git a/Spec/iOS/XCTest/CDRXTestSuiteSpec.mm b/Spec/iOS/XCTest/CDRXTestSuiteSpec.mm index 28c14a80..b3af296a 100644 --- a/Spec/iOS/XCTest/CDRXTestSuiteSpec.mm +++ b/Spec/iOS/XCTest/CDRXTestSuiteSpec.mm @@ -1,13 +1,4 @@ -#if TARGET_OS_IPHONE -// Normally you would include this file out of the framework. However, we're -// testing the framework here, so including the file from the framework will -// conflict with the compiler attempting to include the file from the project. -#import "CDRSpecHelper.h" -#else -#import -#endif - -#import "CDRSpec.h" +#import "Cedar.h" #import "CDRXCTestSuite.h" #import "CDRReportDispatcher.h" #import "CDRXCTestSupport.h" From edf284a319ef5b1acf71520e34586e4d8b69b2cc Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Thu, 24 Dec 2015 11:11:10 -0500 Subject: [PATCH 02/14] Weaken the Objective-C++ requirement * Remove requirement that Cedar.h itself only be imported by Objective-C++ files * Conditionally compile C++ constructs in individual headers --- Source/Headers/Public/Cedar.h | 4 ---- Source/Headers/Public/Doubles/Arguments/AnyArgument.h | 4 ++++ .../Public/Doubles/Arguments/AnyInstanceArgument.h | 4 ++++ .../Arguments/AnyInstanceConformingToProtocolArgument.h | 4 ++++ .../Doubles/Arguments/AnyInstanceOfClassArgument.h | 4 ++++ Source/Headers/Public/Doubles/Arguments/Argument.h | 5 +++++ Source/Headers/Public/Doubles/Arguments/ReturnValue.h | 4 ++++ Source/Headers/Public/Doubles/Arguments/ValueArgument.h | 4 ++++ Source/Headers/Public/Doubles/CDRClassFake.h | 4 ++++ Source/Headers/Public/Doubles/CDRFake.h | 4 ++++ Source/Headers/Public/Doubles/CDRProtocolFake.h | 4 ++++ Source/Headers/Public/Doubles/CDRSpy.h | 4 ++++ Source/Headers/Public/Doubles/CedarDouble.h | 4 ++++ Source/Headers/Public/Doubles/HaveReceived.h | 4 ++++ Source/Headers/Public/Doubles/InvocationMatcher.h | 7 ++++++- Source/Headers/Public/Doubles/RejectedMethod.h | 9 +++++++-- Source/Headers/Public/Doubles/StubbedMethod.h | 9 +++++++-- Source/Headers/Public/Matchers/ActualValue.h | 5 +++++ Source/Headers/Public/Matchers/Base/Base.h | 6 +++++- Source/Headers/Public/Matchers/Base/BeCloseTo.h | 4 ++++ Source/Headers/Public/Matchers/Base/BeFalsy.h | 4 ++++ Source/Headers/Public/Matchers/Base/BeGTE.h | 4 ++++ Source/Headers/Public/Matchers/Base/BeGreaterThan.h | 4 ++++ Source/Headers/Public/Matchers/Base/BeInstanceOf.h | 4 ++++ Source/Headers/Public/Matchers/Base/BeLTE.h | 4 ++++ Source/Headers/Public/Matchers/Base/BeLessThan.h | 4 ++++ Source/Headers/Public/Matchers/Base/BeNil.h | 4 ++++ Source/Headers/Public/Matchers/Base/BeSameInstanceAs.h | 4 ++++ Source/Headers/Public/Matchers/Base/BeTruthy.h | 4 ++++ Source/Headers/Public/Matchers/Base/BlockMatcher.h | 4 ++++ Source/Headers/Public/Matchers/Base/ConformTo.h | 4 ++++ Source/Headers/Public/Matchers/Base/Equal.h | 5 +++++ Source/Headers/Public/Matchers/Base/Exist.h | 4 ++++ Source/Headers/Public/Matchers/Base/RaiseException.h | 5 +++++ Source/Headers/Public/Matchers/Base/RespondTo.h | 4 ++++ .../Headers/Public/Matchers/Comparators/AnInstanceOf.h | 4 ++++ .../Public/Matchers/Comparators/ComparatorsContainer.h | 4 ++++ .../Comparators/ComparatorsContainerConvenience.h | 4 ++++ .../Headers/Public/Matchers/Comparators/CompareCloseTo.h | 4 ++++ .../Headers/Public/Matchers/Comparators/CompareEqual.h | 4 ++++ .../Public/Matchers/Comparators/CompareGreaterThan.h | 4 ++++ Source/Headers/Public/Matchers/Container/BeEmpty.h | 4 ++++ Source/Headers/Public/Matchers/Container/Contain.h | 4 ++++ Source/Headers/Public/Matchers/Container/ContainSubset.h | 4 ++++ Source/Headers/Public/Matchers/MatcherTemplate.h | 4 ++++ .../Public/Matchers/OSX/OSXGeometryCompareEqual.h | 4 ++++ .../Public/Matchers/OSX/OSXGeometryStringifiers.h | 7 ++++++- Source/Headers/Public/Matchers/ShouldSyntax.h | 4 ++++ .../Public/Matchers/Stringifiers/StringifiersBase.h | 5 +++++ .../Public/Matchers/Stringifiers/StringifiersContainer.h | 4 ++++ .../Public/Matchers/UIKit/UIGeometryCompareEqual.h | 4 ++++ .../Public/Matchers/UIKit/UIGeometryStringifiers.h | 8 +++++++- .../Matchers/UIKit/iOS/UIKitComparatorsContainer.h | 4 ++++ 53 files changed, 227 insertions(+), 12 deletions(-) diff --git a/Source/Headers/Public/Cedar.h b/Source/Headers/Public/Cedar.h index 8452f0ee..f2e989d1 100644 --- a/Source/Headers/Public/Cedar.h +++ b/Source/Headers/Public/Cedar.h @@ -1,7 +1,3 @@ -#ifndef __cplusplus -#error Cedar may only be imported from Objective-C++ (.mm) files. -#endif - #pragma mark - Cedar Core #import "CDRVersion.h" diff --git a/Source/Headers/Public/Doubles/Arguments/AnyArgument.h b/Source/Headers/Public/Doubles/Arguments/AnyArgument.h index 11569ff3..af9768c2 100644 --- a/Source/Headers/Public/Doubles/Arguments/AnyArgument.h +++ b/Source/Headers/Public/Doubles/Arguments/AnyArgument.h @@ -1,5 +1,7 @@ #import "Argument.h" +#ifdef __cplusplus + namespace Cedar { namespace Doubles { class AnyArgument : public Argument { @@ -25,3 +27,5 @@ namespace Cedar { namespace Doubles { } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/Arguments/AnyInstanceArgument.h b/Source/Headers/Public/Doubles/Arguments/AnyInstanceArgument.h index 0f698e17..1e2c35ef 100644 --- a/Source/Headers/Public/Doubles/Arguments/AnyInstanceArgument.h +++ b/Source/Headers/Public/Doubles/Arguments/AnyInstanceArgument.h @@ -1,5 +1,7 @@ #import "Argument.h" +#ifdef __cplusplus + namespace Cedar { namespace Doubles { class AnyInstanceArgument : public Argument { @@ -15,3 +17,5 @@ namespace Cedar { namespace Doubles { virtual unsigned int specificity_ranking() const { return 1; } }; }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/Arguments/AnyInstanceConformingToProtocolArgument.h b/Source/Headers/Public/Doubles/Arguments/AnyInstanceConformingToProtocolArgument.h index 9c5dbec8..aefe9096 100644 --- a/Source/Headers/Public/Doubles/Arguments/AnyInstanceConformingToProtocolArgument.h +++ b/Source/Headers/Public/Doubles/Arguments/AnyInstanceConformingToProtocolArgument.h @@ -1,5 +1,7 @@ #import "AnyInstanceArgument.h" +#ifdef __cplusplus + namespace Cedar { namespace Doubles { class AnyInstanceConformingToProtocolArgument : public AnyInstanceArgument { @@ -22,3 +24,5 @@ namespace Cedar { namespace Doubles { Argument::shared_ptr_t any(Protocol *); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/Arguments/AnyInstanceOfClassArgument.h b/Source/Headers/Public/Doubles/Arguments/AnyInstanceOfClassArgument.h index 33f6db16..f8f7aa51 100644 --- a/Source/Headers/Public/Doubles/Arguments/AnyInstanceOfClassArgument.h +++ b/Source/Headers/Public/Doubles/Arguments/AnyInstanceOfClassArgument.h @@ -1,5 +1,7 @@ #import "AnyInstanceArgument.h" +#ifdef __cplusplus + namespace Cedar { namespace Doubles { class AnyInstanceOfClassArgument : public AnyInstanceArgument { @@ -22,3 +24,5 @@ namespace Cedar { namespace Doubles { Argument::shared_ptr_t any(Class); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/Arguments/Argument.h b/Source/Headers/Public/Doubles/Arguments/Argument.h index ae06c5f6..8368a0dd 100644 --- a/Source/Headers/Public/Doubles/Arguments/Argument.h +++ b/Source/Headers/Public/Doubles/Arguments/Argument.h @@ -1,4 +1,7 @@ #import + +#ifdef __cplusplus + #import #import @@ -35,3 +38,5 @@ namespace Cedar { namespace Doubles { inline /* virtual */ Argument::~Argument() {} }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/Arguments/ReturnValue.h b/Source/Headers/Public/Doubles/Arguments/ReturnValue.h index 36f66e1a..489e3981 100644 --- a/Source/Headers/Public/Doubles/Arguments/ReturnValue.h +++ b/Source/Headers/Public/Doubles/Arguments/ReturnValue.h @@ -1,5 +1,7 @@ #import "ValueArgument.h" +#ifdef __cplusplus + namespace Cedar { namespace Doubles { class ReturnValue { @@ -71,3 +73,5 @@ namespace Cedar { namespace Doubles { return 0 == strcmp(@encode(T), actual_argument_encoding); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/Arguments/ValueArgument.h b/Source/Headers/Public/Doubles/Arguments/ValueArgument.h index 454392a2..a312b64d 100644 --- a/Source/Headers/Public/Doubles/Arguments/ValueArgument.h +++ b/Source/Headers/Public/Doubles/Arguments/ValueArgument.h @@ -2,6 +2,8 @@ #import "CedarStringifiers.h" #import "CedarComparators.h" +#ifdef __cplusplus + namespace Cedar { namespace Doubles { inline const char *strip_encoding_qualifiers(const char *); @@ -157,3 +159,5 @@ namespace Cedar { namespace Doubles { }; }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/CDRClassFake.h b/Source/Headers/Public/Doubles/CDRClassFake.h index 62734def..66de7fed 100644 --- a/Source/Headers/Public/Doubles/CDRClassFake.h +++ b/Source/Headers/Public/Doubles/CDRClassFake.h @@ -2,8 +2,12 @@ #import "CDRFake.h" #import "CedarDouble.h" +#ifdef __cplusplus + @interface CDRClassFake : CDRFake @end id CDR_fake_for(BOOL require_explicit_stubs, Class klass, ...); + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/CDRFake.h b/Source/Headers/Public/Doubles/CDRFake.h index 22fdf6b5..05e8494a 100644 --- a/Source/Headers/Public/Doubles/CDRFake.h +++ b/Source/Headers/Public/Doubles/CDRFake.h @@ -1,6 +1,8 @@ #import #import "CedarDouble.h" +#ifdef __cplusplus + @interface CDRFake : NSObject @property (nonatomic, assign) Class klass; @@ -14,3 +16,5 @@ #define fake_for(...) CDR_fake_for(YES, __VA_ARGS__, nil) #define nice_fake_for(...) CDR_fake_for(NO, __VA_ARGS__, nil) #endif + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/CDRProtocolFake.h b/Source/Headers/Public/Doubles/CDRProtocolFake.h index f7267d44..bd26309b 100644 --- a/Source/Headers/Public/Doubles/CDRProtocolFake.h +++ b/Source/Headers/Public/Doubles/CDRProtocolFake.h @@ -2,6 +2,8 @@ #import "CedarDouble.h" #import "CDRFake.h" +#ifdef __cplusplus + #import #import @@ -12,3 +14,5 @@ @end id CDR_fake_for(BOOL require_explicit_stubs, Protocol *protocol, ...); + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/CDRSpy.h b/Source/Headers/Public/Doubles/CDRSpy.h index 2d9f08f8..183405cc 100644 --- a/Source/Headers/Public/Doubles/CDRSpy.h +++ b/Source/Headers/Public/Doubles/CDRSpy.h @@ -1,6 +1,8 @@ #import #import "CedarDouble.h" +#ifdef __cplusplus + @interface CDRSpy : NSProxy + (void)interceptMessagesForInstance:(id)instance; @@ -22,3 +24,5 @@ namespace Cedar { namespace Doubles { #define spy_on(x) CDR_spy_on((x)) #define stop_spying_on(x) CDR_stop_spying_on((x)) #endif + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/CedarDouble.h b/Source/Headers/Public/Doubles/CedarDouble.h index b5a4bedb..cf0ec5c6 100644 --- a/Source/Headers/Public/Doubles/CedarDouble.h +++ b/Source/Headers/Public/Doubles/CedarDouble.h @@ -1,5 +1,7 @@ #import +#ifdef __cplusplus + namespace Cedar { namespace Doubles { class StubbedMethod; class RejectedMethod; @@ -37,3 +39,5 @@ namespace Cedar { namespace Doubles { #define stub_method(x) ,(Cedar::Doubles::MethodStubbingMarker){__FILE__, __LINE__},Cedar::Doubles::StubbedMethod((x)) #define reject_method(x) ,(Cedar::Doubles::MethodStubbingMarker){__FILE__, __LINE__},Cedar::Doubles::RejectedMethod((x)) #endif + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/HaveReceived.h b/Source/Headers/Public/Doubles/HaveReceived.h index 9f4bbc19..bee5d8ab 100644 --- a/Source/Headers/Public/Doubles/HaveReceived.h +++ b/Source/Headers/Public/Doubles/HaveReceived.h @@ -2,6 +2,8 @@ #import "InvocationMatcher.h" #import "CedarDouble.h" +#ifdef __cplusplus + namespace Cedar { namespace Doubles { extern "C" Class object_getClass(id); @@ -135,3 +137,5 @@ namespace Cedar { namespace Doubles { } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/InvocationMatcher.h b/Source/Headers/Public/Doubles/InvocationMatcher.h index dbcf52bd..f6abf9bc 100644 --- a/Source/Headers/Public/Doubles/InvocationMatcher.h +++ b/Source/Headers/Public/Doubles/InvocationMatcher.h @@ -1,6 +1,9 @@ -#import #import "ValueArgument.h" +#ifdef __cplusplus + +#import + namespace Cedar { namespace Doubles { class InvocationMatcher { @@ -41,3 +44,5 @@ namespace Cedar { namespace Doubles { } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/RejectedMethod.h b/Source/Headers/Public/Doubles/RejectedMethod.h index 9948472d..13d01d06 100644 --- a/Source/Headers/Public/Doubles/RejectedMethod.h +++ b/Source/Headers/Public/Doubles/RejectedMethod.h @@ -1,10 +1,13 @@ #import -#import -#import #import "InvocationMatcher.h" #import "Argument.h" #import "ReturnValue.h" +#ifdef __cplusplus + +#import +#import + namespace Cedar { namespace Doubles { class RejectedMethod : private InvocationMatcher { @@ -19,3 +22,5 @@ namespace Cedar { namespace Doubles { const SEL selector() const; }; }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Doubles/StubbedMethod.h b/Source/Headers/Public/Doubles/StubbedMethod.h index 98560c79..32c93612 100644 --- a/Source/Headers/Public/Doubles/StubbedMethod.h +++ b/Source/Headers/Public/Doubles/StubbedMethod.h @@ -1,10 +1,13 @@ #import -#import -#import #import "InvocationMatcher.h" #import "Argument.h" #import "ReturnValue.h" +#ifdef __cplusplus + +#import +#import + namespace Cedar { namespace Doubles { class StubbedMethod : private InvocationMatcher { @@ -115,3 +118,5 @@ namespace Cedar { namespace Doubles { return *this; } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/ActualValue.h b/Source/Headers/Public/Matchers/ActualValue.h index d1f1643a..bade069b 100644 --- a/Source/Headers/Public/Matchers/ActualValue.h +++ b/Source/Headers/Public/Matchers/ActualValue.h @@ -1,4 +1,7 @@ #import + +#ifdef __cplusplus + #import #import "StringifiersBase.h" @@ -115,3 +118,5 @@ namespace Cedar { namespace Matchers { #define expect(x) CDR_expect(__FILE__, __LINE__, (x)) #define fail(x) CDR_fail(__FILE__, __LINE__, (x)) #endif + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/Base.h b/Source/Headers/Public/Matchers/Base/Base.h index 1ed5100b..c50dbbfc 100644 --- a/Source/Headers/Public/Matchers/Base/Base.h +++ b/Source/Headers/Public/Matchers/Base/Base.h @@ -1,6 +1,8 @@ #import -#import +#ifdef __cplusplus + +#import #import "CedarStringifiers.h" namespace Cedar { namespace Matchers { @@ -53,3 +55,5 @@ namespace Cedar { namespace Matchers { return [NSString stringWithFormat:@"Expected <%@> to not %@", actualValueString, failureMessageEnd]; } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeCloseTo.h b/Source/Headers/Public/Matchers/Base/BeCloseTo.h index 74eb16e6..76d68bd6 100644 --- a/Source/Headers/Public/Matchers/Base/BeCloseTo.h +++ b/Source/Headers/Public/Matchers/Base/BeCloseTo.h @@ -3,6 +3,8 @@ #import "CedarComparators.h" #import "CDRSpecFailure.h" +#ifdef __cplusplus + #pragma mark private interface namespace Cedar { namespace Matchers { namespace Private { template @@ -76,3 +78,5 @@ namespace Cedar { namespace Matchers { return CedarBeCloseTo(expectedValue); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeFalsy.h b/Source/Headers/Public/Matchers/Base/BeFalsy.h index 33f7bf4e..91768cea 100644 --- a/Source/Headers/Public/Matchers/Base/BeFalsy.h +++ b/Source/Headers/Public/Matchers/Base/BeFalsy.h @@ -1,6 +1,8 @@ #import #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { class BeFalsy : public Base<> { @@ -36,3 +38,5 @@ namespace Cedar { namespace Matchers { using CedarBeFalsy = Cedar::Matchers::Private::BeFalsy; static const CedarBeFalsy be_falsy = CedarBeFalsy(); }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeGTE.h b/Source/Headers/Public/Matchers/Base/BeGTE.h index e96fc27d..f4bd30af 100644 --- a/Source/Headers/Public/Matchers/Base/BeGTE.h +++ b/Source/Headers/Public/Matchers/Base/BeGTE.h @@ -1,6 +1,8 @@ #import #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { template @@ -81,3 +83,5 @@ namespace Cedar { namespace Matchers { return true; } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeGreaterThan.h b/Source/Headers/Public/Matchers/Base/BeGreaterThan.h index 08dc40ca..5fb91888 100644 --- a/Source/Headers/Public/Matchers/Base/BeGreaterThan.h +++ b/Source/Headers/Public/Matchers/Base/BeGreaterThan.h @@ -1,6 +1,8 @@ #import #import "Base.h" +#ifdef __cplusplus + namespace Cedar { namespace Matchers { namespace Private { template @@ -78,3 +80,5 @@ namespace Cedar { namespace Matchers { return true; } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeInstanceOf.h b/Source/Headers/Public/Matchers/Base/BeInstanceOf.h index 5782c3d0..7807212a 100644 --- a/Source/Headers/Public/Matchers/Base/BeInstanceOf.h +++ b/Source/Headers/Public/Matchers/Base/BeInstanceOf.h @@ -1,5 +1,7 @@ #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { struct BeInstanceOfMessageBuilder { @@ -83,3 +85,5 @@ namespace Cedar { namespace Matchers { return CedarBeInstanceOf(expectedValue); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeLTE.h b/Source/Headers/Public/Matchers/Base/BeLTE.h index ea781b12..3d1f7248 100644 --- a/Source/Headers/Public/Matchers/Base/BeLTE.h +++ b/Source/Headers/Public/Matchers/Base/BeLTE.h @@ -1,6 +1,8 @@ #import #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { template @@ -81,3 +83,5 @@ namespace Cedar { namespace Matchers { return true; } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeLessThan.h b/Source/Headers/Public/Matchers/Base/BeLessThan.h index dca76384..0df368db 100644 --- a/Source/Headers/Public/Matchers/Base/BeLessThan.h +++ b/Source/Headers/Public/Matchers/Base/BeLessThan.h @@ -1,6 +1,8 @@ #import #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { @@ -76,3 +78,5 @@ namespace Cedar { namespace Matchers { return true; } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeNil.h b/Source/Headers/Public/Matchers/Base/BeNil.h index d4e90ae5..5d65354e 100644 --- a/Source/Headers/Public/Matchers/Base/BeNil.h +++ b/Source/Headers/Public/Matchers/Base/BeNil.h @@ -2,6 +2,8 @@ #import "Base.h" #import "CDRSpecFailure.h" +#ifdef __cplusplus + #include #pragma mark - private interface @@ -76,3 +78,5 @@ namespace Cedar { namespace Matchers { static const CedarBeNil be_nil = CedarBeNil(); }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeSameInstanceAs.h b/Source/Headers/Public/Matchers/Base/BeSameInstanceAs.h index 73c31413..0c09b4d8 100644 --- a/Source/Headers/Public/Matchers/Base/BeSameInstanceAs.h +++ b/Source/Headers/Public/Matchers/Base/BeSameInstanceAs.h @@ -1,6 +1,8 @@ #import #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { struct BeSameInstanceAsMessageBuilder { @@ -102,3 +104,5 @@ namespace Cedar { namespace Matchers { return CedarBeSameInstanceAs(expectedValue); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BeTruthy.h b/Source/Headers/Public/Matchers/Base/BeTruthy.h index 001e12c5..7bb8f703 100644 --- a/Source/Headers/Public/Matchers/Base/BeTruthy.h +++ b/Source/Headers/Public/Matchers/Base/BeTruthy.h @@ -1,6 +1,8 @@ #import #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { class BeTruthy : public Base<> { @@ -35,3 +37,5 @@ namespace Cedar { namespace Matchers { using CedarBeTruthy = Cedar::Matchers::Private::BeTruthy; static const CedarBeTruthy be_truthy = CedarBeTruthy(); }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/BlockMatcher.h b/Source/Headers/Public/Matchers/Base/BlockMatcher.h index 554438a6..8f71c27d 100644 --- a/Source/Headers/Public/Matchers/Base/BlockMatcher.h +++ b/Source/Headers/Public/Matchers/Base/BlockMatcher.h @@ -1,5 +1,7 @@ #import "Base.h" +#ifdef __cplusplus + // The SDKs that ship with Xcode 7 define OBJC_BOOL_IS_BOOL or OBJC_BOOL_IS_CHAR depending // on the current platform. Here we enable backwards-compatibility #if defined(OBJC_BOOL_IS_BOOL) @@ -149,3 +151,5 @@ namespace Cedar { namespace Matchers { }} #undef CDR_RELEASE + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/ConformTo.h b/Source/Headers/Public/Matchers/Base/ConformTo.h index 80040b23..04ded09e 100644 --- a/Source/Headers/Public/Matchers/Base/ConformTo.h +++ b/Source/Headers/Public/Matchers/Base/ConformTo.h @@ -1,5 +1,7 @@ #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { @@ -34,3 +36,5 @@ namespace Cedar { namespace Matchers { return CedarConformTo(protocolName); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/Equal.h b/Source/Headers/Public/Matchers/Base/Equal.h index 532a7451..f308c377 100644 --- a/Source/Headers/Public/Matchers/Base/Equal.h +++ b/Source/Headers/Public/Matchers/Base/Equal.h @@ -1,5 +1,8 @@ #import #import "Base.h" +#import "ComparatorsBase.h" + +#ifdef __cplusplus #pragma mark - Private interface namespace Cedar { namespace Matchers { namespace Private { @@ -87,3 +90,5 @@ namespace Cedar { namespace Matchers { return true; } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/Exist.h b/Source/Headers/Public/Matchers/Base/Exist.h index 91d2f215..b3ce3628 100644 --- a/Source/Headers/Public/Matchers/Base/Exist.h +++ b/Source/Headers/Public/Matchers/Base/Exist.h @@ -1,6 +1,8 @@ #import #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { class Exist : public Base<> { @@ -27,3 +29,5 @@ namespace Cedar { namespace Matchers { using CedarExist = Cedar::Matchers::Private::Exist; static const CedarExist exist = CedarExist(); }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/RaiseException.h b/Source/Headers/Public/Matchers/Base/RaiseException.h index ee13cf6d..74129de9 100644 --- a/Source/Headers/Public/Matchers/Base/RaiseException.h +++ b/Source/Headers/Public/Matchers/Base/RaiseException.h @@ -1,4 +1,7 @@ #import "Base.h" + +#ifdef __cplusplus + #import #pragma mark - private interface @@ -58,3 +61,5 @@ namespace Cedar { namespace Matchers { using CedarRaiseException = Cedar::Matchers::Private::RaiseException; static const CedarRaiseException raise_exception; }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Base/RespondTo.h b/Source/Headers/Public/Matchers/Base/RespondTo.h index d0908d90..ad5df388 100644 --- a/Source/Headers/Public/Matchers/Base/RespondTo.h +++ b/Source/Headers/Public/Matchers/Base/RespondTo.h @@ -1,5 +1,7 @@ #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { @@ -35,3 +37,5 @@ namespace Cedar { namespace Matchers { return CedarRespondTo(selectorName); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Comparators/AnInstanceOf.h b/Source/Headers/Public/Matchers/Comparators/AnInstanceOf.h index 5bbe70b1..c0b649ff 100644 --- a/Source/Headers/Public/Matchers/Comparators/AnInstanceOf.h +++ b/Source/Headers/Public/Matchers/Comparators/AnInstanceOf.h @@ -1,3 +1,5 @@ +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { @@ -76,3 +78,5 @@ namespace Cedar { namespace Matchers { return CedarAnInstanceOf(klass); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Comparators/ComparatorsContainer.h b/Source/Headers/Public/Matchers/Comparators/ComparatorsContainer.h index 603e2c19..0f9e5a95 100644 --- a/Source/Headers/Public/Matchers/Comparators/ComparatorsContainer.h +++ b/Source/Headers/Public/Matchers/Comparators/ComparatorsContainer.h @@ -1,3 +1,5 @@ +#ifdef __cplusplus + #import #import #import @@ -209,3 +211,5 @@ namespace Cedar { namespace Matchers { namespace Comparators { return compare_contains((char *)actualValue, expectedContains, (NSString *)nil, options); } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Comparators/ComparatorsContainerConvenience.h b/Source/Headers/Public/Matchers/Comparators/ComparatorsContainerConvenience.h index 21d94c08..98d3d150 100644 --- a/Source/Headers/Public/Matchers/Comparators/ComparatorsContainerConvenience.h +++ b/Source/Headers/Public/Matchers/Comparators/ComparatorsContainerConvenience.h @@ -1,6 +1,10 @@ +#ifdef __cplusplus + namespace Cedar { namespace Matchers { namespace Comparators { template bool compare_contains(const T & container, const U & element, contains_options options) { return compare_contains(container, element, options, [](const U & lhs, const U & rhs) { return compare_equal(lhs, rhs); }); } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Comparators/CompareCloseTo.h b/Source/Headers/Public/Matchers/Comparators/CompareCloseTo.h index 2b3549d0..0bc2e9cc 100644 --- a/Source/Headers/Public/Matchers/Comparators/CompareCloseTo.h +++ b/Source/Headers/Public/Matchers/Comparators/CompareCloseTo.h @@ -1,5 +1,7 @@ #import "CDRSpecFailure.h" +#ifdef __cplusplus + namespace Cedar { namespace Matchers { namespace Comparators { inline bool compare_close_to(const double actualValue, const double expectedValue, const double threshold) { return actualValue > expectedValue - threshold && actualValue < expectedValue + threshold; @@ -28,3 +30,5 @@ namespace Cedar { namespace Matchers { namespace Comparators { return false; } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Comparators/CompareEqual.h b/Source/Headers/Public/Matchers/Comparators/CompareEqual.h index c58e2b0f..0a9c6861 100644 --- a/Source/Headers/Public/Matchers/Comparators/CompareEqual.h +++ b/Source/Headers/Public/Matchers/Comparators/CompareEqual.h @@ -1,3 +1,5 @@ +#ifdef __cplusplus + namespace Cedar { namespace Matchers { namespace Comparators { #pragma mark Generic @@ -34,3 +36,5 @@ namespace Cedar { namespace Matchers { namespace Comparators { return NSEqualRanges(actualValue, expectedValue); } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Comparators/CompareGreaterThan.h b/Source/Headers/Public/Matchers/Comparators/CompareGreaterThan.h index 4207a521..004875d9 100644 --- a/Source/Headers/Public/Matchers/Comparators/CompareGreaterThan.h +++ b/Source/Headers/Public/Matchers/Comparators/CompareGreaterThan.h @@ -1,3 +1,5 @@ +#ifdef __cplusplus + namespace Cedar { namespace Matchers { namespace Comparators { #pragma mark Generic @@ -24,3 +26,5 @@ namespace Cedar { namespace Matchers { namespace Comparators { return NSOrderedDescending == NSDecimalCompare(&actualValue, &expectedValue); } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Container/BeEmpty.h b/Source/Headers/Public/Matchers/Container/BeEmpty.h index 270b47b2..6f753f81 100644 --- a/Source/Headers/Public/Matchers/Container/BeEmpty.h +++ b/Source/Headers/Public/Matchers/Container/BeEmpty.h @@ -1,5 +1,7 @@ #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { class BeEmpty : public Base<> { @@ -32,3 +34,5 @@ namespace Cedar { namespace Matchers { using CedarBeEmpty = Cedar::Matchers::Private::BeEmpty; static const CedarBeEmpty be_empty = CedarBeEmpty(); }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Container/Contain.h b/Source/Headers/Public/Matchers/Container/Contain.h index 868114ce..937081ee 100644 --- a/Source/Headers/Public/Matchers/Container/Contain.h +++ b/Source/Headers/Public/Matchers/Container/Contain.h @@ -1,5 +1,7 @@ #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { template @@ -104,3 +106,5 @@ namespace Cedar { namespace Matchers { return CedarContain(element); } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Container/ContainSubset.h b/Source/Headers/Public/Matchers/Container/ContainSubset.h index d6c9294a..f0261dbd 100644 --- a/Source/Headers/Public/Matchers/Container/ContainSubset.h +++ b/Source/Headers/Public/Matchers/Container/ContainSubset.h @@ -1,5 +1,7 @@ #import "Base.h" +#ifdef __cplusplus + #pragma mark - private interface namespace Cedar { namespace Matchers { namespace Private { template @@ -94,3 +96,5 @@ namespace Cedar { namespace Matchers { return CedarContainSubset(element); } }} + +#endif diff --git a/Source/Headers/Public/Matchers/MatcherTemplate.h b/Source/Headers/Public/Matchers/MatcherTemplate.h index 0f1df066..d721f28f 100644 --- a/Source/Headers/Public/Matchers/MatcherTemplate.h +++ b/Source/Headers/Public/Matchers/MatcherTemplate.h @@ -1,5 +1,7 @@ #import "Base.h" +#ifdef __cplusplus + namespace Cedar { namespace Matchers { template class <#MatcherClassName#> : public Base<> { @@ -58,3 +60,5 @@ namespace Cedar { namespace Matchers { // return result of appropriate comparison with specific type } }} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/OSX/OSXGeometryCompareEqual.h b/Source/Headers/Public/Matchers/OSX/OSXGeometryCompareEqual.h index 296347a9..55fa4189 100644 --- a/Source/Headers/Public/Matchers/OSX/OSXGeometryCompareEqual.h +++ b/Source/Headers/Public/Matchers/OSX/OSXGeometryCompareEqual.h @@ -1,6 +1,8 @@ #import "ComparatorsBase.h" #import "OSXGeometryStringifiers.h" +#ifdef __cplusplus + namespace Cedar { namespace Matchers { namespace Comparators { template bool compare_equal(CGRect const actualValue, const U & expectedValue) { @@ -22,3 +24,5 @@ namespace Cedar { namespace Matchers { namespace Comparators { return CGAffineTransformEqualToTransform(actualValue, expectedValue); } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/OSX/OSXGeometryStringifiers.h b/Source/Headers/Public/Matchers/OSX/OSXGeometryStringifiers.h index d5a70aca..f846b527 100644 --- a/Source/Headers/Public/Matchers/OSX/OSXGeometryStringifiers.h +++ b/Source/Headers/Public/Matchers/OSX/OSXGeometryStringifiers.h @@ -1,6 +1,9 @@ -#import #import "StringifiersBase.h" +#ifdef __cplusplus + +#import + namespace Cedar { namespace Matchers { namespace Stringifiers { inline NSString * string_for(const CGRect value) { return NSStringFromRect(value); @@ -19,3 +22,5 @@ namespace Cedar { namespace Matchers { namespace Stringifiers { value.a, value.b, value.c, value.d, value.tx, value.ty]; } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/ShouldSyntax.h b/Source/Headers/Public/Matchers/ShouldSyntax.h index 1ca750e1..1c955012 100644 --- a/Source/Headers/Public/Matchers/ShouldSyntax.h +++ b/Source/Headers/Public/Matchers/ShouldSyntax.h @@ -1,5 +1,7 @@ #import "ActualValue.h" +#ifdef __cplusplus + namespace Cedar { namespace Matchers { struct ActualValueMarker { @@ -28,3 +30,5 @@ namespace Cedar { namespace Matchers { #define should ,(ActualValueMarker){__FILE__, __LINE__},false, #define should_not ,(ActualValueMarker){__FILE__, __LINE__},true, #endif + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Stringifiers/StringifiersBase.h b/Source/Headers/Public/Matchers/Stringifiers/StringifiersBase.h index 18c75a56..78a233f2 100644 --- a/Source/Headers/Public/Matchers/Stringifiers/StringifiersBase.h +++ b/Source/Headers/Public/Matchers/Stringifiers/StringifiersBase.h @@ -1,4 +1,7 @@ #import + +#ifdef __cplusplus + #include namespace Cedar { namespace Matchers { namespace Stringifiers { @@ -62,3 +65,5 @@ namespace Cedar { namespace Matchers { namespace Stringifiers { return [NSString stringWithFormat:@"%@ (%f)", date, [date timeIntervalSince1970]]; } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/Stringifiers/StringifiersContainer.h b/Source/Headers/Public/Matchers/Stringifiers/StringifiersContainer.h index cb89ab14..36f40e74 100644 --- a/Source/Headers/Public/Matchers/Stringifiers/StringifiersContainer.h +++ b/Source/Headers/Public/Matchers/Stringifiers/StringifiersContainer.h @@ -1,3 +1,5 @@ +#ifdef __cplusplus + #import #import #import @@ -45,3 +47,5 @@ namespace Cedar { namespace Matchers { namespace Stringifiers { return [NSString stringWithFormat:@"{(%@\n)}", delimitedList]; } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/UIKit/UIGeometryCompareEqual.h b/Source/Headers/Public/Matchers/UIKit/UIGeometryCompareEqual.h index 1d2ef298..8dfdb2e3 100644 --- a/Source/Headers/Public/Matchers/UIKit/UIGeometryCompareEqual.h +++ b/Source/Headers/Public/Matchers/UIKit/UIGeometryCompareEqual.h @@ -4,6 +4,8 @@ #import "ComparatorsBase.h" #import "UIGeometryStringifiers.h" +#ifdef __cplusplus + namespace Cedar { namespace Matchers { namespace Comparators { template bool compare_equal(CGRect const actualValue, const U & expectedValue) { @@ -35,3 +37,5 @@ namespace Cedar { namespace Matchers { namespace Comparators { return [expectedImage isEqual:actualImage] || [UIImagePNGRepresentation(expectedImage) isEqual:UIImagePNGRepresentation(actualImage)]; } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/UIKit/UIGeometryStringifiers.h b/Source/Headers/Public/Matchers/UIKit/UIGeometryStringifiers.h index 73439d3d..9bb13245 100644 --- a/Source/Headers/Public/Matchers/UIKit/UIGeometryStringifiers.h +++ b/Source/Headers/Public/Matchers/UIKit/UIGeometryStringifiers.h @@ -1,6 +1,10 @@ -#import +#import #import "StringifiersBase.h" +#ifdef __cplusplus + +#import + namespace Cedar { namespace Matchers { namespace Stringifiers { inline NSString * string_for(const CGRect value) { return NSStringFromCGRect(value); @@ -22,3 +26,5 @@ namespace Cedar { namespace Matchers { namespace Stringifiers { return NSStringFromCGAffineTransform(value); } }}} + +#endif // __cplusplus diff --git a/Source/Headers/Public/Matchers/UIKit/iOS/UIKitComparatorsContainer.h b/Source/Headers/Public/Matchers/UIKit/iOS/UIKitComparatorsContainer.h index 11d6065b..df6c2073 100644 --- a/Source/Headers/Public/Matchers/UIKit/iOS/UIKitComparatorsContainer.h +++ b/Source/Headers/Public/Matchers/UIKit/iOS/UIKitComparatorsContainer.h @@ -1,6 +1,8 @@ #import #import +#ifdef __cplusplus + namespace Cedar { namespace Matchers { namespace Comparators { template bool compare_contains(UIView * const container, const U & element, contains_options options, F comparator) { @@ -12,3 +14,5 @@ namespace Cedar { namespace Matchers { namespace Comparators { return compare_contains(container, element, @"sublayers", options, comparator); } }}} + +#endif // __cplusplus From 461aa76988ccc6218b45e1fa4f6e9812b9466eb0 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Thu, 24 Dec 2015 11:24:13 -0500 Subject: [PATCH 03/14] Simplify Cedar.h imports * Cedar.h now only imports the various sub-umbrella headers for different subsystems * Add CedarReporters.h so the reporter headers (already public!) get imported * CDRSpec.h no longer imports headers related to matchers and doubles * Properly copy the ContainSubset matcher header --- Cedar.xcodeproj/project.pbxproj | 22 +++++ Source/Headers/Public/CDRSpec.h | 9 +- Source/Headers/Public/CDRSpecHelper.h | 4 + Source/Headers/Public/Cedar.h | 86 +------------------ Source/Headers/Public/Doubles/CedarDoubles.h | 13 ++- .../Headers/Public/Matchers/CedarMatchers.h | 23 ++++- .../Public/Matchers/CedarStringifiers.h | 8 ++ .../Matchers/Comparators/ComparatorsBase.h | 10 ++- .../Headers/Public/Reporters/CedarReporters.h | 7 ++ Source/Headers/Public/iOS/Cedar-iOS.h | 3 +- 10 files changed, 84 insertions(+), 101 deletions(-) create mode 100644 Source/Headers/Public/Reporters/CedarReporters.h diff --git a/Cedar.xcodeproj/project.pbxproj b/Cedar.xcodeproj/project.pbxproj index f3c18e72..ba50d57d 100644 --- a/Cedar.xcodeproj/project.pbxproj +++ b/Cedar.xcodeproj/project.pbxproj @@ -485,6 +485,16 @@ 34D7C4B41BB9C75D00E8E523 /* TestObservationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 34757E211BA466050047BC8D /* TestObservationHelper.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; 34D7C4B61BB9CB4B00E8E523 /* Cedar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34D7C3CA1BB9747400E8E523 /* Cedar.framework */; }; 34D7C4B81BB9CB5700E8E523 /* libxml2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 34D7C4B71BB9CB5700E8E523 /* libxml2.tbd */; }; + 34DB674A1C2B65EA00206663 /* ContainSubset.h in Headers */ = {isa = PBXBuildFile; fileRef = AE8F9C141B795A7C00B956C5 /* ContainSubset.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34DB674B1C2B65EA00206663 /* ContainSubset.h in Headers */ = {isa = PBXBuildFile; fileRef = AE8F9C141B795A7C00B956C5 /* ContainSubset.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34DB674C1C2B65EB00206663 /* ContainSubset.h in Headers */ = {isa = PBXBuildFile; fileRef = AE8F9C141B795A7C00B956C5 /* ContainSubset.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34DB674D1C2B65EC00206663 /* ContainSubset.h in Headers */ = {isa = PBXBuildFile; fileRef = AE8F9C141B795A7C00B956C5 /* ContainSubset.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34DB674E1C2B65EC00206663 /* ContainSubset.h in Copy headers to framework */ = {isa = PBXBuildFile; fileRef = AE8F9C141B795A7C00B956C5 /* ContainSubset.h */; }; + 34DB67501C2B8C1000206663 /* CedarReporters.h in Headers */ = {isa = PBXBuildFile; fileRef = 34DB674F1C2B8C1000206663 /* CedarReporters.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34DB67511C2B8C1000206663 /* CedarReporters.h in Headers */ = {isa = PBXBuildFile; fileRef = 34DB674F1C2B8C1000206663 /* CedarReporters.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34DB67521C2B8C1000206663 /* CedarReporters.h in Headers */ = {isa = PBXBuildFile; fileRef = 34DB674F1C2B8C1000206663 /* CedarReporters.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34DB67531C2B8C1000206663 /* CedarReporters.h in Headers */ = {isa = PBXBuildFile; fileRef = 34DB674F1C2B8C1000206663 /* CedarReporters.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34DB67541C2B8C1000206663 /* CedarReporters.h in Copy headers to framework */ = {isa = PBXBuildFile; fileRef = 34DB674F1C2B8C1000206663 /* CedarReporters.h */; }; 34EBFD0F18FF505F005392AB /* UIKitComparatorsContainer.h in Copy headers to framework */ = {isa = PBXBuildFile; fileRef = 34D4B5C418F3B68900FB2C3B /* UIKitComparatorsContainer.h */; }; 34F3DF7F1A6ABA2E003041DA /* CDRNil.m in Sources */ = {isa = PBXBuildFile; fileRef = 34F3DF7C1A6ABA2E003041DA /* CDRNil.m */; }; 34F3DF801A6ABA2E003041DA /* CDRNil.m in Sources */ = {isa = PBXBuildFile; fileRef = 34F3DF7C1A6ABA2E003041DA /* CDRNil.m */; }; @@ -1318,6 +1328,7 @@ AEF33022145B69DE002F93BB /* BeLTE.h in Copy headers to framework */, AEB45A921496C8D800845D09 /* RaiseException.h in Copy headers to framework */, AE4A9459187F7D8F008566F5 /* BeFalsy.h in Copy headers to framework */, + 34DB67541C2B8C1000206663 /* CedarReporters.h in Copy headers to framework */, 6628FC8914C4DBA70016652A /* CedarDoubles.h in Copy headers to framework */, 6628FC9A14C4DD440016652A /* CDRSpy.h in Copy headers to framework */, 6628FCA114C503530016652A /* Cedar-iOS.h in Copy headers to framework */, @@ -1325,6 +1336,7 @@ AE9AA68215AB76DB00617E1A /* CDRClassFake.h in Copy headers to framework */, AE9AA68A15AC729E00617E1A /* CedarDouble.h in Copy headers to framework */, AE9AA6D315AE087C00617E1A /* StubbedMethod.h in Copy headers to framework */, + 34DB674E1C2B65EC00206663 /* ContainSubset.h in Copy headers to framework */, AE74903515B45EEE008EA127 /* CDRProtocolFake.h in Copy headers to framework */, 22B6A22715B7ACF800960ADE /* InvocationMatcher.h in Copy headers to framework */, 34157D0E1B755E09007AD1BA /* CDROTestReporter.h in Copy headers to framework */, @@ -1405,6 +1417,7 @@ 34D7C3CA1BB9747400E8E523 /* Cedar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cedar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34D7C4691BB9B71600E8E523 /* Cedar-tvOS SpecBundle.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Cedar-tvOS SpecBundle.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 34D7C4B71BB9CB5700E8E523 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/lib/libxml2.tbd; sourceTree = DEVELOPER_DIR; }; + 34DB674F1C2B8C1000206663 /* CedarReporters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CedarReporters.h; sourceTree = ""; }; 34F3DF7B1A6ABA2E003041DA /* CDRNil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDRNil.h; sourceTree = ""; }; 34F3DF7C1A6ABA2E003041DA /* CDRNil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDRNil.m; sourceTree = ""; }; 34F3DF811A6ABB21003041DA /* CDRNilSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDRNilSpec.mm; sourceTree = ""; }; @@ -1778,6 +1791,7 @@ 96EA1CAC142C6449001A78E0 /* CDROTestReporter.h */, 42064465139B44EC00C85605 /* CDRTeamCityReporter.h */, 1FF449B318A0C04D00AF94B0 /* CDRBufferedDefaultReporter.h */, + 34DB674F1C2B8C1000206663 /* CedarReporters.h */, ); path = Reporters; sourceTree = ""; @@ -2517,6 +2531,7 @@ 346262411B9954C1002CAEBD /* CDRSpecHelper.h in Headers */, 3462620D1B99546C002CAEBD /* BeGreaterThan.h in Headers */, 346262061B99544D002CAEBD /* RejectedMethod.h in Headers */, + 34DB674C1C2B65EB00206663 /* ContainSubset.h in Headers */, 346261FD1B995445002CAEBD /* AnyArgument.h in Headers */, 346262211B995491002CAEBD /* CompareEqual.h in Headers */, 346262111B99546C002CAEBD /* BeLTE.h in Headers */, @@ -2543,6 +2558,7 @@ 346262311B9954B8002CAEBD /* CDRColorizedReporter.h in Headers */, 346262151B99546C002CAEBD /* ConformTo.h in Headers */, 346262351B9954B8002CAEBD /* CDROTestReporter.h in Headers */, + 34DB67521C2B8C1000206663 /* CedarReporters.h in Headers */, 3462620F1B99546C002CAEBD /* BeInstanceOf.h in Headers */, 346261FA1B995445002CAEBD /* ValueArgument.h in Headers */, 346262171B99546C002CAEBD /* Exist.h in Headers */, @@ -2589,9 +2605,11 @@ 34D7C4591BB9B5F100E8E523 /* CDRExampleBase.h in Headers */, 34D7C43B1BB9B5B200E8E523 /* Exist.h in Headers */, 34D7C4291BB9B59200E8E523 /* CDRFake.h in Headers */, + 34DB674D1C2B65EC00206663 /* ContainSubset.h in Headers */, 34D7C45E1BB9B5F100E8E523 /* CDRSharedExampleGroupPool.h in Headers */, 34D7C45F1BB9B5F100E8E523 /* CDRSpec.h in Headers */, 34D7C41F1BB9B56D00E8E523 /* AnyInstanceConformingToProtocolArgument.h in Headers */, + 34DB67531C2B8C1000206663 /* CedarReporters.h in Headers */, 34D7C43F1BB9B5B900E8E523 /* Contain.h in Headers */, 34D7C4101BB9B54F00E8E523 /* CDRXCTestSupport.h in Headers */, 34D7C4241BB9B59200E8E523 /* HaveReceived.h in Headers */, @@ -2689,9 +2707,11 @@ 3492DAA11BA6F9E70032B35A /* CDRSpecRun.h in Headers */, AE4865B91B0690B0005DB302 /* BeCloseTo.h in Headers */, AE4865BA1B0690B0005DB302 /* BeFalsy.h in Headers */, + 34DB674B1C2B65EA00206663 /* ContainSubset.h in Headers */, AE4865BB1B0690B0005DB302 /* BeGreaterThan.h in Headers */, AE4865BC1B0690B0005DB302 /* BeGTE.h in Headers */, AE4865BD1B0690B0005DB302 /* BeInstanceOf.h in Headers */, + 34DB67511C2B8C1000206663 /* CedarReporters.h in Headers */, AE4865BE1B0690B0005DB302 /* BeLessThan.h in Headers */, AE4865BF1B0690B0005DB302 /* BeLTE.h in Headers */, AE4865C01B0690B0005DB302 /* BeNil.h in Headers */, @@ -2813,6 +2833,7 @@ AE0721E3187518FD0031CC42 /* Exist.h in Headers */, AE34724B19C37ECF005CA6F1 /* CDRXCTestCase.h in Headers */, AE74907415B493B5008EA127 /* CDRFake.h in Headers */, + 34DB674A1C2B65EA00206663 /* ContainSubset.h in Headers */, 34640DA71B6964F90083EB01 /* CDRBlockHelper.h in Headers */, AE9AA67B15AB72DA00617E1A /* CDRClassFake.h in Headers */, AE74902F15B45E80008EA127 /* CDRProtocolFake.h in Headers */, @@ -2839,6 +2860,7 @@ AEC9DEED12C2CC7E0039512D /* CDRColorizedReporter.h in Headers */, 96EA1CAE142C6449001A78E0 /* CDROTestReporter.h in Headers */, 42064466139B44EC00C85605 /* CDRTeamCityReporter.h in Headers */, + 34DB67501C2B8C1000206663 /* CedarReporters.h in Headers */, AEEE1FF911DC27B800029872 /* CDRDefaultReporter.h in Headers */, 1F483E32187D39D000521F81 /* CDROTestNamer.h in Headers */, 492951DD1481AAD800FA8916 /* CDRJUnitXMLReporter.h in Headers */, diff --git a/Source/Headers/Public/CDRSpec.h b/Source/Headers/Public/CDRSpec.h index 13206e5d..b8912c18 100644 --- a/Source/Headers/Public/CDRSpec.h +++ b/Source/Headers/Public/CDRSpec.h @@ -33,14 +33,7 @@ CDRExample * fit(NSString *, CDRSpecBlock); void fail(NSString *); #ifdef __cplusplus } - -#import "ActualValue.h" -#import "ShouldSyntax.h" -#import "CedarComparators.h" -#import "CedarMatchers.h" -#import "CedarDoubles.h" - -#endif // __cplusplus +#endif @interface CDRSpec : NSObject { CDRExampleGroup *rootGroup_; diff --git a/Source/Headers/Public/CDRSpecHelper.h b/Source/Headers/Public/CDRSpecHelper.h index 69bddb71..c99854af 100644 --- a/Source/Headers/Public/CDRSpecHelper.h +++ b/Source/Headers/Public/CDRSpecHelper.h @@ -19,3 +19,7 @@ @end @compatibility_alias SpecHelper CDRSpecHelper; + +// This import is here for backwards-compatibility. +// The Cedar spec template used to only import CDRSpecHelper.h +#import "Cedar.h" diff --git a/Source/Headers/Public/Cedar.h b/Source/Headers/Public/Cedar.h index f2e989d1..a8a4adae 100644 --- a/Source/Headers/Public/Cedar.h +++ b/Source/Headers/Public/Cedar.h @@ -17,88 +17,10 @@ #import "CDRSharedExampleGroupPool.h" #if TARGET_OS_IPHONE && !TARGET_OS_WATCH +#import "CedarApplicationDelegate.h" #import "Cedar-iOS.h" #endif - -#pragma mark - Cedar Runner/Matchers - -#import "Equal.h" -#import "BeCloseTo.h" -#import "ActualValue.h" -#import "ShouldSyntax.h" - - -#pragma mark - Cedar Matchers - -#import "Base.h" -#import "BeLTE.h" -#import "BeNil.h" -#import "BeGTE.h" -#import "Exist.h" -#import "BeEmpty.h" -#import "Contain.h" -#import "BeFalsy.h" -#import "BeTruthy.h" -#import "ConformTo.h" -#import "RespondTo.h" -#import "BeLessThan.h" -#import "BeInstanceOf.h" -#import "AnInstanceOf.h" -#import "BeGreaterThan.h" -#import "RaiseException.h" -#import "BeSameInstanceAs.h" -#import "StringifiersBase.h" -#import "StringifiersContainer.h" - -#ifdef CEDAR_CUSTOM_STRINGIFIERS -#import CEDAR_CUSTOM_STRINGIFIERS -#endif - - -#pragma mark - Cedar Matcher Comparators - -#import "CompareEqual.h" -#import "CompareCloseTo.h" -#import "ComparatorsBase.h" -#import "CedarComparators.h" -#import "CompareGreaterThan.h" -#import "ComparatorsContainer.h" -#import "ComparatorsContainerConvenience.h" - -#if TARGET_OS_IPHONE -#import "UIGeometryCompareEqual.h" -#import "UIGeometryStringifiers.h" - -#if !TARGET_OS_WATCH -#import "UIKitComparatorsContainer.h" -#endif - -#endif - -#ifdef CEDAR_CUSTOM_MATCHERS -#import CEDAR_CUSTOM_MATCHERS -#endif - - -#pragma mark - Cedar Doubles - -#import "CDRSpy.h" -#import "CDRFake.h" -#import "CedarDouble.h" -#import "CDRClassFake.h" -#import "CDRProtocolFake.h" - - -#pragma mark - Cedar Doubles/Matchers - -#import "Argument.h" -#import "ReturnValue.h" -#import "AnyArgument.h" -#import "HaveReceived.h" -#import "ValueArgument.h" -#import "StubbedMethod.h" -#import "RejectedMethod.h" -#import "AnyInstanceArgument.h" -#import "AnyInstanceOfClassArgument.h" -#import "AnyInstanceConformingToProtocolArgument.h" +#import "CedarReporters.h" +#import "CedarMatchers.h" +#import "CedarDoubles.h" diff --git a/Source/Headers/Public/Doubles/CedarDoubles.h b/Source/Headers/Public/Doubles/CedarDoubles.h index 07711f97..fad9889c 100644 --- a/Source/Headers/Public/Doubles/CedarDoubles.h +++ b/Source/Headers/Public/Doubles/CedarDoubles.h @@ -1,13 +1,20 @@ +#pragma mark - Doubles + #import "CDRSpy.h" #import "CDRFake.h" #import "CDRClassFake.h" #import "CDRProtocolFake.h" -#import "HaveReceived.h" -#import "StubbedMethod.h" -#import "RejectedMethod.h" + + +#pragma mark - Matchers for Doubles #import "Argument.h" +#import "ReturnValue.h" #import "AnyArgument.h" +#import "HaveReceived.h" #import "ValueArgument.h" +#import "StubbedMethod.h" +#import "RejectedMethod.h" +#import "AnyInstanceArgument.h" #import "AnyInstanceOfClassArgument.h" #import "AnyInstanceConformingToProtocolArgument.h" diff --git a/Source/Headers/Public/Matchers/CedarMatchers.h b/Source/Headers/Public/Matchers/CedarMatchers.h index d584b7ea..2f8f6ef7 100644 --- a/Source/Headers/Public/Matchers/CedarMatchers.h +++ b/Source/Headers/Public/Matchers/CedarMatchers.h @@ -1,4 +1,16 @@ -// Base +#import "CedarStringifiers.h" +#import "CedarComparators.h" + + +#pragma mark - Base + +#import "Base.h" +#import "ActualValue.h" +#import "ShouldSyntax.h" + + +#pragma mark - Matchers + #import "Equal.h" #import "BeTruthy.h" #import "BeFalsy.h" @@ -15,15 +27,20 @@ #import "ConformTo.h" #import "BlockMatcher.h" -// Container + +#pragma mark - Container + #import "BeEmpty.h" #import "AnInstanceOf.h" #import "Contain.h" #import "ContainSubset.h" -// Verifiers + +#pragma mark - Verifiers + #import "Exist.h" + #ifdef CEDAR_CUSTOM_MATCHERS #import CEDAR_CUSTOM_MATCHERS #endif diff --git a/Source/Headers/Public/Matchers/CedarStringifiers.h b/Source/Headers/Public/Matchers/CedarStringifiers.h index 246a9067..f86d3610 100644 --- a/Source/Headers/Public/Matchers/CedarStringifiers.h +++ b/Source/Headers/Public/Matchers/CedarStringifiers.h @@ -1,6 +1,14 @@ #import "StringifiersBase.h" #import "StringifiersContainer.h" +#if TARGET_OS_MAC + #if TARGET_OS_IPHONE + #import "UIGeometryStringifiers.h" + #else + #import "OSXGeometryStringifiers.h" + #endif +#endif + #ifdef CEDAR_CUSTOM_STRINGIFIERS #import CEDAR_CUSTOM_STRINGIFIERS #endif diff --git a/Source/Headers/Public/Matchers/Comparators/ComparatorsBase.h b/Source/Headers/Public/Matchers/Comparators/ComparatorsBase.h index 2b94907d..7d51daf6 100644 --- a/Source/Headers/Public/Matchers/Comparators/ComparatorsBase.h +++ b/Source/Headers/Public/Matchers/Comparators/ComparatorsBase.h @@ -2,8 +2,10 @@ #import "CompareGreaterThan.h" #import "CompareCloseTo.h" -#if TARGET_OS_IPHONE -#import "UIGeometryCompareEqual.h" -#else -#import "OSXGeometryCompareEqual.h" +#if TARGET_OS_MAC + #if TARGET_OS_IPHONE + #import "UIGeometryCompareEqual.h" + #else + #import "OSXGeometryCompareEqual.h" + #endif #endif diff --git a/Source/Headers/Public/Reporters/CedarReporters.h b/Source/Headers/Public/Reporters/CedarReporters.h new file mode 100644 index 00000000..e677f931 --- /dev/null +++ b/Source/Headers/Public/Reporters/CedarReporters.h @@ -0,0 +1,7 @@ +#import "CDRColorizedReporter.h" +#import "CDRDefaultReporter.h" +#import "CDRExampleReporter.h" +#import "CDRJUnitXMLReporter.h" +#import "CDROTestReporter.h" +#import "CDRTeamCityReporter.h" +#import "CDRBufferedDefaultReporter.h" diff --git a/Source/Headers/Public/iOS/Cedar-iOS.h b/Source/Headers/Public/iOS/Cedar-iOS.h index 83664988..4c1a7e58 100644 --- a/Source/Headers/Public/iOS/Cedar-iOS.h +++ b/Source/Headers/Public/iOS/Cedar-iOS.h @@ -1,2 +1,3 @@ +// This header still exists only for backwards-compatibility + #import "Cedar.h" -#import "CedarApplicationDelegate.h" From 025ce004df249c77df96e8b5502c053928c494bd Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Sat, 26 Dec 2015 00:04:25 -0500 Subject: [PATCH 04/14] Add nullability annotations to relevant public headers This better advertises API intention, as well as improving the experience of Swift users. Unfortunately this does require silencing Clang warnings in a few `-dealloc` methods which set `nonnull` properties to nil during cleanup. --- Cedar.xcodeproj/project.pbxproj | 12 +++++++++ Source/CDRSpec.m | 3 +++ Source/CDRSpecHelper.m | 3 +++ Source/Doubles/CDRFake.mm | 3 +++ Source/Headers/Public/CDRExample.h | 11 +++++--- Source/Headers/Public/CDRExampleBase.h | 15 +++++++---- Source/Headers/Public/CDRExampleGroup.h | 7 ++++- Source/Headers/Public/CDRExampleParent.h | 7 ++++- Source/Headers/Public/CDRFunctions.h | 5 ++++ Source/Headers/Public/CDRNullabilityCompat.h | 16 +++++++++++ .../Public/CDRSharedExampleGroupPool.h | 7 ++++- Source/Headers/Public/CDRSpec.h | 27 +++++++++++-------- Source/Headers/Public/CDRSpecFailure.h | 11 +++++--- Source/Headers/Public/CDRSpecHelper.h | 5 ++++ Source/Headers/Public/Doubles/CDRClassFake.h | 5 ++++ Source/Headers/Public/Doubles/CDRFake.h | 5 ++++ .../Headers/Public/Doubles/CDRProtocolFake.h | 6 +++++ Source/Headers/Public/Doubles/CDRSpy.h | 5 ++++ .../Public/Reporters/CDRExampleReporter.h | 5 ++++ Spec/Doubles/CDRSpySpec.mm | 6 +++++ 20 files changed, 139 insertions(+), 25 deletions(-) create mode 100644 Source/Headers/Public/CDRNullabilityCompat.h diff --git a/Cedar.xcodeproj/project.pbxproj b/Cedar.xcodeproj/project.pbxproj index ba50d57d..069eac7e 100644 --- a/Cedar.xcodeproj/project.pbxproj +++ b/Cedar.xcodeproj/project.pbxproj @@ -267,6 +267,11 @@ 34D1819F1BC7F0FD0087EC0D /* BlockMatcher_ARCSpecSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE0BF06E1B8E10D7000B0EE7 /* BlockMatcher_ARCSpecSpec.mm */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; 34D181A01BC7F0FF0087EC0D /* BlockMatcherSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 346F646D1B82D3C900F64156 /* BlockMatcherSpec.mm */; }; 34D181A11BC7F0FF0087EC0D /* BlockMatcher_ARCSpecSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE0BF06E1B8E10D7000B0EE7 /* BlockMatcher_ARCSpecSpec.mm */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + 34C95F501C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34C95F511C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34C95F521C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34C95F531C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34C95F541C2DD7B30055F089 /* CDRNullabilityCompat.h in Copy headers to framework */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; }; 34D4B5C318F3AE0400FB2C3B /* UIKitContainSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34D4B5C118F3ADFF00FB2C3B /* UIKitContainSpec.mm */; }; 34D7C3C01BB970DF00E8E523 /* CDRXCTestFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3492DA961BA670C10032B35A /* CDRXCTestFunctions.m */; }; 34D7C3C11BB970F100E8E523 /* CDRSpecRun.m in Sources */ = {isa = PBXBuildFile; fileRef = 3492DA9E1BA6F9E70032B35A /* CDRSpecRun.m */; }; @@ -1280,6 +1285,7 @@ files = ( 34ADD2ED19220F9300B057AC /* AnyInstanceOfClassArgument.h in Copy headers to framework */, 34ADD2EE19220F9300B057AC /* AnyInstanceConformingToProtocolArgument.h in Copy headers to framework */, + 34C95F541C2DD7B30055F089 /* CDRNullabilityCompat.h in Copy headers to framework */, 341477711914090000CBA385 /* AnInstanceOf.h in Copy headers to framework */, AE0F354F19E87D6F00B9F116 /* CompareCloseTo.h in Copy headers to framework */, 3414776F191406FC00CBA385 /* ComparatorsContainerConvenience.h in Copy headers to framework */, @@ -1411,6 +1417,7 @@ 34ADD2E41921F2F600B057AC /* AnyInstanceConformingToProtocolArgument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnyInstanceConformingToProtocolArgument.h; sourceTree = ""; }; 34ADD2E51921F33800B057AC /* AnyInstanceConformingToProtocolArgument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AnyInstanceConformingToProtocolArgument.mm; sourceTree = ""; }; 34ADE41618F23C8E00BD1E99 /* NSMethodSignature+Cedar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMethodSignature+Cedar.m"; sourceTree = ""; }; + 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDRNullabilityCompat.h; sourceTree = ""; }; 34D1E67A18F7A2E6005161AD /* AnInstanceOf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AnInstanceOf.h; path = ../Comparators/AnInstanceOf.h; sourceTree = ""; }; 34D4B5C118F3ADFF00FB2C3B /* UIKitContainSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIKitContainSpec.mm; sourceTree = ""; }; 34D4B5C418F3B68900FB2C3B /* UIKitComparatorsContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIKitComparatorsContainer.h; sourceTree = ""; }; @@ -1819,6 +1826,7 @@ AEEE1FCF11DC27B800029872 /* CDRExampleParent.h */, AEEE1FD111DC27B800029872 /* CDRFunctions.h */, 2234907C18009DA6001C8E8D /* CDRHooks.h */, + 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */, AEFD17B311DD1E8200F4448A /* CDRSharedExampleGroupPool.h */, AEEE1FD211DC27B800029872 /* CDRSpec.h */, AE8C880E13626FA5006C9305 /* CDRSpecFailure.h */, @@ -2532,6 +2540,7 @@ 3462620D1B99546C002CAEBD /* BeGreaterThan.h in Headers */, 346262061B99544D002CAEBD /* RejectedMethod.h in Headers */, 34DB674C1C2B65EB00206663 /* ContainSubset.h in Headers */, + 34C95F521C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */, 346261FD1B995445002CAEBD /* AnyArgument.h in Headers */, 346262211B995491002CAEBD /* CompareEqual.h in Headers */, 346262111B99546C002CAEBD /* BeLTE.h in Headers */, @@ -2605,6 +2614,7 @@ 34D7C4591BB9B5F100E8E523 /* CDRExampleBase.h in Headers */, 34D7C43B1BB9B5B200E8E523 /* Exist.h in Headers */, 34D7C4291BB9B59200E8E523 /* CDRFake.h in Headers */, + 34C95F531C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */, 34DB674D1C2B65EC00206663 /* ContainSubset.h in Headers */, 34D7C45E1BB9B5F100E8E523 /* CDRSharedExampleGroupPool.h in Headers */, 34D7C45F1BB9B5F100E8E523 /* CDRSpec.h in Headers */, @@ -2707,6 +2717,7 @@ 3492DAA11BA6F9E70032B35A /* CDRSpecRun.h in Headers */, AE4865B91B0690B0005DB302 /* BeCloseTo.h in Headers */, AE4865BA1B0690B0005DB302 /* BeFalsy.h in Headers */, + 34C95F511C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */, 34DB674B1C2B65EA00206663 /* ContainSubset.h in Headers */, AE4865BB1B0690B0005DB302 /* BeGreaterThan.h in Headers */, AE4865BC1B0690B0005DB302 /* BeGTE.h in Headers */, @@ -2834,6 +2845,7 @@ AE34724B19C37ECF005CA6F1 /* CDRXCTestCase.h in Headers */, AE74907415B493B5008EA127 /* CDRFake.h in Headers */, 34DB674A1C2B65EA00206663 /* ContainSubset.h in Headers */, + 34C95F501C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */, 34640DA71B6964F90083EB01 /* CDRBlockHelper.h in Headers */, AE9AA67B15AB72DA00617E1A /* CDRClassFake.h in Headers */, AE74902F15B45E80008EA127 /* CDRProtocolFake.h in Headers */, diff --git a/Source/CDRSpec.m b/Source/CDRSpec.m index ebe6e1ed..501ff406 100644 --- a/Source/CDRSpec.m +++ b/Source/CDRSpec.m @@ -107,10 +107,13 @@ @implementation CDRSpec #pragma mark Memory - (void)dealloc { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" self.rootGroup = nil; self.currentGroup = nil; self.fileName = nil; self.symbolicator = nil; +#pragma clang diagnostic pop [super dealloc]; } diff --git a/Source/CDRSpecHelper.m b/Source/CDRSpecHelper.m index 361f369d..96e2c797 100644 --- a/Source/CDRSpecHelper.m +++ b/Source/CDRSpecHelper.m @@ -32,10 +32,13 @@ - (id)init { } - (void)dealloc { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" self.sharedExampleGroups = nil; self.sharedExampleContext = nil; self.globalBeforeEachClasses = nil; self.globalAfterEachClasses = nil; +#pragma clang diagnostic pop [super dealloc]; } diff --git a/Source/Doubles/CDRFake.mm b/Source/Doubles/CDRFake.mm index 7deebe36..ef209ffa 100644 --- a/Source/Doubles/CDRFake.mm +++ b/Source/Doubles/CDRFake.mm @@ -24,8 +24,11 @@ - (id)initWithClass:(Class)klass requireExplicitStubs:(BOOL)requireExplicitStubs } - (void)dealloc { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" self.klass = nil; self.cedar_double_impl = nil; +#pragma clang diagnostic pop [super dealloc]; } diff --git a/Source/Headers/Public/CDRExample.h b/Source/Headers/Public/CDRExample.h index dbd24690..c9d52d2b 100644 --- a/Source/Headers/Public/CDRExample.h +++ b/Source/Headers/Public/CDRExample.h @@ -1,16 +1,21 @@ #import "CDRExampleBase.h" +#import "CDRNullabilityCompat.h" #import "CDRSpecFailure.h" +NS_ASSUME_NONNULL_BEGIN + @interface CDRExample : CDRExampleBase { CDRSpecBlock block_; CDRExampleState state_; CDRSpecFailure *failure_; } -@property (nonatomic, retain) CDRSpecFailure *failure; +@property (nonatomic, retain, nullable) CDRSpecFailure *failure; -+ (id)exampleWithText:(NSString *)text andBlock:(CDRSpecBlock)block; -- (id)initWithText:(NSString *)text andBlock:(CDRSpecBlock)block; ++ (id)exampleWithText:(NSString *)text andBlock:(nullable CDRSpecBlock)block; +- (id)initWithText:(NSString *)text andBlock:(nullable CDRSpecBlock)block; - (BOOL)isPending; @end + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/CDRExampleBase.h b/Source/Headers/Public/CDRExampleBase.h index 3ff5e0d2..12a407e3 100644 --- a/Source/Headers/Public/CDRExampleBase.h +++ b/Source/Headers/Public/CDRExampleBase.h @@ -1,6 +1,9 @@ #import +#import "CDRNullabilityCompat.h" #import "CDRExampleParent.h" +NS_ASSUME_NONNULL_BEGIN + @class CDRSpec, CDRReportDispatcher; typedef NS_ENUM(NSInteger, CDRExampleState) { CDRExampleStateIncomplete = 0x00, @@ -22,17 +25,17 @@ typedef NS_ENUM(NSInteger, CDRExampleState) { } @property (nonatomic, readonly) NSString *text; -@property (nonatomic, assign) NSObject *parent; -@property (nonatomic, assign) CDRSpec *spec; +@property (nonatomic, assign, nullable) NSObject *parent; +@property (nonatomic, assign, nullable) CDRSpec *spec; @property (nonatomic, assign, getter=isFocused) BOOL focused; @property (nonatomic) NSUInteger stackAddress; -@property (nonatomic, readonly) NSDate *startDate; -@property (nonatomic, readonly) NSDate *endDate; +@property (nonatomic, readonly, nullable) NSDate *startDate; +@property (nonatomic, readonly, nullable) NSDate *endDate; - (id)initWithText:(NSString *)text; -- (void)runWithDispatcher:(CDRReportDispatcher *)dispatcher; +- (void)runWithDispatcher:(nullable CDRReportDispatcher *)dispatcher; - (BOOL)shouldRun; - (BOOL)hasChildren; @@ -49,3 +52,5 @@ typedef NS_ENUM(NSInteger, CDRExampleState) { @interface CDRExampleBase (RunReporting) - (float)progress; @end + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/CDRExampleGroup.h b/Source/Headers/Public/CDRExampleGroup.h index 85a1fa18..fdfe2d4c 100644 --- a/Source/Headers/Public/CDRExampleGroup.h +++ b/Source/Headers/Public/CDRExampleGroup.h @@ -1,4 +1,7 @@ #import "CDRExampleBase.h" +#import "CDRNullabilityCompat.h" + +NS_ASSUME_NONNULL_BEGIN @interface CDRExampleGroup : CDRExampleBase { NSMutableArray *beforeBlocks_, *examples_, *afterBlocks_; @@ -6,7 +9,7 @@ CDRSpecBlock subjectActionBlock_; } -@property (nonatomic, copy) CDRSpecBlock subjectActionBlock; +@property (nonatomic, copy, nullable) CDRSpecBlock subjectActionBlock; @property (nonatomic, readonly) NSArray *examples; + (id)groupWithText:(NSString *)text; @@ -17,3 +20,5 @@ - (void)addAfter:(CDRSpecBlock)block; @end + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/CDRExampleParent.h b/Source/Headers/Public/CDRExampleParent.h index d2e881df..5fd8c2fe 100644 --- a/Source/Headers/Public/CDRExampleParent.h +++ b/Source/Headers/Public/CDRExampleParent.h @@ -1,4 +1,7 @@ #import +#import "CDRNullabilityCompat.h" + +NS_ASSUME_NONNULL_BEGIN typedef void (^CDRSpecBlock)(void); @@ -7,7 +10,7 @@ typedef void (^CDRSpecBlock)(void); - (BOOL)shouldRun; - (void)setUp; -- (CDRSpecBlock)subjectActionBlock; +- (nullable CDRSpecBlock)subjectActionBlock; - (void)tearDown; @optional @@ -17,3 +20,5 @@ typedef void (^CDRSpecBlock)(void); - (NSUInteger)stackAddress; @end + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/CDRFunctions.h b/Source/Headers/Public/CDRFunctions.h index 4840e9ef..b5dc9cca 100644 --- a/Source/Headers/Public/CDRFunctions.h +++ b/Source/Headers/Public/CDRFunctions.h @@ -1,4 +1,7 @@ #import +#import "CDRNullabilityCompat.h" + +NS_ASSUME_NONNULL_BEGIN #ifdef __cplusplus extern "C" { @@ -17,3 +20,5 @@ void CDRSuppressStandardPipesWhileLoadingClasses(); #ifdef __cplusplus } #endif + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/CDRNullabilityCompat.h b/Source/Headers/Public/CDRNullabilityCompat.h new file mode 100644 index 00000000..42411aaf --- /dev/null +++ b/Source/Headers/Public/CDRNullabilityCompat.h @@ -0,0 +1,16 @@ + +#if !__has_feature(nullability) +#ifndef NS_ASSUME_NONNULL_BEGIN + +#define NS_ASSUME_NONNULL_BEGIN +#define NS_ASSUME_NONNULL_END +#define nullable +#define nonnull +#define null_unspecified +#define null_resettable +#define __nullable +#define __nonnull +#define __null_unspecified + +#endif +#endif diff --git a/Source/Headers/Public/CDRSharedExampleGroupPool.h b/Source/Headers/Public/CDRSharedExampleGroupPool.h index 1cdc5077..6a07acc8 100644 --- a/Source/Headers/Public/CDRSharedExampleGroupPool.h +++ b/Source/Headers/Public/CDRSharedExampleGroupPool.h @@ -1,4 +1,7 @@ #import +#import "CDRNullabilityCompat.h" + +NS_ASSUME_NONNULL_BEGIN #define CDR_OVERLOADABLE __attribute__((overloadable)) @@ -13,7 +16,7 @@ extern "C" { #endif void sharedExamplesFor(NSString *, CDRSharedExampleGroupBlock); CDR_OVERLOADABLE void itShouldBehaveLike(NSString *); -CDR_OVERLOADABLE void itShouldBehaveLike(NSString *, CDRSharedExampleContextProviderBlock); +CDR_OVERLOADABLE void itShouldBehaveLike(NSString *, __nullable CDRSharedExampleContextProviderBlock); #ifdef __cplusplus } #endif @@ -34,3 +37,5 @@ CDR_OVERLOADABLE void itShouldBehaveLike(NSString *, CDRSharedExampleContextProv #define SHARED_EXAMPLE_GROUPS_END \ } \ @end + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/CDRSpec.h b/Source/Headers/Public/CDRSpec.h index b8912c18..c58227e4 100644 --- a/Source/Headers/Public/CDRSpec.h +++ b/Source/Headers/Public/CDRSpec.h @@ -1,5 +1,8 @@ #import #import "CDRExampleBase.h" +#import "CDRNullabilityCompat.h" + +NS_ASSUME_NONNULL_BEGIN @protocol CDRExampleReporter; @class CDRExampleGroup, CDRExample, CDRSpecHelper, CDRSymbolicator; @@ -8,7 +11,7 @@ @protocol CDRSpec @end -extern const CDRSpecBlock PENDING; +extern const __nullable CDRSpecBlock PENDING; #ifdef __cplusplus extern "C" { @@ -16,19 +19,19 @@ extern "C" { void beforeEach(CDRSpecBlock); void afterEach(CDRSpecBlock); -CDRExampleGroup * describe(NSString *, CDRSpecBlock); -extern CDRExampleGroup* (*context)(NSString *, CDRSpecBlock); +CDRExampleGroup * describe(NSString *, __nullable CDRSpecBlock); +extern CDRExampleGroup* __nonnull (*__nonnull context)(NSString *, __nullable CDRSpecBlock); -CDRExample * it(NSString *, CDRSpecBlock); +CDRExample * it(NSString *, __nullable CDRSpecBlock); -CDRExampleGroup * xdescribe(NSString *, CDRSpecBlock); -extern CDRExampleGroup* (*xcontext)(NSString *, CDRSpecBlock); +CDRExampleGroup * xdescribe(NSString *, __nullable CDRSpecBlock); +extern CDRExampleGroup* __nonnull (*__nonnull xcontext)(NSString *, __nullable CDRSpecBlock); void subjectAction(CDRSpecBlock); -CDRExample * xit(NSString *, CDRSpecBlock); +CDRExample * xit(NSString *, __nullable CDRSpecBlock); -CDRExampleGroup * fdescribe(NSString *, CDRSpecBlock); -extern CDRExampleGroup* (*fcontext)(NSString *, CDRSpecBlock); -CDRExample * fit(NSString *, CDRSpecBlock); +CDRExampleGroup * fdescribe(NSString *, __nullable CDRSpecBlock); +extern CDRExampleGroup* __nonnull (*__nonnull fcontext)(NSString *, __nullable CDRSpecBlock); +CDRExample * fit(NSString *, __nullable CDRSpecBlock); void fail(NSString *); #ifdef __cplusplus @@ -43,7 +46,7 @@ void fail(NSString *); } @property (nonatomic, retain) CDRExampleGroup *currentGroup, *rootGroup; -@property (nonatomic, retain) NSString *fileName; +@property (nonatomic, retain, nullable) NSString *fileName; @property (nonatomic, retain) CDRSymbolicator *symbolicator; - (void)defineBehaviors; @@ -69,3 +72,5 @@ void fail(NSString *); #define SPEC_END \ } \ @end + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/CDRSpecFailure.h b/Source/Headers/Public/CDRSpecFailure.h index 91a2c1f9..8be4ead5 100644 --- a/Source/Headers/Public/CDRSpecFailure.h +++ b/Source/Headers/Public/CDRSpecFailure.h @@ -1,4 +1,7 @@ #import +#import "CDRNullabilityCompat.h" + +NS_ASSUME_NONNULL_BEGIN @interface CDRSpecFailure : NSException { NSString *fileName_; @@ -6,9 +9,9 @@ NSArray *callStackReturnAddresses_; } -@property (nonatomic, retain, readonly) NSString *fileName; +@property (nonatomic, retain, readonly, nullable) NSString *fileName; @property (nonatomic, assign, readonly) int lineNumber; -@property (copy, readonly) NSArray *callStackReturnAddresses; +@property (copy, readonly, nullable) NSArray *callStackReturnAddresses; + (id)specFailureWithReason:(NSString *)reason; + (id)specFailureWithReason:(NSString *)reason fileName:(NSString *)fileName lineNumber:(int)lineNumber; @@ -18,6 +21,8 @@ - (id)initWithReason:(NSString *)reason fileName:(NSString *)fileName lineNumber:(int)lineNumber; - (id)initWithRaisedObject:(NSObject *)object; -- (NSString *)callStackSymbolicatedSymbols:(NSError **)error; +- (nullable NSString *)callStackSymbolicatedSymbols:(NSError **)error; @end + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/CDRSpecHelper.h b/Source/Headers/Public/CDRSpecHelper.h index c99854af..28b0e3be 100644 --- a/Source/Headers/Public/CDRSpecHelper.h +++ b/Source/Headers/Public/CDRSpecHelper.h @@ -1,8 +1,11 @@ #import "CDRSpec.h" +#import "CDRNullabilityCompat.h" #import "CDRHooks.h" #import "CDRSharedExampleGroupPool.h" #import "CDRExampleParent.h" +NS_ASSUME_NONNULL_BEGIN + @interface CDRSpecHelper : NSObject { NSMutableDictionary *sharedExampleContext_, *sharedExampleGroups_; NSArray *globalBeforeEachClasses_, *globalAfterEachClasses_; @@ -20,6 +23,8 @@ @compatibility_alias SpecHelper CDRSpecHelper; +NS_ASSUME_NONNULL_END + // This import is here for backwards-compatibility. // The Cedar spec template used to only import CDRSpecHelper.h #import "Cedar.h" diff --git a/Source/Headers/Public/Doubles/CDRClassFake.h b/Source/Headers/Public/Doubles/CDRClassFake.h index 66de7fed..f30e7ac3 100644 --- a/Source/Headers/Public/Doubles/CDRClassFake.h +++ b/Source/Headers/Public/Doubles/CDRClassFake.h @@ -1,7 +1,10 @@ #import +#import "CDRNullabilityCompat.h" #import "CDRFake.h" #import "CedarDouble.h" +NS_ASSUME_NONNULL_BEGIN + #ifdef __cplusplus @interface CDRClassFake : CDRFake @@ -11,3 +14,5 @@ id CDR_fake_for(BOOL require_explicit_stubs, Class klass, ...); #endif // __cplusplus + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/Doubles/CDRFake.h b/Source/Headers/Public/Doubles/CDRFake.h index 05e8494a..6f8c6c46 100644 --- a/Source/Headers/Public/Doubles/CDRFake.h +++ b/Source/Headers/Public/Doubles/CDRFake.h @@ -1,6 +1,9 @@ #import +#import "CDRNullabilityCompat.h" #import "CedarDouble.h" +NS_ASSUME_NONNULL_BEGIN + #ifdef __cplusplus @interface CDRFake : NSObject @@ -18,3 +21,5 @@ #endif #endif // __cplusplus + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/Doubles/CDRProtocolFake.h b/Source/Headers/Public/Doubles/CDRProtocolFake.h index bd26309b..38bb4640 100644 --- a/Source/Headers/Public/Doubles/CDRProtocolFake.h +++ b/Source/Headers/Public/Doubles/CDRProtocolFake.h @@ -1,4 +1,5 @@ #import +#import "CDRNullabilityCompat.h" #import "CedarDouble.h" #import "CDRFake.h" @@ -7,6 +8,8 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + @interface CDRProtocolFake : CDRFake - (id)initWithClass:(Class)klass forProtocols:(NSArray *)protocols requireExplicitStubs:(BOOL)requireExplicitStubs; @@ -15,4 +18,7 @@ id CDR_fake_for(BOOL require_explicit_stubs, Protocol *protocol, ...); +NS_ASSUME_NONNULL_END + #endif // __cplusplus + diff --git a/Source/Headers/Public/Doubles/CDRSpy.h b/Source/Headers/Public/Doubles/CDRSpy.h index 183405cc..7fe328dc 100644 --- a/Source/Headers/Public/Doubles/CDRSpy.h +++ b/Source/Headers/Public/Doubles/CDRSpy.h @@ -1,6 +1,9 @@ #import +#import "CDRNullabilityCompat.h" #import "CedarDouble.h" +NS_ASSUME_NONNULL_BEGIN + #ifdef __cplusplus @interface CDRSpy : NSProxy @@ -26,3 +29,5 @@ namespace Cedar { namespace Doubles { #endif #endif // __cplusplus + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/Reporters/CDRExampleReporter.h b/Source/Headers/Public/Reporters/CDRExampleReporter.h index 8a83a93e..65e12856 100644 --- a/Source/Headers/Public/Reporters/CDRExampleReporter.h +++ b/Source/Headers/Public/Reporters/CDRExampleReporter.h @@ -1,4 +1,7 @@ #import +#import "CDRNullabilityCompat.h" + +NS_ASSUME_NONNULL_BEGIN @class CDRExample, CDRExampleGroup, CDRSpec; @@ -20,3 +23,5 @@ - (void)runDidFinishSpec:(CDRSpec *)spec; @end + +NS_ASSUME_NONNULL_END diff --git a/Spec/Doubles/CDRSpySpec.mm b/Spec/Doubles/CDRSpySpec.mm index 87f65b75..ff8ec79c 100644 --- a/Spec/Doubles/CDRSpySpec.mm +++ b/Spec/Doubles/CDRSpySpec.mm @@ -126,7 +126,10 @@ itShouldBehaveLike(@"a Cedar double when used with ARC"); it(@"should blow up in an obvious manner when spying on nil", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" ^{ spy_on(nil); } should raise_exception.with_reason(@"Cannot spy on nil"); +#pragma clang diagnostic pop }); it(@"should not change the functionality of the given object", ^{ @@ -430,7 +433,10 @@ describe(@"stop_spying_on", ^{ it(@"should blow up in an obvious manner when spying on nil", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" ^{ stop_spying_on(nil); } should raise_exception.with_reason(@"Cannot stop spying on nil"); +#pragma clang diagnostic pop }); it(@"should fail gracefully for an object that is not being spied upon", ^{ From db50a59b69821ddb0270e9ac5f8b4147f3256f65 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Sat, 26 Dec 2015 00:06:27 -0500 Subject: [PATCH 05/14] Make the OS X framework define a module --- Cedar.xcodeproj/project.pbxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cedar.xcodeproj/project.pbxproj b/Cedar.xcodeproj/project.pbxproj index 069eac7e..d431a13c 100644 --- a/Cedar.xcodeproj/project.pbxproj +++ b/Cedar.xcodeproj/project.pbxproj @@ -5275,8 +5275,10 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; + DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -5305,9 +5307,11 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -5335,6 +5339,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -5364,6 +5369,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( From 7d128329588e4a06d3ced9b8fb0fddf154328490 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Mon, 28 Dec 2015 15:50:31 -0500 Subject: [PATCH 06/14] CDRSpecHelper's singleton accessor is not a factory method --- Source/Headers/Public/CDRSpecHelper.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Headers/Public/CDRSpecHelper.h b/Source/Headers/Public/CDRSpecHelper.h index 28b0e3be..540914cb 100644 --- a/Source/Headers/Public/CDRSpecHelper.h +++ b/Source/Headers/Public/CDRSpecHelper.h @@ -4,6 +4,10 @@ #import "CDRSharedExampleGroupPool.h" #import "CDRExampleParent.h" +#ifndef NS_SWIFT_NAME +#define NS_SWIFT_NAME(_name) +#endif + NS_ASSUME_NONNULL_BEGIN @interface CDRSpecHelper : NSObject { @@ -17,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) BOOL shouldOnlyRunFocused; -+ (CDRSpecHelper *)specHelper; ++ (CDRSpecHelper *)specHelper NS_SWIFT_NAME(specHelper()); @end From 0999899b99473ae5b9c905664cce22402ad093a2 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Sat, 26 Dec 2015 13:33:27 -0500 Subject: [PATCH 07/14] Add a spec for basic BDD runner usage in Swift --- Cedar.xcodeproj/project.pbxproj | 39 ++++- Spec/Matchers/ExpectFailureWithMessage.h | 5 + Spec/Swift/Spec-Bridging-Header.h | 1 + Spec/Swift/SwiftSpec.swift | 182 +++++++++++++++++++++++ 4 files changed, 225 insertions(+), 2 deletions(-) create mode 100644 Spec/Swift/Spec-Bridging-Header.h create mode 100644 Spec/Swift/SwiftSpec.swift diff --git a/Cedar.xcodeproj/project.pbxproj b/Cedar.xcodeproj/project.pbxproj index d431a13c..c7f5947c 100644 --- a/Cedar.xcodeproj/project.pbxproj +++ b/Cedar.xcodeproj/project.pbxproj @@ -70,6 +70,8 @@ 34322B0C1BA7471B00D0CFBD /* TestObservationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 34757E211BA466050047BC8D /* TestObservationHelper.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; 343FAFEA190FDAEC0085AFEC /* DeallocNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 343FAFE9190FDAEC0085AFEC /* DeallocNotifier.m */; }; 343FAFEB190FDAEC0085AFEC /* DeallocNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 343FAFE9190FDAEC0085AFEC /* DeallocNotifier.m */; }; + 345B1E891C31D495009BB77D /* SwiftSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */; }; + 345B1E8C1C31D4B4009BB77D /* SwiftSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */; }; 346261E71B995422002CAEBD /* CDRSpyInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AEE8DBD2175FFCF3008AF18A /* CDRSpyInfo.h */; }; 346261E81B995422002CAEBD /* CedarDoubleImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = AE9AA6DA15AE0B0300617E1A /* CedarDoubleImpl.h */; }; 346261E91B995422002CAEBD /* NSInvocation+Cedar.h in Headers */ = {isa = PBXBuildFile; fileRef = AEAA191019DCC5A900194E95 /* NSInvocation+Cedar.h */; }; @@ -272,6 +274,7 @@ 34C95F521C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; 34C95F531C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; 34C95F541C2DD7B30055F089 /* CDRNullabilityCompat.h in Copy headers to framework */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; }; + 34C95F551C2E57A90055F089 /* SwiftSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */; }; 34D4B5C318F3AE0400FB2C3B /* UIKitContainSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34D4B5C118F3ADFF00FB2C3B /* UIKitContainSpec.mm */; }; 34D7C3C01BB970DF00E8E523 /* CDRXCTestFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3492DA961BA670C10032B35A /* CDRXCTestFunctions.m */; }; 34D7C3C11BB970F100E8E523 /* CDRSpecRun.m in Sources */ = {isa = PBXBuildFile; fileRef = 3492DA9E1BA6F9E70032B35A /* CDRSpecRun.m */; }; @@ -490,6 +493,7 @@ 34D7C4B41BB9C75D00E8E523 /* TestObservationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 34757E211BA466050047BC8D /* TestObservationHelper.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; 34D7C4B61BB9CB4B00E8E523 /* Cedar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34D7C3CA1BB9747400E8E523 /* Cedar.framework */; }; 34D7C4B81BB9CB5700E8E523 /* libxml2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 34D7C4B71BB9CB5700E8E523 /* libxml2.tbd */; }; + 34DB67491C2B4D6A00206663 /* SwiftSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */; }; 34DB674A1C2B65EA00206663 /* ContainSubset.h in Headers */ = {isa = PBXBuildFile; fileRef = AE8F9C141B795A7C00B956C5 /* ContainSubset.h */; settings = {ATTRIBUTES = (Public, ); }; }; 34DB674B1C2B65EA00206663 /* ContainSubset.h in Headers */ = {isa = PBXBuildFile; fileRef = AE8F9C141B795A7C00B956C5 /* ContainSubset.h */; settings = {ATTRIBUTES = (Public, ); }; }; 34DB674C1C2B65EB00206663 /* ContainSubset.h in Headers */ = {isa = PBXBuildFile; fileRef = AE8F9C141B795A7C00B956C5 /* ContainSubset.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1385,6 +1389,7 @@ 34322B081BA740B900D0CFBD /* CDRXCTestObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDRXCTestObserver.h; sourceTree = ""; }; 343FAFE8190FDAEC0085AFEC /* DeallocNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeallocNotifier.h; sourceTree = ""; }; 343FAFE9190FDAEC0085AFEC /* DeallocNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DeallocNotifier.m; sourceTree = ""; }; + 345B1E881C31CC96009BB77D /* Spec-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Spec-Bridging-Header.h"; sourceTree = ""; }; 3460489318F2DBBF00BC93B6 /* CDRBlockHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDRBlockHelper.h; sourceTree = ""; }; 346261DF1B995239002CAEBD /* Cedar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cedar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 346262781B99C1DB002CAEBD /* Cedar-watchOS Specs.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Cedar-watchOS Specs.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1424,6 +1429,7 @@ 34D7C3CA1BB9747400E8E523 /* Cedar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cedar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34D7C4691BB9B71600E8E523 /* Cedar-tvOS SpecBundle.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Cedar-tvOS SpecBundle.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 34D7C4B71BB9CB5700E8E523 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/lib/libxml2.tbd; sourceTree = DEVELOPER_DIR; }; + 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftSpec.swift; sourceTree = ""; }; 34DB674F1C2B8C1000206663 /* CedarReporters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CedarReporters.h; sourceTree = ""; }; 34F3DF7B1A6ABA2E003041DA /* CDRNil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDRNil.h; sourceTree = ""; }; 34F3DF7C1A6ABA2E003041DA /* CDRNil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDRNil.m; sourceTree = ""; }; @@ -1941,6 +1947,15 @@ path = iOS; sourceTree = ""; }; + 34DB67471C2B4CBA00206663 /* Swift */ = { + isa = PBXGroup; + children = ( + 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */, + 345B1E881C31CC96009BB77D /* Spec-Bridging-Header.h */, + ); + path = Swift; + sourceTree = ""; + }; 4523FFB9BD607306C7ED94A3 /* GData */ = { isa = PBXGroup; children = ( @@ -2304,6 +2319,7 @@ 346D1A981BBB389A00BECD4B /* SpecBundle-Info.plist */, 1F45A3E2180E4A1C003C1E36 /* SpecBundleApplicationTestsWithXCTest.m */, 96D34483144A845100352C4A /* SpecBundleApplicationTests.mm */, + 34DB67471C2B4CBA00206663 /* Swift */, E328612E1604F254001FA77E /* Support */, 346262791B99C1DB002CAEBD /* watchOS */, AEEE1FE811DC27B800029872 /* CDRExampleGroupSpec.mm */, @@ -3216,6 +3232,7 @@ AEEE1FA611DC26EA00029872 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 0720; LastTestingUpgradeCheck = 0700; LastUpgradeCheck = 0720; ORGANIZATIONNAME = Pivotal; @@ -3610,6 +3627,7 @@ 34FD464B1B99D2B000257186 /* ConformToSpec.mm in Sources */, 34FD463D1B99D25600257186 /* DeallocNotifier.m in Sources */, 34FD463F1B99D2B000257186 /* BeCloseToSpec.mm in Sources */, + 345B1E8C1C31D4B4009BB77D /* SwiftSpec.swift in Sources */, 34FD46481B99D2B000257186 /* BeSameInstanceAs_ARCSpec.mm in Sources */, 34FD46671B99D2F900257186 /* CDRNilSpec.mm in Sources */, 34FD46591B99D2E300257186 /* CedarDoubleARCSharedExamples.mm in Sources */, @@ -3690,6 +3708,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 345B1E891C31D495009BB77D /* SwiftSpec.swift in Sources */, 34D7C4AC1BB9C6C400E8E523 /* CDRExampleGroupSpec.mm in Sources */, 34D7C4851BB9C62400E8E523 /* DeallocNotifier.m in Sources */, 34D7C4891BB9C67400E8E523 /* CDRSpyiOSSpec.mm in Sources */, @@ -3845,6 +3864,7 @@ AE19378A1B1AC94D008C8CD8 /* BeInstanceOfSpec.mm in Sources */, AE1937881B1AC94D008C8CD8 /* BeGreaterThanSpec.mm in Sources */, AE1937651B1AC22D008C8CD8 /* CDRSpecSpec.mm in Sources */, + 34C95F551C2E57A90055F089 /* SwiftSpec.swift in Sources */, AE1937921B1AC94D008C8CD8 /* ConformToSpec.mm in Sources */, AE19378C1B1AC94D008C8CD8 /* BeLTESpec.mm in Sources */, AE0BF0711B8E10D8000B0EE7 /* BlockMatcher_ARCSpecSpec.mm in Sources */, @@ -4003,6 +4023,7 @@ files = ( AEEE21C411DC290400029872 /* SpecSpec2.m in Sources */, 346F646E1B82D3C900F64156 /* BlockMatcherSpec.mm in Sources */, + 34DB67491C2B4D6A00206663 /* SwiftSpec.swift in Sources */, F7C8F3041BC63A000088069D /* ContainSubsetSpec.mm in Sources */, AEEE21BF11DC290400029872 /* CDRExampleSpec.mm in Sources */, AEEE21BE11DC290400029872 /* CDRExampleGroupSpec.mm in Sources */, @@ -4459,6 +4480,7 @@ PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -4489,6 +4511,7 @@ PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; TARGETED_DEVICE_FAMILY = 4; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -4504,6 +4527,7 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; DEBUG_INFORMATION_FORMAT = dwarf; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -4534,6 +4558,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -4698,6 +4723,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.pivotallabs.cedar.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; TVOS_DEPLOYMENT_TARGET = 9.0; WRAPPER_EXTENSION = xctest; }; @@ -4728,6 +4754,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.pivotallabs.cedar.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; WRAPPER_EXTENSION = xctest; @@ -4938,6 +4965,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "io.pivotal.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -4980,6 +5008,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "io.pivotal.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -5354,7 +5383,8 @@ /usr/include/libxml2, ); INSTALL_PATH = /usr/local/bin; - MACOSX_DEPLOYMENT_TARGET = 10.7; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-framework", @@ -5362,6 +5392,8 @@ "-lxml2", ); PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; @@ -5384,7 +5416,8 @@ /usr/include/libxml2, ); INSTALL_PATH = /usr/local/bin; - MACOSX_DEPLOYMENT_TARGET = 10.7; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-framework", @@ -5392,6 +5425,8 @@ "-lxml2", ); PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; ZERO_LINK = NO; }; name = Release; diff --git a/Spec/Matchers/ExpectFailureWithMessage.h b/Spec/Matchers/ExpectFailureWithMessage.h index c0e01eb1..39769073 100644 --- a/Spec/Matchers/ExpectFailureWithMessage.h +++ b/Spec/Matchers/ExpectFailureWithMessage.h @@ -1,6 +1,9 @@ #import +#import "CDRNullabilityCompat.h" #import "CDRExampleBase.h" +NS_ASSUME_NONNULL_BEGIN + #ifdef __cplusplus extern "C" { #endif @@ -9,3 +12,5 @@ void expectExceptionWithReason(NSString *reason, CDRSpecBlock block); #ifdef __cplusplus } #endif + +NS_ASSUME_NONNULL_END diff --git a/Spec/Swift/Spec-Bridging-Header.h b/Spec/Swift/Spec-Bridging-Header.h new file mode 100644 index 00000000..e9835efb --- /dev/null +++ b/Spec/Swift/Spec-Bridging-Header.h @@ -0,0 +1 @@ +#import "ExpectFailureWithMessage.h" diff --git a/Spec/Swift/SwiftSpec.swift b/Spec/Swift/SwiftSpec.swift new file mode 100644 index 00000000..7fda5074 --- /dev/null +++ b/Spec/Swift/SwiftSpec.swift @@ -0,0 +1,182 @@ +import Cedar + +/// A very simple function for making assertions since Cedar provides no +/// matchers usable from Swift +private func expectThat(@autoclosure expression: () -> Bool, file: String = __FILE__, line: UInt = __LINE__) { + if !expression() { + CDRSpecFailure.specFailureWithReason("Expectation failed", fileName: file, lineNumber: Int32(line)).raise() + } +} + +private var globalValue__: String? + +/// This mirrors `SpecSpec` +class SwiftSpecSpec: CDRSpec { + override func declareBehaviors() { + describe("SwiftSpec") { + beforeEach { +// NSLog("=====================> I should run before all specs.") + } + + afterEach { +// NSLog("=====================> I should run after all specs.") + } + + describe("a nested spec") { + beforeEach { +// NSLog("=====================> I should run only before the nested specs.") + } + + afterEach { +// NSLog("=====================> I should run only after the nested specs.") + } + + it("should also run") { +// NSLog("=====================> Nested spec") + } + + it("should also also run") { +// NSLog("=====================> Another nested spec") + } + } + + context("a nested spec (context)") { + beforeEach { +// NSLog("=====================> I should run only before the nested specs.") + } + + afterEach { +// NSLog("=====================> I should run only after the nested specs.") + } + + it("should also run") { +// NSLog("=====================> Nested spec") + } + + it("should also also run") { +// NSLog("=====================> Another nested spec") + } + } + + it("should run") { +// NSLog("=====================> Spec") + } + + it("should be pending", PENDING) + it("should also be pending", nil) + xit("should also be pending (xit)") {} + + describe("described specs should be pending", PENDING) + describe("described specs should also be pending", nil) + xdescribe("xdescribed specs should be pending") {} + + context("contexted specs should be pending", PENDING) + context("contexted specs should also be pending", nil) + xcontext("xcontexted specs should be pending") {}; + + describe("empty describe blocks should be pending") {} + context("empty context blocks should be pending") {} + } + + describe("subjectAction") { + var value: Int = 0 + + subjectAction { value = 5 } + + beforeEach { + value = 100 + } + + it("should run after the beforeEach") { + expectThat(value == 5) + } + + describe("in a nested describe block") { + beforeEach { + value = 200 + } + + it("should run after all the beforeEach blocks") { + expectThat(value == 5) + } + } + } + + describe("a describe block") { + beforeEach { + globalValue__ = nil + } + + describe("that contains a beforeEach in a shared example group") { + itShouldBehaveLike("a describe context that contains a beforeEach in a Swift shared example group") + + it("should not run the shared beforeEach before specs outside the shared example group") { + expectThat(globalValue__ == nil) + } + } + + describe("that passes a value to the shared example context") { + beforeEach { + globalValue__ = "something" + CDRSpecHelper.specHelper().sharedExampleContext["value"] = globalValue__ + } + + itShouldBehaveLike("a Swift shared example group that receives a value in the context") + } + + describe("that passes a value in-line to the shared example context") { + beforeEach { + globalValue__ = "something" + } + + expectThat(globalValue__ == nil) + itShouldBehaveLike("a Swift shared example group that receives a value in the context") { + $0["value"] = globalValue__ + } + } + + itShouldBehaveLike("a Swift shared example group that contains a failing spec") + } + + describe("a describe block that tries to include a shared example group that doesn't exist") { + expectExceptionWithReason("Unknown shared example group with description: 'a unicorn'") { + itShouldBehaveLike("a unicorn") + } + } + } +} + +class SharedExampleGroupPoolForSwiftSpecs: CDRSharedExampleGroupPool { + override func declareSharedExampleGroups() { + sharedExamplesFor("a describe context that contains a beforeEach in a Swift shared example group") { _ in + beforeEach { + expectThat(CDRSpecHelper.specHelper().sharedExampleContext.count == 0) + globalValue__ = "" + } + + it("should run the shared beforeEach before specs inside the shared example group") { + expectThat(globalValue__ != nil) + } + } + + sharedExamplesFor("a Swift shared example group that receives a value in the context") { context in + + // This doesn't work because the `context` variable is bridged into Swift as a value type + // instead of a reference type. The commented-out line is an alternative way to access + // the values that *does* work, but isn't as pleasant. I believe this could be fixed by + // adding a Swift "overlay" for `sharedExamplesFor` in the Cedar framework. + xit("should receive the values set in the global shared example context") { + expectThat((context["value"] as? String) == globalValue__) +// expectThat((CDRSpecHelper.specHelper().sharedExampleContext["value"] as? String) == globalValue__) + } + } + + sharedExamplesFor("a Swift shared example group that contains a failing spec") { _ in + it("should fail in the expected fashion") { + expectFailureWithMessage("Expectation failed") { + expectThat("wibble" == "wobble") + } + } + } + } +} From 4bc5098e8ea30a69c5a0a2ce85d598d239655921 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Mon, 28 Dec 2015 15:58:17 -0500 Subject: [PATCH 08/14] Move XCTest specs out of the iOS group and add them to the Mac spec bundle --- Cedar.xcodeproj/project.pbxproj | 16 ++++---- Spec/XCTest/CDRXCTestSuiteSpec.mm | 66 +++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 Spec/XCTest/CDRXCTestSuiteSpec.mm diff --git a/Cedar.xcodeproj/project.pbxproj b/Cedar.xcodeproj/project.pbxproj index c7f5947c..e1ab195b 100644 --- a/Cedar.xcodeproj/project.pbxproj +++ b/Cedar.xcodeproj/project.pbxproj @@ -275,6 +275,7 @@ 34C95F531C2DD7B30055F089 /* CDRNullabilityCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; 34C95F541C2DD7B30055F089 /* CDRNullabilityCompat.h in Copy headers to framework */ = {isa = PBXBuildFile; fileRef = 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */; }; 34C95F551C2E57A90055F089 /* SwiftSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */; }; + 34C95F561C2F16900055F089 /* CDRXCTestSuiteSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE34724019C2259B005CA6F1 /* CDRXCTestSuiteSpec.mm */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 34D4B5C318F3AE0400FB2C3B /* UIKitContainSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34D4B5C118F3ADFF00FB2C3B /* UIKitContainSpec.mm */; }; 34D7C3C01BB970DF00E8E523 /* CDRXCTestFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3492DA961BA670C10032B35A /* CDRXCTestFunctions.m */; }; 34D7C3C11BB970F100E8E523 /* CDRSpecRun.m in Sources */ = {isa = PBXBuildFile; fileRef = 3492DA9E1BA6F9E70032B35A /* CDRSpecRun.m */; }; @@ -444,7 +445,7 @@ 34D7C4831BB9C61A00E8E523 /* ObjectWithValueEquality.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D28051818E2321D00887CC4 /* ObjectWithValueEquality.m */; }; 34D7C4841BB9C61E00E8E523 /* FooSuperclass.m in Sources */ = {isa = PBXBuildFile; fileRef = AED10EBB18F46C0E00950904 /* FooSuperclass.m */; }; 34D7C4851BB9C62400E8E523 /* DeallocNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 343FAFE9190FDAEC0085AFEC /* DeallocNotifier.m */; }; - 34D7C4861BB9C65700E8E523 /* CDRXTestSuiteSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE34724019C2259B005CA6F1 /* CDRXTestSuiteSpec.mm */; }; + 34D7C4861BB9C65700E8E523 /* CDRXCTestSuiteSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE34724019C2259B005CA6F1 /* CDRXCTestSuiteSpec.mm */; }; 34D7C4871BB9C66000E8E523 /* CedarApplicationDelegateSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE7DD11117296CB20058EB3B /* CedarApplicationDelegateSpec.mm */; }; 34D7C4881BB9C67100E8E523 /* WeakReferenceCompatibilitySpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE5218D4175979D900A656BC /* WeakReferenceCompatibilitySpec.mm */; }; 34D7C4891BB9C67400E8E523 /* CDRSpyiOSSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 228F3FA617E3ECD10000C8AF /* CDRSpyiOSSpec.mm */; }; @@ -759,7 +760,7 @@ AE34723719C12534005CA6F1 /* FibonacciCalculator.m in Sources */ = {isa = PBXBuildFile; fileRef = E32861311604F287001FA77E /* FibonacciCalculator.m */; }; AE34723919C12588005CA6F1 /* SimpleKeyValueObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = AE80788C183C71950078C608 /* SimpleKeyValueObserver.m */; }; AE34723D19C22547005CA6F1 /* CDRDefaultReporterSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AEBCDD7E173ACD6700B42B58 /* CDRDefaultReporterSpec.mm */; }; - AE34724619C225A1005CA6F1 /* CDRXTestSuiteSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE34724019C2259B005CA6F1 /* CDRXTestSuiteSpec.mm */; }; + AE34724619C225A1005CA6F1 /* CDRXCTestSuiteSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE34724019C2259B005CA6F1 /* CDRXCTestSuiteSpec.mm */; }; AE34724B19C37ECF005CA6F1 /* CDRXCTestCase.h in Headers */ = {isa = PBXBuildFile; fileRef = AE34724919C37ECF005CA6F1 /* CDRXCTestCase.h */; }; AE34724D19C37ECF005CA6F1 /* CDRXCTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = AE34724A19C37ECF005CA6F1 /* CDRXCTestCase.m */; }; AE34724E19C37ECF005CA6F1 /* CDRXCTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = AE34724A19C37ECF005CA6F1 /* CDRXCTestCase.m */; }; @@ -1507,7 +1508,7 @@ AE248FAA19DCD52500092C14 /* Cedar-OSX SpecBundle.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Cedar-OSX SpecBundle.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; AE31A29D19C0F23F00C438C1 /* CDRXCTestSuite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDRXCTestSuite.h; sourceTree = ""; }; AE31A29E19C0F23F00C438C1 /* CDRXCTestSuite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDRXCTestSuite.m; sourceTree = ""; }; - AE34724019C2259B005CA6F1 /* CDRXTestSuiteSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDRXTestSuiteSpec.mm; sourceTree = ""; }; + AE34724019C2259B005CA6F1 /* CDRXCTestSuiteSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDRXCTestSuiteSpec.mm; sourceTree = ""; }; AE34724919C37ECF005CA6F1 /* CDRXCTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDRXCTestCase.h; sourceTree = ""; }; AE34724A19C37ECF005CA6F1 /* CDRXCTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDRXCTestCase.m; sourceTree = ""; }; AE36AC6415B5CA6E00EB6C51 /* CedarDouble.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CedarDouble.mm; sourceTree = ""; }; @@ -2140,7 +2141,7 @@ AE34723F19C2257A005CA6F1 /* XCTest */ = { isa = PBXGroup; children = ( - AE34724019C2259B005CA6F1 /* CDRXTestSuiteSpec.mm */, + AE34724019C2259B005CA6F1 /* CDRXCTestSuiteSpec.mm */, ); path = XCTest; sourceTree = ""; @@ -2322,6 +2323,7 @@ 34DB67471C2B4CBA00206663 /* Swift */, E328612E1604F254001FA77E /* Support */, 346262791B99C1DB002CAEBD /* watchOS */, + AE34723F19C2257A005CA6F1 /* XCTest */, AEEE1FE811DC27B800029872 /* CDRExampleGroupSpec.mm */, AEEE1FE911DC27B800029872 /* CDRExampleSpec.mm */, 34F3DF811A6ABB21003041DA /* CDRNilSpec.mm */, @@ -2341,7 +2343,6 @@ AEEE1FEB11DC27B800029872 /* iOS */ = { isa = PBXGroup; children = ( - AE34723F19C2257A005CA6F1 /* XCTest */, AE02E83018526E9F00414F19 /* Cedar-iOSSpec.mm */, AE7DD11117296CB20058EB3B /* CedarApplicationDelegateSpec.mm */, 228F3FA617E3ECD10000C8AF /* CDRSpyiOSSpec.mm */, @@ -3503,7 +3504,7 @@ AE34723419C124D6005CA6F1 /* ObjCHeadersSpec.mm in Sources */, 34322B0C1BA7471B00D0CFBD /* TestObservationHelper.m in Sources */, AE34723D19C22547005CA6F1 /* CDRDefaultReporterSpec.mm in Sources */, - AE34724619C225A1005CA6F1 /* CDRXTestSuiteSpec.mm in Sources */, + AE34724619C225A1005CA6F1 /* CDRXCTestSuiteSpec.mm in Sources */, F78FDA1A1B43AA930054C768 /* HaveReceivedSpec.mm in Sources */, AE34722819C11872005CA6F1 /* GlobalBeforeEachSpec.mm in Sources */, 1F45A3D1180E4796003C1E36 /* CDRSpecFailureSpec.mm in Sources */, @@ -3757,7 +3758,7 @@ 34D7C4781BB9B7A500E8E523 /* ARCViewController.m in Sources */, 34D7C4821BB9C61700E8E523 /* ExampleWithPublicRunDates.mm in Sources */, 34D7C4B21BB9C6C700E8E523 /* CDRTypeUtilitiesSpec.mm in Sources */, - 34D7C4861BB9C65700E8E523 /* CDRXTestSuiteSpec.mm in Sources */, + 34D7C4861BB9C65700E8E523 /* CDRXCTestSuiteSpec.mm in Sources */, 34D7C4931BB9C67C00E8E523 /* BeSameInstanceAs_ARCSpec.mm in Sources */, 34D7C47F1BB9C60A00E8E523 /* SimpleIncrementer.m in Sources */, 34D7C4B11BB9C6C400E8E523 /* SpecSpec.mm in Sources */, @@ -3898,6 +3899,7 @@ files = ( 34757E261BA4A48E0047BC8D /* TestObservationHelper.m in Sources */, 346D1A971BBB37F400BECD4B /* SpecBundleApplicationTestsWithXCTest.m in Sources */, + 34C95F561C2F16900055F089 /* CDRXCTestSuiteSpec.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Spec/XCTest/CDRXCTestSuiteSpec.mm b/Spec/XCTest/CDRXCTestSuiteSpec.mm new file mode 100644 index 00000000..9f1d1f6c --- /dev/null +++ b/Spec/XCTest/CDRXCTestSuiteSpec.mm @@ -0,0 +1,66 @@ +#if TARGET_OS_IPHONE +// Normally you would include this file out of the framework. However, we're +// testing the framework here, so including the file from the framework will +// conflict with the compiler attempting to include the file from the project. +#import "CDRSpecHelper.h" +#else +#import +#endif + +#import "CDRSpec.h" +#import "CDRXCTestSuite.h" +#import "CDRReportDispatcher.h" +#import "CDRXCTestSupport.h" + +using namespace Cedar::Matchers; +using namespace Cedar::Doubles; + +SPEC_BEGIN(CDRXCTestSuiteSpec) + +describe(@"CDRXCTestSuite", ^{ + __block id subject; + __block CDRReportDispatcher *dispatcher; + + static NSUInteger willStartExampleGroupCount; + static NSUInteger didFinishExampleGroupCount; + + it(@"should report that each parent example group has started and ended to the dispatcher", ^{ + willStartExampleGroupCount = 0; + didFinishExampleGroupCount = 0; + + dispatcher = nice_fake_for([CDRReportDispatcher class]); + dispatcher stub_method(@selector(runWillStartExampleGroup:)).and_do_block(^(CDRExampleGroup *group){ + ++willStartExampleGroupCount; + }); + dispatcher stub_method(@selector(runDidFinishExampleGroup:)).and_do_block(^(CDRExampleGroup *group){ + ++didFinishExampleGroupCount; + }); + + CDRSpec *simulatedSpec = [[[NSClassFromString(@"CDRXCSimulatedTestSuiteSpec") alloc] init] autorelease]; + [simulatedSpec defineBehaviors]; + subject = [simulatedSpec testSuiteWithRandomSeed:0 dispatcher:dispatcher]; + [subject performTest:nil]; + + willStartExampleGroupCount should equal(4); + didFinishExampleGroupCount should equal(4); + }); +}); + +SPEC_END + + +SPEC_BEGIN(CDRXCSimulatedTestSuiteSpec) + +describe(@"CDRXCSimulatedTestSuite", ^{ + describe(@"with nested groups", ^{ + describe(@"lots of nested groups", ^{ + describe(@"no really, lots of nested groups", ^{ + it(@"should start and finish each example group", ^{ + // nothing to see here + }); + }); + }); + }); +}); + +SPEC_END From 95d29880aed6f2309ae714ad91191941c2ed3237 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Mon, 28 Dec 2015 15:58:43 -0500 Subject: [PATCH 09/14] Translate XCTAssert* failures into Cedar spec failures --- Cedar.xcodeproj/project.pbxproj | 10 ++++++++++ Source/XCTest/CDRXCTestCase.m | 16 ++++++++++++++++ Spec/Swift/XCTAssertSpec.swift | 18 ++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 Spec/Swift/XCTAssertSpec.swift diff --git a/Cedar.xcodeproj/project.pbxproj b/Cedar.xcodeproj/project.pbxproj index e1ab195b..fc726b18 100644 --- a/Cedar.xcodeproj/project.pbxproj +++ b/Cedar.xcodeproj/project.pbxproj @@ -72,6 +72,9 @@ 343FAFEB190FDAEC0085AFEC /* DeallocNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 343FAFE9190FDAEC0085AFEC /* DeallocNotifier.m */; }; 345B1E891C31D495009BB77D /* SwiftSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */; }; 345B1E8C1C31D4B4009BB77D /* SwiftSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */; }; + 345B1E8F1C31DA6E009BB77D /* XCTAssertSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345B1E8D1C31DA2B009BB77D /* XCTAssertSpec.swift */; }; + 345B1E911C31DA70009BB77D /* XCTAssertSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345B1E8D1C31DA2B009BB77D /* XCTAssertSpec.swift */; }; + 345B1E921C31E644009BB77D /* ExpectFailureWithMessage.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE8C87AB13624524006C9305 /* ExpectFailureWithMessage.mm */; }; 346261E71B995422002CAEBD /* CDRSpyInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AEE8DBD2175FFCF3008AF18A /* CDRSpyInfo.h */; }; 346261E81B995422002CAEBD /* CedarDoubleImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = AE9AA6DA15AE0B0300617E1A /* CedarDoubleImpl.h */; }; 346261E91B995422002CAEBD /* NSInvocation+Cedar.h in Headers */ = {isa = PBXBuildFile; fileRef = AEAA191019DCC5A900194E95 /* NSInvocation+Cedar.h */; }; @@ -1391,6 +1394,7 @@ 343FAFE8190FDAEC0085AFEC /* DeallocNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeallocNotifier.h; sourceTree = ""; }; 343FAFE9190FDAEC0085AFEC /* DeallocNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DeallocNotifier.m; sourceTree = ""; }; 345B1E881C31CC96009BB77D /* Spec-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Spec-Bridging-Header.h"; sourceTree = ""; }; + 345B1E8D1C31DA2B009BB77D /* XCTAssertSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCTAssertSpec.swift; sourceTree = ""; }; 3460489318F2DBBF00BC93B6 /* CDRBlockHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDRBlockHelper.h; sourceTree = ""; }; 346261DF1B995239002CAEBD /* Cedar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cedar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 346262781B99C1DB002CAEBD /* Cedar-watchOS Specs.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Cedar-watchOS Specs.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1952,6 +1956,7 @@ isa = PBXGroup; children = ( 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */, + 345B1E8D1C31DA2B009BB77D /* XCTAssertSpec.swift */, 345B1E881C31CC96009BB77D /* Spec-Bridging-Header.h */, ); path = Swift; @@ -3769,6 +3774,7 @@ 34D7C49C1BB9C68100E8E523 /* BeEmptySpec.mm in Sources */, 34D7C4971BB9C67C00E8E523 /* EqualSpec.mm in Sources */, 34D7C48F1BB9C67C00E8E523 /* BeLessThanSpec.mm in Sources */, + 345B1E911C31DA70009BB77D /* XCTAssertSpec.swift in Sources */, 34D7C47D1BB9C60100E8E523 /* ObjectWithWeakDelegate.m in Sources */, 34D7C4B01BB9C6C400E8E523 /* ObjCHeadersSpec.mm in Sources */, 34D7C49D1BB9C68100E8E523 /* ContainSpec.mm in Sources */, @@ -3897,8 +3903,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 345B1E921C31E644009BB77D /* ExpectFailureWithMessage.mm in Sources */, 34757E261BA4A48E0047BC8D /* TestObservationHelper.m in Sources */, 346D1A971BBB37F400BECD4B /* SpecBundleApplicationTestsWithXCTest.m in Sources */, + 345B1E8F1C31DA6E009BB77D /* XCTAssertSpec.swift in Sources */, 34C95F561C2F16900055F089 /* CDRXCTestSuiteSpec.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -5105,6 +5113,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.pivotallabs.cedar.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Cedar-OSX HostApp.app/Contents/MacOS/Cedar-OSX HostApp"; WRAPPER_EXTENSION = xctest; }; @@ -5137,6 +5146,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.pivotallabs.cedar.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Cedar-OSX HostApp.app/Contents/MacOS/Cedar-OSX HostApp"; WRAPPER_EXTENSION = xctest; }; diff --git a/Source/XCTest/CDRXCTestCase.m b/Source/XCTest/CDRXCTestCase.m index 1f84521b..e156b75f 100644 --- a/Source/XCTest/CDRXCTestCase.m +++ b/Source/XCTest/CDRXCTestCase.m @@ -1,4 +1,5 @@ #import "CDRXCTestCase.h" +#import "CDRExample.h" #import "NSInvocation+CDRXExample.h" #import @@ -43,4 +44,19 @@ + (void)setTestInvocations:(NSArray *)array { objc_setAssociatedObject(self, &CDRXTestInvocationsKey, array, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } +/// This is needed to allow for runtime lookup of the superclass +#define super_recordFailure(description, filename, lineNumber, expected) do { \ +Class parentClass = class_getSuperclass([self class]); \ +IMP superPerformTest = class_getMethodImplementation(parentClass, @selector(recordFailureWithDescription:inFile:atLine:expected:)); \ +((void (*)(id instance, SEL cmd, NSString *, NSString *, NSUInteger, BOOL))superPerformTest)(self, _cmd, description, filename, lineNumber, expected); \ +} while(0); + +- (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filename atLine:(NSUInteger)lineNumber expected:(BOOL)expected { + if (self.invocation.cdr_example.state == CDRExampleStateIncomplete) { + [[CDRSpecFailure specFailureWithReason:description fileName:filename lineNumber:(int)lineNumber] raise]; + } else { + super_recordFailure(description, filename, lineNumber, expected); + } +} + @end diff --git a/Spec/Swift/XCTAssertSpec.swift b/Spec/Swift/XCTAssertSpec.swift new file mode 100644 index 00000000..592cf8fe --- /dev/null +++ b/Spec/Swift/XCTAssertSpec.swift @@ -0,0 +1,18 @@ +import Cedar +import XCTest + +class XCTAssertSpec: CDRSpec { + override func declareBehaviors() { + describe("XCTAssert calls in a Swift Cedar spec") { + it("should allow a passing assertion") { + XCTAssertEqual(1, 1) + } + + it("should allow a failing assertion") { + expectFailureWithMessage("XCTAssertEqual failed: (\"Optional(1)\") is not equal to (\"Optional(2)\") - Failure") { + XCTAssertEqual(1, 2, "Failure") + } + } + } + } +} From 381abb0b9a83a2c833644e937b40bca10ce31b35 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Thu, 7 Jan 2016 21:49:51 -0500 Subject: [PATCH 10/14] Skip building the Swift spec when running rake tasks with Xcode <7.0 --- Spec/Swift/SwiftSpec.swift | 8 ++++++-- scripts/rake/helpers/xcode.rb | 4 ++++ scripts/rake/tasks/spec_suites.rb | 8 ++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Spec/Swift/SwiftSpec.swift b/Spec/Swift/SwiftSpec.swift index 7fda5074..009430de 100644 --- a/Spec/Swift/SwiftSpec.swift +++ b/Spec/Swift/SwiftSpec.swift @@ -1,9 +1,11 @@ import Cedar +#if !EXCLUDE_SWIFT_SPECS + /// A very simple function for making assertions since Cedar provides no /// matchers usable from Swift -private func expectThat(@autoclosure expression: () -> Bool, file: String = __FILE__, line: UInt = __LINE__) { - if !expression() { +private func expectThat(value: Bool, file: String = __FILE__, line: UInt = __LINE__) { + if !value { CDRSpecFailure.specFailureWithReason("Expectation failed", fileName: file, lineNumber: Int32(line)).raise() } } @@ -180,3 +182,5 @@ class SharedExampleGroupPoolForSwiftSpecs: CDRSharedExampleGroupPool { } } } + +#endif diff --git a/scripts/rake/helpers/xcode.rb b/scripts/rake/helpers/xcode.rb index a3c0322b..96884a93 100644 --- a/scripts/rake/helpers/xcode.rb +++ b/scripts/rake/helpers/xcode.rb @@ -23,6 +23,10 @@ def self.destination_for_ios_sdk(version) "name=iPhone 5s,OS=#{version}" end + def self.swift_build_settings + version >= 7.0 ? "" : "OTHER_SWIFT_FLAGS=-DEXCLUDE_SWIFT_SPECS" + end + def self.clean Shell.run "rm -rf '#{BUILD_DIR}'; true", "clean.build.log" Shell.run "rm -rf '#{DERIVED_DATA_DIR}'; true", "clean.derivedData.log" diff --git a/scripts/rake/tasks/spec_suites.rb b/scripts/rake/tasks/spec_suites.rb index e0d1b96e..c13cd49f 100644 --- a/scripts/rake/tasks/spec_suites.rb +++ b/scripts/rake/tasks/spec_suites.rb @@ -13,12 +13,12 @@ namespace :specs do desc "Analyzes specs" task :analyze do - Xcode.analyze(target: SPECS_TARGET_NAME, logfile: "specs.analyze.log") + Xcode.analyze(target: SPECS_TARGET_NAME, args: Xcode.swift_build_settings, logfile: "specs.analyze.log") end desc "Build specs" task build: 'frameworks:osx:build' do - Xcode.build(target: SPECS_TARGET_NAME, logfile: "specs.build.log") + Xcode.build(target: SPECS_TARGET_NAME, args: Xcode.swift_build_settings, logfile: "specs.build.log") end desc "Run specs" @@ -118,12 +118,12 @@ namespace :iosdynamicframeworkspecs do desc "Analyzes ios dynamic framework specs" task :analyze do - Xcode.analyze(target: IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME, sdk: "iphonesimulator#{SDK_VERSION}", args: 'ARCHS=i386', logfile: "frameworks.ios.dynamic.specs.analyze.log") + Xcode.analyze(target: IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME, sdk: "iphonesimulator#{SDK_VERSION}", args: 'ARCHS=i386 '+Xcode.swift_build_settings, logfile: "frameworks.ios.dynamic.specs.analyze.log") end desc "Build iOS dynamic framework specs" task :build do - Xcode.build(target: IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME, sdk: "iphonesimulator#{SDK_VERSION}", args: 'ARCHS=i386', logfile: "frameworks.ios.dynamic.specs.build.log") + Xcode.build(target: IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME, sdk: "iphonesimulator#{SDK_VERSION}", args: 'ARCHS=i386 '+Xcode.swift_build_settings, logfile: "frameworks.ios.dynamic.specs.build.log") end desc "Runs iOS dynamic framework specs" From 1c55a6ffd4989ba96d09f66f3bc945e209e5fe00 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Fri, 8 Jan 2016 10:11:43 -0500 Subject: [PATCH 11/14] Use an NSDictionary subclass as the context for shared example groups This ensures that the context gets bridged into Swift as a reference type instead of a value type. --- Source/CDRSharedExampleGroupPool.m | 2 +- Source/Headers/Public/CDRSharedExampleGroupPool.h | 9 ++++++++- Spec/Swift/SwiftSpec.swift | 10 ++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Source/CDRSharedExampleGroupPool.m b/Source/CDRSharedExampleGroupPool.m index 6dd5d3ff..7bf6b7e5 100644 --- a/Source/CDRSharedExampleGroupPool.m +++ b/Source/CDRSharedExampleGroupPool.m @@ -35,7 +35,7 @@ CDR_OVERLOADABLE void itShouldBehaveLike(NSString *groupName, CDRSharedExampleCo }]; } - sharedExampleGroupBlock([CDRSpecHelper specHelper].sharedExampleContext); + sharedExampleGroupBlock((CDRSharedExampleContext *)[CDRSpecHelper specHelper].sharedExampleContext); CDR_currentSpec.currentGroup = parentGroup; } diff --git a/Source/Headers/Public/CDRSharedExampleGroupPool.h b/Source/Headers/Public/CDRSharedExampleGroupPool.h index 6a07acc8..c7dc39c8 100644 --- a/Source/Headers/Public/CDRSharedExampleGroupPool.h +++ b/Source/Headers/Public/CDRSharedExampleGroupPool.h @@ -8,7 +8,14 @@ NS_ASSUME_NONNULL_BEGIN @protocol CDRSharedExampleGroupPool @end -typedef void (^CDRSharedExampleGroupBlock)(NSDictionary *); +/// A dictionary used to provide context for a set of shared examples. +/// Using this maintains backwards-compatibility with Cedar versions which +/// used a plain dictionary, while preventing the context object from being +/// bridged into Swift as a Swift dictionary, which is a value type. +@interface CDRSharedExampleContext: NSDictionary +@end + +typedef void (^CDRSharedExampleGroupBlock)(CDRSharedExampleContext *); typedef void (^CDRSharedExampleContextProviderBlock)(NSMutableDictionary *); #ifdef __cplusplus diff --git a/Spec/Swift/SwiftSpec.swift b/Spec/Swift/SwiftSpec.swift index 009430de..a7adfe5b 100644 --- a/Spec/Swift/SwiftSpec.swift +++ b/Spec/Swift/SwiftSpec.swift @@ -162,14 +162,8 @@ class SharedExampleGroupPoolForSwiftSpecs: CDRSharedExampleGroupPool { } sharedExamplesFor("a Swift shared example group that receives a value in the context") { context in - - // This doesn't work because the `context` variable is bridged into Swift as a value type - // instead of a reference type. The commented-out line is an alternative way to access - // the values that *does* work, but isn't as pleasant. I believe this could be fixed by - // adding a Swift "overlay" for `sharedExamplesFor` in the Cedar framework. - xit("should receive the values set in the global shared example context") { - expectThat((context["value"] as? String) == globalValue__) -// expectThat((CDRSpecHelper.specHelper().sharedExampleContext["value"] as? String) == globalValue__) + it("should receive the values set in the global shared example context") { + expectThat((context["value"] as? String) == globalValue__) } } From e7bee9b94cd56e02222e6c852c90ce47eb4dd316 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Tue, 12 Jan 2016 09:38:40 -0500 Subject: [PATCH 12/14] Add Xcode code snippets for Cedar BDD constructs in Swift --- .../CodeSnippets/caft-swift.codesnippet | 30 +++++++++++++++++++ .../CodeSnippets/cbef-swift.codesnippet | 30 +++++++++++++++++++ .../CodeSnippets/cbl-swift.codesnippet | 26 ++++++++++++++++ .../CodeSnippets/cblcont-swift.codesnippet | 28 +++++++++++++++++ .../CodeSnippets/ccont-swift.codesnippet | 30 +++++++++++++++++++ .../CodeSnippets/cdesc-swift.codesnippet | 30 +++++++++++++++++++ .../cexpandpend-swift.codesnippet | 30 +++++++++++++++++++ .../CodeSnippets/cit-swift.codesnippet | 30 +++++++++++++++++++ .../CodeSnippets/clog-swift.codesnippet | 26 ++++++++++++++++ .../CodeSnippets/cpend-swift.codesnippet | 28 +++++++++++++++++ .../CodeSnippets/cshare-swift.codesnippet | 30 +++++++++++++++++++ .../CodeSnippets/csubj-swift.codesnippet | 28 +++++++++++++++++ 12 files changed, 346 insertions(+) create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/caft-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/cbef-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/cbl-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/cblcont-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/ccont-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/cdesc-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/cexpandpend-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/cit-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/clog-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/cpend-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/cshare-swift.codesnippet create mode 100644 CodeSnippetsAndTemplates/CodeSnippets/csubj-swift.codesnippet diff --git a/CodeSnippetsAndTemplates/CodeSnippets/caft-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/caft-swift.codesnippet new file mode 100644 index 00000000..0a278f9b --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/caft-swift.codesnippet @@ -0,0 +1,30 @@ + + + + + IDECodeSnippetCompletionPrefix + caft + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + afterEach { + <#content#> +} + IDECodeSnippetIdentifier + 810E8F16-D042-4EAA-A132-AF519E003E6B + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Cedar after each block for Swift + IDECodeSnippetTitle + Cedar after each - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 2 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/cbef-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/cbef-swift.codesnippet new file mode 100644 index 00000000..4f935c3a --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/cbef-swift.codesnippet @@ -0,0 +1,30 @@ + + + + + IDECodeSnippetCompletionPrefix + cbef + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + beforeEach { + <#content#> +} + IDECodeSnippetIdentifier + 33D58ACB-8C55-4ACA-8EAC-02BCE24FCB8D + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Cedar before each block for Swift + IDECodeSnippetTitle + Cedar before each - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 2 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/cbl-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/cbl-swift.codesnippet new file mode 100644 index 00000000..f46ee160 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/cbl-swift.codesnippet @@ -0,0 +1,26 @@ + + + + + IDECodeSnippetCompletionPrefix + cbl + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + itShouldBehaveLike("<#shared behavior description#>") + IDECodeSnippetIdentifier + D1A4AEB6-E079-417E-889D-91A1A0B57DD6 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetTitle + Cedar should behave like - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 0 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/cblcont-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/cblcont-swift.codesnippet new file mode 100644 index 00000000..92144943 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/cblcont-swift.codesnippet @@ -0,0 +1,28 @@ + + + + + IDECodeSnippetCompletionPrefix + cblcont + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + itShouldBehaveLike("<#shared behavior description#>") { context in + context["<#context key#>"] = <#context value#> +} + IDECodeSnippetIdentifier + E1094559-F802-489B-9A79-6F281938B0AE + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetTitle + Cedar should behave like with context - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 0 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/ccont-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/ccont-swift.codesnippet new file mode 100644 index 00000000..27dc9e31 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/ccont-swift.codesnippet @@ -0,0 +1,30 @@ + + + + + IDECodeSnippetCompletionPrefix + ccont + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + context("<#subject under test#>") { + <#content#> +} + IDECodeSnippetIdentifier + 49E13C68-47D4-4A53-BD2F-CC8C0AC5A7B4 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Cedar context block for Swift + IDECodeSnippetTitle + Cedar context - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 2 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/cdesc-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/cdesc-swift.codesnippet new file mode 100644 index 00000000..14a63538 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/cdesc-swift.codesnippet @@ -0,0 +1,30 @@ + + + + + IDECodeSnippetCompletionPrefix + cdesc + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + describe("<#subject under test#>") { + <#content#> +} + IDECodeSnippetIdentifier + D4EF3325-530D-4873-B90E-D40916A16C3D + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Cedar describe block for Swift + IDECodeSnippetTitle + Cedar describe - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 2 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/cexpandpend-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/cexpandpend-swift.codesnippet new file mode 100644 index 00000000..b07e65b3 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/cexpandpend-swift.codesnippet @@ -0,0 +1,30 @@ + + + + + IDECodeSnippetCompletionPrefix + PENDING + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + { + <#content#> +} + IDECodeSnippetIdentifier + 1EFA7973-08CD-4435-97E7-AC63A6195238 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Expand a PENDING block to implement it + IDECodeSnippetTitle + Cedar expand pending - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 2 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/cit-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/cit-swift.codesnippet new file mode 100644 index 00000000..9db787c6 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/cit-swift.codesnippet @@ -0,0 +1,30 @@ + + + + + IDECodeSnippetCompletionPrefix + cit + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + it("should <#expected behavior#>") { + <#content#> +} + IDECodeSnippetIdentifier + 99C76A65-B23F-421B-AA52-D3C46E30BC28 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Cedar example block for Swift + IDECodeSnippetTitle + Cedar example - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 2 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/clog-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/clog-swift.codesnippet new file mode 100644 index 00000000..908e2e36 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/clog-swift.codesnippet @@ -0,0 +1,26 @@ + + + + + IDECodeSnippetCompletionScopes + + All + + IDECodeSnippetContents + print("================>", <#value of interest#>) + IDECodeSnippetIdentifier + 1AC7A9EF-7EA0-4A7F-B5A4-E749A9940618 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Log to console output for Swift + IDECodeSnippetTitle + Console log - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 0 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/cpend-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/cpend-swift.codesnippet new file mode 100644 index 00000000..dc60cba9 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/cpend-swift.codesnippet @@ -0,0 +1,28 @@ + + + + + IDECodeSnippetCompletionPrefix + cpend + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + it("should <#expected behavior#>", PENDING) + IDECodeSnippetIdentifier + 858980E1-6F1F-4165-9501-F05F737D49F3 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Cedar pending example block for Swift + IDECodeSnippetTitle + Cedar pending example - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 2 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/cshare-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/cshare-swift.codesnippet new file mode 100644 index 00000000..61998f34 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/cshare-swift.codesnippet @@ -0,0 +1,30 @@ + + + + + IDECodeSnippetCompletionPrefix + cshare + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + sharedExamplesFor("<#shared behavior description#>") { context in + <#content#> +} + IDECodeSnippetIdentifier + 0E3FC2BE-CAB4-4BA6-B8AF-D676588419B0 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Cedar shared examples for Swift + IDECodeSnippetTitle + Cedar shared example group - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 2 + isCedarSnippet + + + diff --git a/CodeSnippetsAndTemplates/CodeSnippets/csubj-swift.codesnippet b/CodeSnippetsAndTemplates/CodeSnippets/csubj-swift.codesnippet new file mode 100644 index 00000000..667a8a71 --- /dev/null +++ b/CodeSnippetsAndTemplates/CodeSnippets/csubj-swift.codesnippet @@ -0,0 +1,28 @@ + + + + + IDECodeSnippetCompletionPrefix + csubj + IDECodeSnippetCompletionScopes + + CodeExpression + + IDECodeSnippetContents + subjectAction { <#action#> } + IDECodeSnippetIdentifier + E3B41D04-9235-4952-854C-C6851F5213A5 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetSummary + Cedar subject action block for Swift + IDECodeSnippetTitle + Cedar subject action - Swift + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 0 + isCedarSnippet + + + From 4ca3f308c6df2fb4bf88888d0c0368a510c56292 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Wed, 13 Jan 2016 15:55:17 -0500 Subject: [PATCH 13/14] Update the Cedar spec template to allow generating Swift specs --- .../___FILEBASENAME___Spec.mm | 0 .../Swift/___FILEBASENAME___Spec.swift | 11 ++ .../Cedar Spec.xctemplate/TemplateInfo.plist | 108 +++++++++++------- 3 files changed, 77 insertions(+), 42 deletions(-) rename CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/{ => Objective-C++}/___FILEBASENAME___Spec.mm (100%) create mode 100644 CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/Swift/___FILEBASENAME___Spec.swift diff --git a/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/___FILEBASENAME___Spec.mm b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/Objective-C++/___FILEBASENAME___Spec.mm similarity index 100% rename from CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/___FILEBASENAME___Spec.mm rename to CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/Objective-C++/___FILEBASENAME___Spec.mm diff --git a/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/Swift/___FILEBASENAME___Spec.swift b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/Swift/___FILEBASENAME___Spec.swift new file mode 100644 index 00000000..4f137afe --- /dev/null +++ b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/Swift/___FILEBASENAME___Spec.swift @@ -0,0 +1,11 @@ +import Cedar + +class ___VARIABLE_cedarClass:identifier___Spec: CDRSpec { + override func declareBehaviors() { + var <#object under test#>: ___VARIABLE_cedarClass:identifier___! + + beforeEach { + + } + } +} diff --git a/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateInfo.plist b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateInfo.plist index a662aaea..d344b1a0 100644 --- a/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateInfo.plist +++ b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateInfo.plist @@ -2,55 +2,79 @@ - AllowedTypes - - public.objective-c-plus-plus-source - - DefaultCompletionName - MyClass + isCedarTemplate + + Summary + A Cedar Spec Description A Cedar Spec File Kind Xcode.IDEKit.TextSubstitutionFileTemplateKind - MainTemplateFile - ___FILEBASENAME___Spec.mm + SortOrder + 1 + DefaultCompletionName + MyClass Options - Default - - Description - The name of the class to spec - Identifier - cedarClass - Name - Class to Spec - Required - - NotPersisted - - Type - text - - - Default - ___VARIABLE_cedarClass:identifier___ - Identifier - productName - Type - static - - - Platforms - - com.apple.platform.iphoneos - com.apple.platform.macosx + Description + The name of the type to spec + Identifier + cedarClass + Name + Type to Spec: + Required + + NotPersisted + + Type + text + + + AllowedTypes + + Swift + + public.swift-source + + Objective-C++ + + public.objective-c-plus-plus-source + + + Default + Objective-C++ + Description + The implementation language + Identifier + languageChoice + MainTemplateFiles + + Objective-C + ___FILEBASENAME___Spec.mm + Swift + ___FILEBASENAME___Spec.swift + + Name + Language: + Required + Yes + Type + popup + Values + + Objective-C++ + Swift + + + + Default + ___VARIABLE_cedarClass:identifier___ + Identifier + productName + Type + static + - SortOrder - 1 - Summary - A Cedar Spec - isCedarTemplate - From d5c9b4b5c722f147dbdac8b731145c9df17b3334 Mon Sep 17 00:00:00 2001 From: Brian Croom Date: Wed, 13 Jan 2016 15:56:00 -0500 Subject: [PATCH 14/14] Use a modernized style for the spec template icon, and remove ".mm" --- .../Cedar Spec.xctemplate/TemplateIcon.icns | Bin 51814 -> 0 bytes .../Cedar Spec.xctemplate/TemplateIcon.png | Bin 0 -> 4898 bytes .../Cedar Spec.xctemplate/TemplateIcon@2x.png | Bin 0 -> 7212 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon.icns create mode 100644 CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon.png create mode 100644 CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon@2x.png diff --git a/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon.icns b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon.icns deleted file mode 100644 index 72693fb214aa444c08cef3f66c796da8efd3f1c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 51814 zcmeIb2Y3`mnm68)Bw+zIw(;7V*Y|zi``_Jq!)@?pBYT~_#tE>ojU&P&+vH$ik^<5w zAb});00{&_WC;PvIp>_SCg+@|{%>{9C`(9Qc=UXCG>xXZ-~3ipSJ(Wiq%S|)yp|RDcnG(&dg*kEzHbtLRt4VRK@Z;LEK9Er)=n%dEoSz>jE zZ9|gcf^Os>!|p|wzvS$x3;udXoDrCNUEIihp@%p@5&Ll1!{<-tUQWM$H7)BLgw5!; z+pJvMqgJOo@GV=nY{locIYbT>-Z7@a)nZD%|cZfHJm`~>f|(Np23 zz}6!>gdCxfs&MmA#L)WHEeU1Lk;nxZySJu=ciYGcH@XS}%B!N!x~Ryl7SwPwCJ)&h zxWWfeduDZ&ygs*}L4_|}g%x?lW%(uL1q!$nbv6%n^>%mn^mhQ2)^Fuo9x&UfxOZ;b z&f7*-_ts}NZ6FAm51m+>aw_rc*>g$%PA~`p{$D^2gpd<;`~=@%5a*E90f!BB{e+;y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F1=d;01Ur(EaxwucINMhbjSjM`YHeh zWDaZdnSF=z9OWMwImLn4cVtUk<(tnJ2;E99Kr~)^WN+O5yn<*fYT8EYu7x&~C zB4*{UR$X+Ik4oW*-?g$t+4b{I|JlnYZ_l4OB)L&&?6)TH!9Vr^P;~Yf*&`;A*`pt8 zpW97Eby>{HKQ?AM0)bm{^Wo_~Qdo3=oa{L)n7V>4{vHhOGyJylWuIY3d~5Wu@yWG7 z-;6=@=#mM*p^tVt?ODABFk@Ds zKfc{L*}pw-OmYDLW>0$2IXMq~wEN40OiAPCi+{~yW2Q4dXL-z+XLDZV;gLTech;L^ zbjxzu4;K}1GjI)nnJrHCqydZ?`Y=QLjs)Q7X9xNF=SRM*wz}QJoXN}Lj$1Hw1;g(h z>wN!r*{A&BFZlrU={1l?Tb%4k0|0pW>9$?^@N_J1rVD_XJ+jYcqmrn8i@$FRAUUigTx9B~3cFnxg z+l~8yGC)sQNhyTDFm*N;tc(e(5)$_hdXRp-hmhiyu`H8ow=Qx1^68kGAgkvzTv@G?!1$9i!m*4w@phZhNB0UY>elX{&7ZYXykPg^JJlXYpStuev}@unNrx z_=c}d02lw`@_!2;BIf$0h~C!g^^|r1>Lp1U4Rq~j z(w9Infgrd45EplQkVP%y0eq2byDyiLB%;|)2uH5=-2y}vc7ILEw}h~o-N(p(0FRGR UiqQQbTL1t607*qoM6N<$g7A}3(EtDd literal 0 HcmV?d00001 diff --git a/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon@2x.png b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..7f3d436ff5a59a74794c142a53985e7b08fb5d61 GIT binary patch literal 7212 zcmV+{9Mj{8P)4Tx07%E3mUmQC*A|D*y?1({%`gH|hTglt0MdJtUPWP;8DJ;_4l^{dA)*2i zMMRn+NKnLp(NH8-M6nPQRImpm2q-ZaMN}+rM%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