diff options
author | Marius Ursache <marius@marius.me.uk> | 2016-03-01 10:45:24 +1100 |
---|---|---|
committer | Marius Ursache <marius@marius.me.uk> | 2016-03-01 10:45:24 +1100 |
commit | 7887ad6932b02ca149520b1624608504da3494bf (patch) | |
tree | a54f467dee09e47a56dd58681d0a216d4b4514e3 /Frameworks/PostgresKit | |
parent | 8a4bc2f3a38da7cea67c4cc5e8bb85fa2c5c2d07 (diff) | |
download | sequelpro-7887ad6932b02ca149520b1624608504da3494bf.tar.gz sequelpro-7887ad6932b02ca149520b1624608504da3494bf.tar.bz2 sequelpro-7887ad6932b02ca149520b1624608504da3494bf.zip |
Converted PostgresKit tests to XCTest
Diffstat (limited to 'Frameworks/PostgresKit')
10 files changed, 53 insertions, 37 deletions
diff --git a/Frameworks/PostgresKit/PostgresKit.xcodeproj/project.pbxproj b/Frameworks/PostgresKit/PostgresKit.xcodeproj/project.pbxproj index 479474da..bf8e5545 100644 --- a/Frameworks/PostgresKit/PostgresKit.xcodeproj/project.pbxproj +++ b/Frameworks/PostgresKit/PostgresKit.xcodeproj/project.pbxproj @@ -81,7 +81,7 @@ 1724CA3B15F9EE7300AB2291 /* libpqtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libpqtypes.h; sourceTree = "<group>"; }; 1724CC9015FB4CC200AB2291 /* PGPostgresTimeTZ.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PGPostgresTimeTZ.h; sourceTree = "<group>"; }; 1724CC9115FB4CC200AB2291 /* PGPostgresTimeTZ.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PGPostgresTimeTZ.m; sourceTree = "<group>"; }; - 1724CD0415FB68E800AB2291 /* Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; + 1724CD0415FB68E800AB2291 /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 1724CD0515FB68E800AB2291 /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Tests-Info.plist"; path = "Resources/Tests-Info.plist"; sourceTree = "<group>"; }; 1724CD5715FB8A3300AB2291 /* PGPostgresTimeInterval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PGPostgresTimeInterval.h; sourceTree = "<group>"; }; 1724CD5815FB8A3300AB2291 /* PGPostgresTimeInterval.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PGPostgresTimeInterval.m; sourceTree = "<group>"; }; @@ -167,7 +167,7 @@ isa = PBXGroup; children = ( 8DC2EF5B0486A6940098B216 /* PostgresKit.framework */, - 1724CD0415FB68E800AB2291 /* Tests.octest */, + 1724CD0415FB68E800AB2291 /* Tests.xctest */, ); name = Products; sourceTree = "<group>"; @@ -460,8 +460,8 @@ ); name = Tests; productName = Tests; - productReference = 1724CD0415FB68E800AB2291 /* Tests.octest */; - productType = "com.apple.product-type.bundle"; + productReference = 1724CD0415FB68E800AB2291 /* Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; }; 8DC2EF4F0486A6940098B216 /* PostgresKit */ = { isa = PBXNativeTarget; @@ -487,7 +487,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0720; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "PostgresKit" */; compatibilityVersion = "Xcode 3.2"; @@ -565,7 +565,7 @@ CLANG_LINK_OBJC_RUNTIME = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -576,12 +576,9 @@ OTHER_LDFLAGS = ( "-framework", Cocoa, - "-framework", - SenTestingKit, ); + PRODUCT_BUNDLE_IDENTIFIER = com.sequelpro.postgreskit.tests; PRODUCT_NAME = Tests; - TEST_AFTER_BUILD = YES; - WRAPPER_EXTENSION = octest; }; name = Debug; }; @@ -592,7 +589,7 @@ CLANG_LINK_OBJC_RUNTIME = NO; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -601,12 +598,9 @@ OTHER_LDFLAGS = ( "-framework", Cocoa, - "-framework", - SenTestingKit, ); + PRODUCT_BUNDLE_IDENTIFIER = com.sequelpro.postgreskit.tests; PRODUCT_NAME = Tests; - TEST_AFTER_BUILD = YES; - WRAPPER_EXTENSION = octest; ZERO_LINK = NO; }; name = Release; @@ -617,7 +611,7 @@ ALWAYS_SEARCH_USER_PATHS = NO; CLANG_LINK_OBJC_RUNTIME = NO; COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -626,12 +620,9 @@ OTHER_LDFLAGS = ( "-framework", Cocoa, - "-framework", - SenTestingKit, ); + PRODUCT_BUNDLE_IDENTIFIER = com.sequelpro.postgreskit.tests; PRODUCT_NAME = Tests; - TEST_AFTER_BUILD = YES; - WRAPPER_EXTENSION = octest; }; name = Distribution; }; @@ -645,8 +636,11 @@ CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Source/PostgresKit-Prefix.pch"; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; @@ -704,6 +698,7 @@ "$(inherited)", "\"$(SRCROOT)/Libs\"/**", ); + PRODUCT_BUNDLE_IDENTIFIER = com.sequelpro.postgreskit; PRODUCT_NAME = PostgresKit; WARNING_CFLAGS = "-Wmost"; WRAPPER_EXTENSION = framework; @@ -756,6 +751,7 @@ "$(inherited)", "\"$(SRCROOT)/Libs\"/**", ); + PRODUCT_BUNDLE_IDENTIFIER = com.sequelpro.postgreskit; PRODUCT_NAME = PostgresKit; WARNING_CFLAGS = "-Wmost"; WRAPPER_EXTENSION = framework; @@ -803,6 +799,7 @@ "$(inherited)", "\"$(SRCROOT)/Libs\"/**", ); + PRODUCT_BUNDLE_IDENTIFIER = com.sequelpro.postgreskit; PRODUCT_NAME = PostgresKit; WARNING_CFLAGS = "-Wmost"; WRAPPER_EXTENSION = framework; @@ -819,8 +816,12 @@ CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Source/PostgresKit-Prefix.pch"; @@ -849,8 +850,11 @@ CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Source/PostgresKit-Prefix.pch"; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; diff --git a/Frameworks/PostgresKit/PostgresKit.xcodeproj/xcshareddata/xcschemes/PostgresKit.xcscheme b/Frameworks/PostgresKit/PostgresKit.xcodeproj/xcshareddata/xcschemes/PostgresKit.xcscheme index ca74a70b..04dd4bea 100644 --- a/Frameworks/PostgresKit/PostgresKit.xcodeproj/xcshareddata/xcschemes/PostgresKit.xcscheme +++ b/Frameworks/PostgresKit/PostgresKit.xcodeproj/xcshareddata/xcschemes/PostgresKit.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0500" + LastUpgradeVersion = "0720" version = "1.3"> <BuildAction parallelizeBuildables = "YES" @@ -33,12 +33,14 @@ <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "1724CD0315FB68E800AB2291" - BuildableName = "Tests.octest" + BuildableName = "Tests.xctest" BlueprintName = "Tests" ReferencedContainer = "container:PostgresKit.xcodeproj"> </BuildableReference> </TestableReference> </Testables> + <AdditionalOptions> + </AdditionalOptions> </TestAction> <LaunchAction selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" @@ -48,7 +50,17 @@ buildConfiguration = "Debug" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" + debugServiceExtension = "internal" allowLocationSimulation = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "8DC2EF4F0486A6940098B216" + BuildableName = "PostgresKit.framework" + BlueprintName = "PostgresKit" + ReferencedContainer = "container:PostgresKit.xcodeproj"> + </BuildableReference> + </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </LaunchAction> diff --git a/Frameworks/PostgresKit/Resources/Info.plist b/Frameworks/PostgresKit/Resources/Info.plist index b961331f..0da2c36b 100644 --- a/Frameworks/PostgresKit/Resources/Info.plist +++ b/Frameworks/PostgresKit/Resources/Info.plist @@ -7,7 +7,7 @@ <key>CFBundleExecutable</key> <string>PostgresKit</string> <key>CFBundleIdentifier</key> - <string>com.sequelpro.postgreskit</string> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> diff --git a/Frameworks/PostgresKit/Resources/Tests-Info.plist b/Frameworks/PostgresKit/Resources/Tests-Info.plist index b88d8638..ddbc4bf7 100644 --- a/Frameworks/PostgresKit/Resources/Tests-Info.plist +++ b/Frameworks/PostgresKit/Resources/Tests-Info.plist @@ -7,7 +7,7 @@ <key>CFBundleExecutable</key> <string>Tests</string> <key>CFBundleIdentifier</key> - <string>com.sequelpro.postgreskit.tests</string> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> diff --git a/Frameworks/PostgresKit/Tests/PGDataTypeTests.h b/Frameworks/PostgresKit/Tests/PGDataTypeTests.h index 8f6b54ad..7322823f 100644 --- a/Frameworks/PostgresKit/Tests/PGDataTypeTests.h +++ b/Frameworks/PostgresKit/Tests/PGDataTypeTests.h @@ -27,7 +27,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #import <PostgresKit/PostgresKit.h> -#import <SenTestingKit/SenTestingKit.h> +#import <XCTest/XCTest.h> #import "PGPostgresIntegrationTestCase.h" diff --git a/Frameworks/PostgresKit/Tests/PGDataTypeTests.m b/Frameworks/PostgresKit/Tests/PGDataTypeTests.m index a2048ed6..8ffd8b47 100644 --- a/Frameworks/PostgresKit/Tests/PGDataTypeTests.m +++ b/Frameworks/PostgresKit/Tests/PGDataTypeTests.m @@ -33,7 +33,7 @@ + (void)_addTestForField:(NSString *)field withExpectedResult:(id)result connection:(PGPostgresConnection *)connection - toTestSuite:(SenTestSuite *)testSuite; + toTestSuite:(XCTestSuite *)testSuite; @end @@ -48,7 +48,7 @@ + (id)defaultTestSuite { - SenTestSuite *testSuite = [[SenTestSuite alloc] initWithName:[self className]]; + XCTestSuite *testSuite = [[XCTestSuite alloc] initWithName:[self className]]; PGPostgresConnection *connection = [[PGPostgresConnection alloc] init]; @@ -109,12 +109,12 @@ - (void)testResultValueIsNotNil { - STAssertNotNil(_result, nil); + XCTAssertNotNil(_result); } - (void)testResultIsOfCorrectTypeAndValue { - STAssertEqualObjects(_result, _expectedResult, nil); + XCTAssertEqualObjects(_result, _expectedResult); } #pragma mark - @@ -123,11 +123,11 @@ + (void)_addTestForField:(NSString *)field withExpectedResult:(id)result connection:(PGPostgresConnection *)connection - toTestSuite:(SenTestSuite *)testSuite + toTestSuite:(XCTestSuite *)testSuite { for (NSInvocation *invocation in [self testInvocations]) { - SenTestCase *test = [[[self class] alloc] initWithInvocation:invocation connection:connection expectedResult:result field:field]; + XCTestCase *test = [[[self class] alloc] initWithInvocation:invocation connection:connection expectedResult:result field:field]; [testSuite addTest:test]; diff --git a/Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.h b/Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.h index c6706156..7a654f5f 100644 --- a/Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.h +++ b/Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.h @@ -27,9 +27,9 @@ // OTHER DEALINGS IN THE SOFTWARE. #import <PostgresKit/PostgresKit.h> -#import <SenTestingKit/SenTestingKit.h> +#import <XCTest/XCTest.h> -@interface PGPostgresIntegrationTestCase : SenTestCase +@interface PGPostgresIntegrationTestCase : XCTestCase { PGPostgresConnection *_connection; } diff --git a/Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.m b/Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.m index e6c96505..96de8a40 100644 --- a/Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.m +++ b/Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.m @@ -67,7 +67,7 @@ static NSUInteger PGTestDatabasePort = 5432; [_connection setPassword:PGTestDatabasePassword]; if (![_connection connect]) { - STFail(@"Request to establish connection to local database failed."); + XCTFail(@"Request to establish connection to local database failed."); exit(1); } diff --git a/Frameworks/PostgresKit/Tests/PGPostgresResultTests.h b/Frameworks/PostgresKit/Tests/PGPostgresResultTests.h index 93c36427..e01aedec 100644 --- a/Frameworks/PostgresKit/Tests/PGPostgresResultTests.h +++ b/Frameworks/PostgresKit/Tests/PGPostgresResultTests.h @@ -27,7 +27,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #import <PostgresKit/PostgresKit.h> -#import <SenTestingKit/SenTestingKit.h> +#import <XCTest/XCTest.h> #import "PGPostgresIntegrationTestCase.h" diff --git a/Frameworks/PostgresKit/Tests/PGPostgresResultTests.m b/Frameworks/PostgresKit/Tests/PGPostgresResultTests.m index ef64ea53..8e27b163 100644 --- a/Frameworks/PostgresKit/Tests/PGPostgresResultTests.m +++ b/Frameworks/PostgresKit/Tests/PGPostgresResultTests.m @@ -63,7 +63,7 @@ "}"); // Compare the output after getting rid of newlines and spaces - STAssertTrue([[[[_result description] stringByReplacingOccurrencesOfString:@"\n" withString:@""] stringByReplacingOccurrencesOfString:@" " withString:@""] isEqualToString:@"{" + XCTAssertTrue([[[[_result description] stringByReplacingOccurrencesOfString:@"\n" withString:@""] stringByReplacingOccurrencesOfString:@" " withString:@""] isEqualToString:@"{" "\"bigint_field\" = 123456789;" "\"bool_field\" = 1;" "\"char_field\" = CHAR;" @@ -77,7 +77,7 @@ "\"timestamptz_field\" = \"8 Apr 1987 03:02:02 GMT+01:00\";" "\"timetz_field\" = \"02:02:02 GMT+10:00\";" "\"varchar_field\" = VARCHAR;" - "}"], nil); + "}"]); } #pragma mark - |