diff --git a/Cedar.xcodeproj/project.pbxproj b/Cedar.xcodeproj/project.pbxproj index f3c18e72..fc726b18 100644 --- a/Cedar.xcodeproj/project.pbxproj +++ b/Cedar.xcodeproj/project.pbxproj @@ -70,6 +70,11 @@ 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 */; }; + 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 */; }; @@ -267,6 +272,13 @@ 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 */; }; + 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 */; }; @@ -436,7 +448,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 */; }; @@ -485,6 +497,17 @@ 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, ); }; }; + 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 */; }; @@ -740,7 +763,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 */; }; @@ -1270,6 +1293,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 */, @@ -1318,6 +1342,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 +1350,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 */, @@ -1367,6 +1393,8 @@ 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 = ""; }; + 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; }; @@ -1399,12 +1427,15 @@ 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 = ""; }; 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 = ""; }; 34F3DF811A6ABB21003041DA /* CDRNilSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDRNilSpec.mm; sourceTree = ""; }; @@ -1481,7 +1512,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 = ""; }; @@ -1778,6 +1809,7 @@ 96EA1CAC142C6449001A78E0 /* CDROTestReporter.h */, 42064465139B44EC00C85605 /* CDRTeamCityReporter.h */, 1FF449B318A0C04D00AF94B0 /* CDRBufferedDefaultReporter.h */, + 34DB674F1C2B8C1000206663 /* CedarReporters.h */, ); path = Reporters; sourceTree = ""; @@ -1805,6 +1837,7 @@ AEEE1FCF11DC27B800029872 /* CDRExampleParent.h */, AEEE1FD111DC27B800029872 /* CDRFunctions.h */, 2234907C18009DA6001C8E8D /* CDRHooks.h */, + 34C95F4F1C2DD7B30055F089 /* CDRNullabilityCompat.h */, AEFD17B311DD1E8200F4448A /* CDRSharedExampleGroupPool.h */, AEEE1FD211DC27B800029872 /* CDRSpec.h */, AE8C880E13626FA5006C9305 /* CDRSpecFailure.h */, @@ -1919,6 +1952,16 @@ path = iOS; sourceTree = ""; }; + 34DB67471C2B4CBA00206663 /* Swift */ = { + isa = PBXGroup; + children = ( + 34DB67481C2B4D6A00206663 /* SwiftSpec.swift */, + 345B1E8D1C31DA2B009BB77D /* XCTAssertSpec.swift */, + 345B1E881C31CC96009BB77D /* Spec-Bridging-Header.h */, + ); + path = Swift; + sourceTree = ""; + }; 4523FFB9BD607306C7ED94A3 /* GData */ = { isa = PBXGroup; children = ( @@ -2103,7 +2146,7 @@ AE34723F19C2257A005CA6F1 /* XCTest */ = { isa = PBXGroup; children = ( - AE34724019C2259B005CA6F1 /* CDRXTestSuiteSpec.mm */, + AE34724019C2259B005CA6F1 /* CDRXCTestSuiteSpec.mm */, ); path = XCTest; sourceTree = ""; @@ -2282,8 +2325,10 @@ 346D1A981BBB389A00BECD4B /* SpecBundle-Info.plist */, 1F45A3E2180E4A1C003C1E36 /* SpecBundleApplicationTestsWithXCTest.m */, 96D34483144A845100352C4A /* SpecBundleApplicationTests.mm */, + 34DB67471C2B4CBA00206663 /* Swift */, E328612E1604F254001FA77E /* Support */, 346262791B99C1DB002CAEBD /* watchOS */, + AE34723F19C2257A005CA6F1 /* XCTest */, AEEE1FE811DC27B800029872 /* CDRExampleGroupSpec.mm */, AEEE1FE911DC27B800029872 /* CDRExampleSpec.mm */, 34F3DF811A6ABB21003041DA /* CDRNilSpec.mm */, @@ -2303,7 +2348,6 @@ AEEE1FEB11DC27B800029872 /* iOS */ = { isa = PBXGroup; children = ( - AE34723F19C2257A005CA6F1 /* XCTest */, AE02E83018526E9F00414F19 /* Cedar-iOSSpec.mm */, AE7DD11117296CB20058EB3B /* CedarApplicationDelegateSpec.mm */, 228F3FA617E3ECD10000C8AF /* CDRSpyiOSSpec.mm */, @@ -2517,6 +2561,8 @@ 346262411B9954C1002CAEBD /* CDRSpecHelper.h in Headers */, 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 */, @@ -2543,6 +2589,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 +2636,12 @@ 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 */, 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 +2739,12 @@ 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 */, 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 +2866,8 @@ AE0721E3187518FD0031CC42 /* Exist.h in Headers */, 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 */, @@ -2839,6 +2894,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 */, @@ -3182,6 +3238,7 @@ AEEE1FA611DC26EA00029872 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 0720; LastTestingUpgradeCheck = 0700; LastUpgradeCheck = 0720; ORGANIZATIONNAME = Pivotal; @@ -3452,7 +3509,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 */, @@ -3576,6 +3633,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 */, @@ -3656,6 +3714,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 */, @@ -3704,7 +3763,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 */, @@ -3715,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 */, @@ -3811,6 +3871,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 */, @@ -3842,8 +3903,11 @@ 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; }; @@ -3969,6 +4033,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 */, @@ -4425,6 +4490,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; }; @@ -4455,6 +4521,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; @@ -4470,6 +4537,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 = ( @@ -4500,6 +4568,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; @@ -4664,6 +4733,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; }; @@ -4694,6 +4764,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; @@ -4904,6 +4975,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; @@ -4946,6 +5018,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; }; @@ -5040,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; }; @@ -5072,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; }; @@ -5241,8 +5316,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"; @@ -5271,9 +5348,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"; @@ -5301,6 +5380,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -5315,7 +5395,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", @@ -5323,6 +5404,8 @@ "-lxml2", ); PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Spec/Swift/Spec-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; @@ -5330,6 +5413,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 = ( @@ -5344,7 +5428,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", @@ -5352,6 +5437,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/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 + + + 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/TemplateIcon.icns b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon.icns deleted file mode 100644 index 72693fb2..00000000 Binary files a/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon.icns and /dev/null differ diff --git a/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon.png b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon.png new file mode 100644 index 00000000..0d8f5ceb Binary files /dev/null and b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon.png differ 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 00000000..7f3d436f Binary files /dev/null and b/CodeSnippetsAndTemplates/Templates/File Templates/Cedar/Cedar Spec.xctemplate/TemplateIcon@2x.png differ 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 - 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/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..c7dc39c8 100644 --- a/Source/Headers/Public/CDRSharedExampleGroupPool.h +++ b/Source/Headers/Public/CDRSharedExampleGroupPool.h @@ -1,11 +1,21 @@ #import +#import "CDRNullabilityCompat.h" + +NS_ASSUME_NONNULL_BEGIN #define CDR_OVERLOADABLE __attribute__((overloadable)) @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 @@ -13,7 +23,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 +44,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 13206e5d..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,31 +19,24 @@ 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 } - -#import "ActualValue.h" -#import "ShouldSyntax.h" -#import "CedarComparators.h" -#import "CedarMatchers.h" -#import "CedarDoubles.h" - -#endif // __cplusplus +#endif @interface CDRSpec : NSObject { CDRExampleGroup *rootGroup_; @@ -50,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; @@ -76,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 69bddb71..540914cb 100644 --- a/Source/Headers/Public/CDRSpecHelper.h +++ b/Source/Headers/Public/CDRSpecHelper.h @@ -1,8 +1,15 @@ #import "CDRSpec.h" +#import "CDRNullabilityCompat.h" #import "CDRHooks.h" #import "CDRSharedExampleGroupPool.h" #import "CDRExampleParent.h" +#ifndef NS_SWIFT_NAME +#define NS_SWIFT_NAME(_name) +#endif + +NS_ASSUME_NONNULL_BEGIN + @interface CDRSpecHelper : NSObject { NSMutableDictionary *sharedExampleContext_, *sharedExampleGroups_; NSArray *globalBeforeEachClasses_, *globalAfterEachClasses_; @@ -14,8 +21,14 @@ @property (nonatomic, assign) BOOL shouldOnlyRunFocused; -+ (CDRSpecHelper *)specHelper; ++ (CDRSpecHelper *)specHelper NS_SWIFT_NAME(specHelper()); @end @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/Cedar.h b/Source/Headers/Public/Cedar.h index 8452f0ee..a8a4adae 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" @@ -21,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/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..f30e7ac3 100644 --- a/Source/Headers/Public/Doubles/CDRClassFake.h +++ b/Source/Headers/Public/Doubles/CDRClassFake.h @@ -1,9 +1,18 @@ #import +#import "CDRNullabilityCompat.h" #import "CDRFake.h" #import "CedarDouble.h" +NS_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus + @interface CDRClassFake : CDRFake @end 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 22fdf6b5..6f8c6c46 100644 --- a/Source/Headers/Public/Doubles/CDRFake.h +++ b/Source/Headers/Public/Doubles/CDRFake.h @@ -1,6 +1,11 @@ #import +#import "CDRNullabilityCompat.h" #import "CedarDouble.h" +NS_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus + @interface CDRFake : NSObject @property (nonatomic, assign) Class klass; @@ -14,3 +19,7 @@ #define fake_for(...) CDR_fake_for(YES, __VA_ARGS__, nil) #define nice_fake_for(...) CDR_fake_for(NO, __VA_ARGS__, nil) #endif + +#endif // __cplusplus + +NS_ASSUME_NONNULL_END diff --git a/Source/Headers/Public/Doubles/CDRProtocolFake.h b/Source/Headers/Public/Doubles/CDRProtocolFake.h index f7267d44..38bb4640 100644 --- a/Source/Headers/Public/Doubles/CDRProtocolFake.h +++ b/Source/Headers/Public/Doubles/CDRProtocolFake.h @@ -1,10 +1,15 @@ #import +#import "CDRNullabilityCompat.h" #import "CedarDouble.h" #import "CDRFake.h" +#ifdef __cplusplus + #import #import +NS_ASSUME_NONNULL_BEGIN + @interface CDRProtocolFake : CDRFake - (id)initWithClass:(Class)klass forProtocols:(NSArray *)protocols requireExplicitStubs:(BOOL)requireExplicitStubs; @@ -12,3 +17,8 @@ @end 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 2d9f08f8..7fe328dc 100644 --- a/Source/Headers/Public/Doubles/CDRSpy.h +++ b/Source/Headers/Public/Doubles/CDRSpy.h @@ -1,6 +1,11 @@ #import +#import "CDRNullabilityCompat.h" #import "CedarDouble.h" +NS_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus + @interface CDRSpy : NSProxy + (void)interceptMessagesForInstance:(id)instance; @@ -22,3 +27,7 @@ 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 + +NS_ASSUME_NONNULL_END 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/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/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/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/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/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/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 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/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" 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/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..ff8ec79c 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; @@ -129,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", ^{ @@ -433,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", ^{ 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.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/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/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..a7adfe5b --- /dev/null +++ b/Spec/Swift/SwiftSpec.swift @@ -0,0 +1,180 @@ +import Cedar + +#if !EXCLUDE_SWIFT_SPECS + +/// A very simple function for making assertions since Cedar provides no +/// matchers usable from Swift +private func expectThat(value: Bool, file: String = __FILE__, line: UInt = __LINE__) { + if !value { + 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 + it("should receive the values set in the global shared example context") { + expectThat((context["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") + } + } + } + } +} + +#endif 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") + } + } + } + } +} 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 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" 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"