Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated recordFailureWithDescription with recordIssue #202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
77 changes: 67 additions & 10 deletions Expecta.xcodeproj/project.pbxproj
Expand Up @@ -3,10 +3,14 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
0E633CEF2BD0324D00346690 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E633CEE2BD0324D00346690 /* XCTest.framework */; };
0E633CF32BD0325500346690 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E633CF22BD0325500346690 /* XCTest.framework */; platformFilter = ios; };
0E633CF62BD03D2C00346690 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E633CEE2BD0324D00346690 /* XCTest.framework */; };
0E633CF72BD03D3500346690 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E633CF22BD0325500346690 /* XCTest.framework */; platformFilter = ios; };
1137E3F6805E8DD7599ADCA8 /* EXPMatchers+beSupersetOfTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C6B1F5180CAD5100E13146 /* EXPMatchers+beSupersetOfTest.m */; };
1137E875D17A9C593D6C71C3 /* EXPMatchers+beSupersetOfTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C6B1F5180CAD5100E13146 /* EXPMatchers+beSupersetOfTest.m */; };
2546A95C16629D500078E044 /* EXPMatchers+raiseWithReason.h in Headers */ = {isa = PBXBuildFile; fileRef = 2546A95A16629D4F0078E044 /* EXPMatchers+raiseWithReason.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -490,6 +494,8 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0E633CEE2BD0324D00346690 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
0E633CF22BD0325500346690 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
2546A95A16629D4F0078E044 /* EXPMatchers+raiseWithReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "EXPMatchers+raiseWithReason.h"; sourceTree = "<group>"; };
2546A95B16629D4F0078E044 /* EXPMatchers+raiseWithReason.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "EXPMatchers+raiseWithReason.m"; sourceTree = "<group>"; };
2546A96116629DF70078E044 /* EXPMatchers+raiseWithReasonTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "EXPMatchers+raiseWithReasonTest.m"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -637,13 +643,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0E633CF32BD0325500346690 /* XCTest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
908379751A8B972C009844DA /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0E633CEF2BD0324D00346690 /* XCTest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -659,6 +667,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0E633CF72BD03D3500346690 /* XCTest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -674,12 +683,22 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0E633CF62BD03D2C00346690 /* XCTest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
0E633CED2BD0324D00346690 /* Frameworks */ = {
isa = PBXGroup;
children = (
0E633CF22BD0325500346690 /* XCTest.framework */,
0E633CEE2BD0324D00346690 /* XCTest.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
908379E41A8B9EE1009844DA /* Support */ = {
isa = PBXGroup;
children = (
Expand All @@ -694,6 +713,7 @@
E9ACDF3C13B2DDB00010F4D7 /* Expecta */,
E9ACDF7213B2DEB70010F4D7 /* Tests */,
E9ACDF0D13B2DD520010F4D7 /* Products */,
0E633CED2BD0324D00346690 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -1232,6 +1252,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = E9ACDF0113B2DD520010F4D7;
Expand Down Expand Up @@ -1737,7 +1758,11 @@
GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch";
INFOPLIST_FILE = "Tests/Support/Test-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
Expand All @@ -1758,7 +1783,11 @@
GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch";
INFOPLIST_FILE = "Tests/Support/Test-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
Expand All @@ -1779,7 +1808,11 @@
GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch";
INFOPLIST_FILE = "Tests/Support/Test-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
Expand Down Expand Up @@ -1807,7 +1840,11 @@
INFOPLIST_FILE = "$(SRCROOT)/Expecta/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.raingrove.expecta.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Expecta;
SDKROOT = iphoneos;
Expand All @@ -1830,7 +1867,11 @@
INFOPLIST_FILE = "$(SRCROOT)/Expecta/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.raingrove.expecta.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Expecta;
SDKROOT = iphoneos;
Expand All @@ -1853,7 +1894,11 @@
INFOPLIST_FILE = "$(SRCROOT)/Expecta/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.raingrove.expecta.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Expecta;
SDKROOT = iphoneos;
Expand All @@ -1876,7 +1921,11 @@
INFOPLIST_FILE = "$(SRCROOT)/Expecta/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = "com.raingrove.expecta.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Expecta;
Expand All @@ -1899,7 +1948,11 @@
INFOPLIST_FILE = "$(SRCROOT)/Expecta/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = "com.raingrove.expecta.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Expecta;
Expand All @@ -1922,7 +1975,11 @@
INFOPLIST_FILE = "$(SRCROOT)/Expecta/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = "com.raingrove.expecta.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Expecta;
Expand Down
22 changes: 9 additions & 13 deletions Expecta.xcodeproj/xcshareddata/xcschemes/Expecta-iOS.xcscheme
Expand Up @@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "908379101A8B9660009844DA"
BuildableName = "Expecta.framework"
BlueprintName = "Expecta-iOS"
ReferencedContainer = "container:Expecta.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "908379101A8B9660009844DA"
BuildableName = "Expecta.framework"
BlueprintName = "Expecta-iOS"
ReferencedContainer = "container:Expecta.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -70,8 +68,6 @@
ReferencedContainer = "container:Expecta.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
22 changes: 9 additions & 13 deletions Expecta.xcodeproj/xcshareddata/xcschemes/Expecta.xcscheme
Expand Up @@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "908379781A8B972C009844DA"
BuildableName = "Expecta.framework"
BlueprintName = "Expecta"
ReferencedContainer = "container:Expecta.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "908379781A8B972C009844DA"
BuildableName = "Expecta.framework"
BlueprintName = "Expecta"
ReferencedContainer = "container:Expecta.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -70,8 +68,6 @@
ReferencedContainer = "container:Expecta.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
22 changes: 9 additions & 13 deletions Expecta.xcodeproj/xcshareddata/xcschemes/libExpecta.xcscheme
Expand Up @@ -41,6 +41,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E9ACDF0B13B2DD520010F4D7"
BuildableName = "libExpecta.a"
BlueprintName = "libExpecta"
ReferencedContainer = "container:Expecta.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -53,17 +62,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E9ACDF0B13B2DD520010F4D7"
BuildableName = "libExpecta.a"
BlueprintName = "libExpecta"
ReferencedContainer = "container:Expecta.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -84,8 +82,6 @@
ReferencedContainer = "container:Expecta.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
22 changes: 17 additions & 5 deletions Expecta/ExpectaSupport.m
Expand Up @@ -6,11 +6,13 @@
#import "EXPDoubleTuple.h"
#import "EXPDefines.h"
#import <objc/runtime.h>
#import <XCTest/XCTest.h>

@interface NSObject (ExpectaXCTestRecordFailure)

// suppress warning
- (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filename atLine:(NSUInteger)lineNumber expected:(BOOL)expected;
- (void)recordIssue:(XCTIssue *)issue;

@end

Expand Down Expand Up @@ -107,11 +109,21 @@ void EXPFail(id testCase, int lineNumber, const char *fileName, NSString *messag
NSString *reason = [NSString stringWithFormat:@"%s:%d %@", fileName, lineNumber, message];
NSException *exception = [NSException exceptionWithName:@"Expecta Error" reason:reason userInfo:nil];

if(testCase && [testCase respondsToSelector:@selector(recordFailureWithDescription:inFile:atLine:expected:)]){
[testCase recordFailureWithDescription:message
inFile:@(fileName)
atLine:lineNumber
expected:NO];
if(testCase && [testCase respondsToSelector:@selector(recordIssue:)]) {
XCTSourceCodeLocation *location = [[XCTSourceCodeLocation alloc] initWithFilePath:@(fileName) lineNumber:lineNumber];
XCTSourceCodeContext *context = [[XCTSourceCodeContext alloc] initWithLocation:location];
XCTIssue *issue = [[XCTIssue alloc] initWithType:XCTIssueTypeAssertionFailure
compactDescription:message
detailedDescription:nil
sourceCodeContext:context
associatedError:nil
attachments:@[]];
[testCase recordIssue:issue];
} else if(testCase && [testCase respondsToSelector:@selector(recordFailureWithDescription:inFile:atLine:expected:)]){
[testCase recordFailureWithDescription:message
inFile:@(fileName)
atLine:lineNumber
expected:NO];
} else {
[exception raise];
}
Expand Down