Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/sequelpro/sequelpro
  • Loading branch information
dmoagx committed Mar 5, 2016
2 parents 2301018 + 9661985 commit 1e4d40f
Show file tree
Hide file tree
Showing 50 changed files with 490 additions and 306 deletions.
44 changes: 24 additions & 20 deletions Frameworks/PostgresKit/PostgresKit.xcodeproj/project.pbxproj
Expand Up @@ -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>"; };
Expand Down Expand Up @@ -167,7 +167,7 @@
isa = PBXGroup;
children = (
8DC2EF5B0486A6940098B216 /* PostgresKit.framework */,
1724CD0415FB68E800AB2291 /* Tests.octest */,
1724CD0415FB68E800AB2291 /* Tests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -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;
Expand All @@ -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";
Expand Down Expand Up @@ -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;
Expand All @@ -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;
};
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
};
Expand All @@ -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;
Expand Down Expand Up @@ -704,6 +698,7 @@
"$(inherited)",
"\"$(SRCROOT)/Libs\"/**",
);
PRODUCT_BUNDLE_IDENTIFIER = com.sequelpro.postgreskit;
PRODUCT_NAME = PostgresKit;
WARNING_CFLAGS = "-Wmost";
WRAPPER_EXTENSION = framework;
Expand Down Expand Up @@ -756,6 +751,7 @@
"$(inherited)",
"\"$(SRCROOT)/Libs\"/**",
);
PRODUCT_BUNDLE_IDENTIFIER = com.sequelpro.postgreskit;
PRODUCT_NAME = PostgresKit;
WARNING_CFLAGS = "-Wmost";
WRAPPER_EXTENSION = framework;
Expand Down Expand Up @@ -803,6 +799,7 @@
"$(inherited)",
"\"$(SRCROOT)/Libs\"/**",
);
PRODUCT_BUNDLE_IDENTIFIER = com.sequelpro.postgreskit;
PRODUCT_NAME = PostgresKit;
WARNING_CFLAGS = "-Wmost";
WRAPPER_EXTENSION = framework;
Expand All @@ -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";
Expand Down Expand Up @@ -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;
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -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"
Expand All @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion Frameworks/PostgresKit/Resources/Info.plist
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion Frameworks/PostgresKit/Resources/Tests-Info.plist
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion Frameworks/PostgresKit/Tests/PGDataTypeTests.h
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.

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

#import "PGPostgresIntegrationTestCase.h"

Expand Down
12 changes: 6 additions & 6 deletions Frameworks/PostgresKit/Tests/PGDataTypeTests.m
Expand Up @@ -33,7 +33,7 @@ @interface PGDataTypeTests ()
+ (void)_addTestForField:(NSString *)field
withExpectedResult:(id)result
connection:(PGPostgresConnection *)connection
toTestSuite:(SenTestSuite *)testSuite;
toTestSuite:(XCTestSuite *)testSuite;

@end

Expand All @@ -48,7 +48,7 @@ @implementation PGDataTypeTests

+ (id)defaultTestSuite
{
SenTestSuite *testSuite = [[SenTestSuite alloc] initWithName:[self className]];
XCTestSuite *testSuite = [[XCTestSuite alloc] initWithName:[self className]];

PGPostgresConnection *connection = [[PGPostgresConnection alloc] init];

Expand Down Expand Up @@ -109,12 +109,12 @@ - (void)setUp

- (void)testResultValueIsNotNil
{
STAssertNotNil(_result, nil);
XCTAssertNotNil(_result);
}

- (void)testResultIsOfCorrectTypeAndValue
{
STAssertEqualObjects(_result, _expectedResult, nil);
XCTAssertEqualObjects(_result, _expectedResult);
}

#pragma mark -
Expand All @@ -123,11 +123,11 @@ - (void)testResultIsOfCorrectTypeAndValue
+ (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];

Expand Down
4 changes: 2 additions & 2 deletions Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.h
Expand Up @@ -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;
}
Expand Down
16 changes: 15 additions & 1 deletion Frameworks/PostgresKit/Tests/PGPostgresIntegrationTestCase.m
Expand Up @@ -35,6 +35,8 @@

static NSUInteger PGTestDatabasePort = 5432;

static double PGTestConnectionTimeout = 0.2;

@interface PGPostgresIntegrationTestCase ()

- (void)_establishConnection;
Expand Down Expand Up @@ -67,13 +69,25 @@ - (void)_establishConnection
[_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);
}

NSDate *startDate = [NSDate date];

do {
sleep(0.1);

if([[NSDate date] timeIntervalSinceDate:startDate] > PGTestConnectionTimeout) {
XCTFail(@"Failed to connect to database after %f seconds. Host:%@ Database:%@ User:%@ Password:%@",
PGTestConnectionTimeout,
PGTestDatabaseHost,
PGTestDatabaseName,
PGTestDatabaseUser,
PGTestDatabasePassword);
exit(1);
}
}
while (![_connection isConnected]);
}
Expand Down
2 changes: 1 addition & 1 deletion Frameworks/PostgresKit/Tests/PGPostgresResultTests.h
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.

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

#import "PGPostgresIntegrationTestCase.h"

Expand Down
4 changes: 2 additions & 2 deletions Frameworks/PostgresKit/Tests/PGPostgresResultTests.m
Expand Up @@ -63,7 +63,7 @@ - (void)testResultDescriptionIsCorrect
"}");

// 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;"
Expand All @@ -77,7 +77,7 @@ - (void)testResultDescriptionIsCorrect
"\"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 -
Expand Down

0 comments on commit 1e4d40f

Please sign in to comment.