diff --git a/momdec.xcodeproj/project.pbxproj b/momdec.xcodeproj/project.pbxproj index d2e27c9..0ff15a2 100644 --- a/momdec.xcodeproj/project.pbxproj +++ b/momdec.xcodeproj/project.pbxproj @@ -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 */; }; @@ -61,8 +60,7 @@ EE22DD3F17166355007FE629 /* NSFetchRequest+xmlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFetchRequest+xmlElement.h"; sourceTree = ""; }; EE22DD4017166355007FE629 /* NSFetchRequest+xmlElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFetchRequest+xmlElement.m"; sourceTree = ""; }; 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; }; @@ -100,7 +98,6 @@ buildActionMask = 2147483647; files = ( EE7EC7AE1714BC1C00A1901C /* CoreData.framework in Frameworks */, - EE7EC7951714BB6D00A1901C /* SenTestingKit.framework in Frameworks */, EE7EC7971714BB6D00A1901C /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -162,7 +159,7 @@ isa = PBXGroup; children = ( EEE16BAA1710D68900F6AF6B /* momdec */, - EE7EC7931714BB6D00A1901C /* momdecTests.octest */, + EE7EC7931714BB6D00A1901C /* momdecTests.xctest */, ); name = Products; sourceTree = ""; @@ -172,7 +169,6 @@ children = ( EEE16BBB1710D6A300F6AF6B /* CoreData.framework */, EEE16BAD1710D68900F6AF6B /* Foundation.framework */, - EE7EC7941714BB6D00A1901C /* SenTestingKit.framework */, EE7EC7961714BB6D00A1901C /* Cocoa.framework */, EE7EC7981714BB6D00A1901C /* Other Frameworks */, ); @@ -223,7 +219,6 @@ EE7EC78E1714BB6D00A1901C /* Sources */, EE7EC78F1714BB6D00A1901C /* Frameworks */, EE7EC7901714BB6D00A1901C /* Resources */, - EE7EC7911714BB6D00A1901C /* ShellScript */, EE7EC7AF1714BC3800A1901C /* CopyFiles */, ); buildRules = ( @@ -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; @@ -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" */; @@ -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; @@ -356,12 +336,15 @@ 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; }; @@ -369,12 +352,15 @@ 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; }; @@ -382,7 +368,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; @@ -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; @@ -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; diff --git a/momdec.xcodeproj/xcshareddata/xcschemes/momdec.xcscheme b/momdec.xcodeproj/xcshareddata/xcschemes/momdec.xcscheme index d6391ef..6652625 100644 --- a/momdec.xcodeproj/xcshareddata/xcschemes/momdec.xcscheme +++ b/momdec.xcodeproj/xcshareddata/xcschemes/momdec.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -48,17 +48,21 @@ ReferencedContainer = "container:momdec.xcodeproj"> + + - + - + + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -23,24 +23,27 @@ + + CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.atomicbird.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/momdecTests/momdecTests.h b/momdecTests/momdecTests.h index 49ddcbe..5782082 100644 --- a/momdecTests/momdecTests.h +++ b/momdecTests/momdecTests.h @@ -6,8 +6,8 @@ // Copyright (c) 2013 Tom Harrington. All rights reserved. // -#import +#import -@interface momdecTests : SenTestCase +@interface momdecTests : XCTestCase @end diff --git a/momdecTests/momdecTests.m b/momdecTests/momdecTests.m index c925b13..e145f67 100644 --- a/momdecTests/momdecTests.m +++ b/momdecTests/momdecTests.m @@ -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]]; @@ -58,7 +58,7 @@ - (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]; @@ -66,12 +66,12 @@ - (void)testDecompile 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); } } @@ -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"); } }