aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/PostgresKit
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-09-08 11:50:33 +0000
committerstuconnolly <stuart02@gmail.com>2012-09-08 11:50:33 +0000
commit9f9b1599232e2a93ee910b6a2888f911eedead70 (patch)
treec7f344dc0b52d8ffcd5ca6d50337eb5b58305505 /Frameworks/PostgresKit
parentf7df6d3700bac8181e2258a9df28a32153124c46 (diff)
downloadsequelpro-9f9b1599232e2a93ee910b6a2888f911eedead70.tar.gz
sequelpro-9f9b1599232e2a93ee910b6a2888f911eedead70.tar.bz2
sequelpro-9f9b1599232e2a93ee910b6a2888f911eedead70.zip
Add Tests directory, make file and test data SQL script.
Diffstat (limited to 'Frameworks/PostgresKit')
-rw-r--r--Frameworks/PostgresKit/Makefile27
-rw-r--r--Frameworks/PostgresKit/Resources/TestData.sql59
2 files changed, 86 insertions, 0 deletions
diff --git a/Frameworks/PostgresKit/Makefile b/Frameworks/PostgresKit/Makefile
new file mode 100644
index 00000000..8a01c273
--- /dev/null
+++ b/Frameworks/PostgresKit/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+
+CONFIG=Debug
+OPTIONS=
+
+BUILD_CONFIG?=$(CONFIG)
+
+CP=ditto --rsrc
+RM=rm
+
+.PHONY: postgreskit test clean clean-all latest
+
+querykit:
+ xcodebuild -project PostgresKit.xcodeproj -configuration "$(BUILD_CONFIG)" CFLAGS="$(SP_CFLAGS)" $(OPTIONS) build
+
+test:
+ xcodebuild -project PostgresKit.xcodeproj -configuration "$(BUILD_CONFIG)" CFLAGS="$(SP_CFLAGS)" -target Tests $(OPTIONS) build
+
+clean:
+ xcodebuild -project PostgresKit.xcodeproj -configuration "$(BUILD_CONFIG)" $(OPTIONS) -nodependencies clean
+
+clean-all:
+ xcodebuild -project PostgresKit.xcodeproj -configuration "$(BUILD_CONFIG)" $(OPTIONS) clean
+
+latest:
+ svn update
+ make postgreskit \ No newline at end of file
diff --git a/Frameworks/PostgresKit/Resources/TestData.sql b/Frameworks/PostgresKit/Resources/TestData.sql
new file mode 100644
index 00000000..1aea4908
--- /dev/null
+++ b/Frameworks/PostgresKit/Resources/TestData.sql
@@ -0,0 +1,59 @@
+-- $Id$
+--
+-- SQL script used by PostgresKit's integration tests.
+--
+-- For the tests to execute successfully this file should
+-- be run against a blank database called 'pgkit_test' and
+-- the user 'pgkit_test' with password 'pgkit' should exit:
+--
+-- CREATE DATABASE pgkit_test;
+-- CREATE USER pgkit_test WITH PASSWORD 'pgkit';
+
+BEGIN;
+
+SET datestyle = 'DMY';
+SET client_encoding = 'UNICODE';
+
+CREATE TABLE IF NOT EXISTS data_types
+(
+ int_field INT PRIMARY KEY NOT NULL,
+ smallint_field SMALLINT NOT NULL,
+ bool_field BOOL NOT NULL,
+ float_field REAL NOT NULL,
+ char_field CHAR(5) NOT NULL,
+ varchar_field VARCHAR(32) NOT NULL,
+ date_field DATE NOT NULL,
+ time_field TIME NOT NULL,
+ timetz_field TIME WITH TIME ZONE NOT NULL,
+ timstamp_field TIMESTAMP NOT NULL,
+ timestamptz_field TIMESTAMP WITH TIME ZONE NOT NULL
+);
+
+INSERT INTO data_types (
+ int_field,
+ smallint_field,
+ bool_field,
+ float_field,
+ char_field,
+ varchar_field,
+ date_field,
+ time_field,
+ timetz_field,
+ timstamp_field,
+ timestamptz_field)
+VALUES (
+ 12345,
+ 2,
+ TRUE,
+ 12345.678,
+ 'CHARV',
+ 'VARCHAR_VALUE',
+ '08-04-1987',
+ '02:02:02',
+ '02:02:02 GMT',
+ '08-04-1987 02:02:02',
+ '08-04-1987 02:02:02 GMT');
+
+COMMIT;
+
+ANALYZE data_types;