Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 17 additions & 32 deletions momdec.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
EE22DD4117166355007FE629 /* NSFetchRequest+xmlElement.m in Sources */ = {isa = PBXBuildFile; fileRef = EE22DD4017166355007FE629 /* NSFetchRequest+xmlElement.m */; };
EE22DD4217166355007FE629 /* NSFetchRequest+xmlElement.m in Sources */ = {isa = PBXBuildFile; fileRef = EE22DD4017166355007FE629 /* NSFetchRequest+xmlElement.m */; };
EE7EC7951714BB6D00A1901C /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE7EC7941714BB6D00A1901C /* SenTestingKit.framework */; };
EE7EC7971714BB6D00A1901C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE7EC7961714BB6D00A1901C /* Cocoa.framework */; };
EE7EC7A11714BB6D00A1901C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EE7EC79F1714BB6D00A1901C /* InfoPlist.strings */; };
EE7EC7A41714BB6D00A1901C /* momdecTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EE7EC7A31714BB6D00A1901C /* momdecTests.m */; };
Expand Down Expand Up @@ -61,8 +60,7 @@
EE22DD3F17166355007FE629 /* NSFetchRequest+xmlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFetchRequest+xmlElement.h"; sourceTree = "<group>"; };
EE22DD4017166355007FE629 /* NSFetchRequest+xmlElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFetchRequest+xmlElement.m"; sourceTree = "<group>"; };
EE2760C717121F7C0023821E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.md; sourceTree = SOURCE_ROOT; };
EE7EC7931714BB6D00A1901C /* momdecTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = momdecTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
EE7EC7941714BB6D00A1901C /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
EE7EC7931714BB6D00A1901C /* momdecTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = momdecTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
EE7EC7961714BB6D00A1901C /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; };
EE7EC7991714BB6D00A1901C /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
EE7EC79A1714BB6D00A1901C /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -100,7 +98,6 @@
buildActionMask = 2147483647;
files = (
EE7EC7AE1714BC1C00A1901C /* CoreData.framework in Frameworks */,
EE7EC7951714BB6D00A1901C /* SenTestingKit.framework in Frameworks */,
EE7EC7971714BB6D00A1901C /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -162,7 +159,7 @@
isa = PBXGroup;
children = (
EEE16BAA1710D68900F6AF6B /* momdec */,
EE7EC7931714BB6D00A1901C /* momdecTests.octest */,
EE7EC7931714BB6D00A1901C /* momdecTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand All @@ -172,7 +169,6 @@
children = (
EEE16BBB1710D6A300F6AF6B /* CoreData.framework */,
EEE16BAD1710D68900F6AF6B /* Foundation.framework */,
EE7EC7941714BB6D00A1901C /* SenTestingKit.framework */,
EE7EC7961714BB6D00A1901C /* Cocoa.framework */,
EE7EC7981714BB6D00A1901C /* Other Frameworks */,
);
Expand Down Expand Up @@ -223,7 +219,6 @@
EE7EC78E1714BB6D00A1901C /* Sources */,
EE7EC78F1714BB6D00A1901C /* Frameworks */,
EE7EC7901714BB6D00A1901C /* Resources */,
EE7EC7911714BB6D00A1901C /* ShellScript */,
EE7EC7AF1714BC3800A1901C /* CopyFiles */,
);
buildRules = (
Expand All @@ -232,8 +227,8 @@
);
name = momdecTests;
productName = momdecTests;
productReference = EE7EC7931714BB6D00A1901C /* momdecTests.octest */;
productType = "com.apple.product-type.bundle";
productReference = EE7EC7931714BB6D00A1901C /* momdecTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
EEE16BA91710D68900F6AF6B /* momdec */ = {
isa = PBXNativeTarget;
Expand All @@ -258,7 +253,8 @@
EEE16BA21710D68900F6AF6B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0460;
LastTestingUpgradeCheck = 0720;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "Tom Harrington";
};
buildConfigurationList = EEE16BA51710D68900F6AF6B /* Build configuration list for PBXProject "momdec" */;
Expand Down Expand Up @@ -290,22 +286,6 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
EE7EC7911714BB6D00A1901C /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
EE7EC78E1714BB6D00A1901C /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -356,33 +336,38 @@
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"";
FRAMEWORK_SEARCH_PATHS = (
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
"$(inherited)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "momdecTests/momdecTests-Prefix.pch";
INFOPLIST_FILE = "momdecTests/momdecTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.atomicbird.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = octest;
};
name = Debug;
};
EE7EC7A71714BB6D00A1901C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"";
FRAMEWORK_SEARCH_PATHS = (
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
"$(inherited)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "momdecTests/momdecTests-Prefix.pch";
INFOPLIST_FILE = "momdecTests/momdecTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.atomicbird.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = octest;
};
name = Release;
};
EEE16BB61710D68A00F6AF6B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
Expand All @@ -392,6 +377,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
Expand All @@ -415,7 +401,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down
19 changes: 12 additions & 7 deletions momdec.xcodeproj/xcshareddata/xcschemes/momdec.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -23,10 +23,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -48,17 +48,21 @@
ReferencedContainer = "container:momdec.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEE16BA91710D68900F6AF6B"
Expand All @@ -71,12 +75,13 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEE16BA91710D68900F6AF6B"
Expand Down
13 changes: 8 additions & 5 deletions momdec.xcodeproj/xcshareddata/xcschemes/momdecTests.xcscheme
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -23,24 +23,27 @@
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
Expand Down
2 changes: 1 addition & 1 deletion momdec/NSFetchRequest+xmlElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ - (NSXMLElement *)xmlElement
// The following will have no effect on models compiled with Xcode until rdar://problem/13863607 is fixed,
// because these attributes get stripped out at compile time.
// Also see http://www.openradar.me/radar?id=3009404
NSString *resultTypeString = [NSString stringWithFormat:@"%d", NSManagedObjectResultType];
NSString *resultTypeString = [NSString stringWithFormat:@"%luu",(unsigned long) (unsigned long)NSManagedObjectResultType];
[element addAttribute:[NSXMLNode attributeWithName:@"resultType" stringValue:resultTypeString]];

NSString *fetchLimitString = [NSString stringWithFormat:@"%ld", (unsigned long)[self fetchLimit]];
Expand Down
2 changes: 1 addition & 1 deletion momdecTests/momdecTests-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.atomicbird.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down
4 changes: 2 additions & 2 deletions momdecTests/momdecTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// Copyright (c) 2013 Tom Harrington. All rights reserved.
//

#import <SenTestingKit/SenTestingKit.h>
#import <XCTest/XCTest.h>

@interface momdecTests : SenTestCase
@interface momdecTests : XCTestCase

@end
14 changes: 7 additions & 7 deletions momdecTests/momdecTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ - (void)testDecompile
[[NSFileManager defaultManager] createDirectoryAtPath:momdecTestDir withIntermediateDirectories:YES attributes:0 error:nil];
NSError *error = nil;
NSString *decompiledModelContainerPath = [NSManagedObjectModel decompileModelAtPath:[momURL path] inDirectory:momdecTestDir error:&error];
STAssertNil(error, [NSString stringWithFormat:@"Error decompiling model: %@", error]);
STAssertTrue(([decompiledModelContainerPath length] > 0), @"Zero-length path after decompiling model");
XCTAssertNil(error, @"Error decompiling model: %@", error);
XCTAssertTrue(([decompiledModelContainerPath length] > 0), @"Zero-length path after decompiling model");

// Compile the temporary file copy
NSString *recompiledModelPath = [momdecTestDir stringByAppendingPathComponent:@"momdecTests.momd"];
NSTask *compileTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/xcrun" arguments:@[@"momc", decompiledModelContainerPath, recompiledModelPath]];
[compileTask waitUntilExit];
STAssertEquals([compileTask terminationStatus], 0, @"xcrun failed to compile the model, try running 'xcrun momc' in Terminal.app and trying again");
XCTAssertEqual([compileTask terminationStatus], 0, @"xcrun failed to compile the model, try running 'xcrun momc' in Terminal.app and trying again");

// Load the recompiled model
NSManagedObjectModel *recompiledModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:[NSURL fileURLWithPath:recompiledModelPath]];
Expand All @@ -58,20 +58,20 @@ - (void)testDecompile
for (NSString *entityName in originalEntities) {
NSEntityDescription *originalEntity = originalEntities[entityName];
NSEntityDescription *recompiledEntity = recompiledEntities[entityName];
STAssertEqualObjects(originalEntity, recompiledEntity, @"Entities do not match: %@", entityName);
XCTAssertEqualObjects(originalEntity, recompiledEntity, @"Entities do not match: %@", entityName);
}

NSDictionary *originalFetchRequests = [compiledModel fetchRequestTemplatesByName];
NSDictionary *recompiledFetchRequests = [recompiledModel fetchRequestTemplatesByName];
for (NSString *fetchRequestName in originalFetchRequests) {
NSFetchRequest *originalFetchRequest = originalFetchRequests[fetchRequestName];
NSFetchRequest *recompiledFetchRequest = recompiledFetchRequests[fetchRequestName];
STAssertEqualObjects(originalFetchRequest, recompiledFetchRequest, @"Fetch requests do not match: %@", fetchRequestName);
XCTAssertEqualObjects(originalFetchRequest, recompiledFetchRequest, @"Fetch requests do not match: %@", fetchRequestName);
}

NSArray *originalConfigurations = [compiledModel configurations];
for (NSString *configurationName in originalConfigurations) {
STAssertEqualObjects([compiledModel entitiesForConfiguration:configurationName], [recompiledModel entitiesForConfiguration:configurationName], @"Configuration does not match: %@", configurationName);
XCTAssertEqualObjects([compiledModel entitiesForConfiguration:configurationName], [recompiledModel entitiesForConfiguration:configurationName], @"Configuration does not match: %@", configurationName);
}
}

Expand All @@ -86,7 +86,7 @@ - (void)testPropertyDescriptionException
exceptionThrown = YES;
}
@finally {
STAssertTrue(exceptionThrown, @"NSPropertyDescription should throw an exception if you ask for its xmlElement");
XCTAssertTrue(exceptionThrown, @"NSPropertyDescription should throw an exception if you ask for its xmlElement");
}
}

Expand Down