From 87bdc0acd3a3a65dfb9b1802148355768ca8053a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 24 Nov 2008 12:57:26 -0600 Subject: [PATCH] if we're on win64, don't run postgresql tests --- basis/db/postgresql/postgresql-tests.factor | 150 ++++++++++---------- basis/db/tuples/tuples-tests.factor | 6 +- 2 files changed, 80 insertions(+), 76 deletions(-) diff --git a/basis/db/postgresql/postgresql-tests.factor b/basis/db/postgresql/postgresql-tests.factor index fe53e2416e..bc5ec2f0c5 100644 --- a/basis/db/postgresql/postgresql-tests.factor +++ b/basis/db/postgresql/postgresql-tests.factor @@ -1,6 +1,6 @@ USING: kernel db.postgresql alien continuations io classes prettyprint sequences namespaces tools.test db -db.tuples db.types unicode.case accessors ; +db.tuples db.types unicode.case accessors system ; IN: db.postgresql.tests : test-db ( -- postgresql-db ) @@ -10,86 +10,88 @@ IN: db.postgresql.tests "thepasswordistrust" >>password "factor-test" >>database ; -[ ] [ test-db [ ] with-db ] unit-test +os windows? cpu x86.64? and [ + [ ] [ test-db [ ] with-db ] unit-test -[ ] [ - test-db [ - [ "drop table person;" sql-command ] ignore-errors - "create table person (name varchar(30), country varchar(30));" + [ ] [ + test-db [ + [ "drop table person;" sql-command ] ignore-errors + "create table person (name varchar(30), country varchar(30));" + sql-command + + "insert into person values('John', 'America');" sql-command + "insert into person values('Jane', 'New Zealand');" sql-command + ] with-db + ] unit-test + + [ + { + { "John" "America" } + { "Jane" "New Zealand" } + } + ] [ + test-db [ + "select * from person" sql-query + ] with-db + ] unit-test + + [ + { + { "John" "America" } + { "Jane" "New Zealand" } + } + ] [ test-db [ "select * from person" sql-query ] with-db ] unit-test + + [ + ] [ + test-db [ + "insert into person(name, country) values('Jimmy', 'Canada')" sql-command + ] with-db + ] unit-test - "insert into person values('John', 'America');" sql-command - "insert into person values('Jane', 'New Zealand');" sql-command - ] with-db -] unit-test + [ + { + { "John" "America" } + { "Jane" "New Zealand" } + { "Jimmy" "Canada" } + } + ] [ test-db [ "select * from person" sql-query ] with-db ] unit-test -[ - { - { "John" "America" } - { "Jane" "New Zealand" } - } -] [ - test-db [ - "select * from person" sql-query - ] with-db -] unit-test + [ + test-db [ + [ + "insert into person(name, country) values('Jose', 'Mexico')" sql-command + "insert into person(name, country) values('Jose', 'Mexico')" sql-command + "oops" throw + ] with-transaction + ] with-db + ] must-fail -[ - { - { "John" "America" } - { "Jane" "New Zealand" } - } -] [ test-db [ "select * from person" sql-query ] with-db ] unit-test + [ 3 ] [ + test-db [ + "select * from person" sql-query length + ] with-db + ] unit-test -[ -] [ - test-db [ - "insert into person(name, country) values('Jimmy', 'Canada')" - sql-command - ] with-db -] unit-test + [ + ] [ + test-db [ + [ + "insert into person(name, country) values('Jose', 'Mexico')" + sql-command + "insert into person(name, country) values('Jose', 'Mexico')" + sql-command + ] with-transaction + ] with-db + ] unit-test -[ - { - { "John" "America" } - { "Jane" "New Zealand" } - { "Jimmy" "Canada" } - } -] [ test-db [ "select * from person" sql-query ] with-db ] unit-test - -[ - test-db [ - [ - "insert into person(name, country) values('Jose', 'Mexico')" sql-command - "insert into person(name, country) values('Jose', 'Mexico')" sql-command - "oops" throw - ] with-transaction - ] with-db -] must-fail - -[ 3 ] [ - test-db [ - "select * from person" sql-query length - ] with-db -] unit-test - -[ -] [ - test-db [ - [ - "insert into person(name, country) values('Jose', 'Mexico')" - sql-command - "insert into person(name, country) values('Jose', 'Mexico')" - sql-command - ] with-transaction - ] with-db -] unit-test - -[ 5 ] [ - test-db [ - "select * from person" sql-query length - ] with-db -] unit-test + [ 5 ] [ + test-db [ + "select * from person" sql-query length + ] with-db + ] unit-test +] unless : with-dummy-db ( quot -- ) diff --git a/basis/db/tuples/tuples-tests.factor b/basis/db/tuples/tuples-tests.factor index 192986484e..0432f38683 100644 --- a/basis/db/tuples/tuples-tests.factor +++ b/basis/db/tuples/tuples-tests.factor @@ -3,7 +3,7 @@ USING: io.files kernel tools.test db db.tuples classes db.types continuations namespaces math math.ranges prettyprint calendar sequences db.sqlite math.intervals -db.postgresql accessors random math.bitwise +db.postgresql accessors random math.bitwise system math.ranges strings urls fry db.tuples.private ; IN: db.tuples.tests @@ -26,7 +26,9 @@ IN: db.tuples.tests : test-postgresql ( quot -- ) '[ - [ ] [ postgresql-db _ with-db ] unit-test + os windows? cpu x86.64? and [ + [ ] [ postgresql-db _ with-db ] unit-test + ] unless ] call ; inline ! These words leak resources, but are useful for interactivel testing