X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-init.lisp;h=e64a2acb921a8fcea310830abe954e795624e539;hb=49718a027333775f28d463d4e80d5e5238ef68a3;hp=d0c9bca8490e29902b89c96babb2559bbb2c738c;hpb=9374619101fdb679974192b5939c0eb15e31c39d;p=clsql.git diff --git a/tests/test-init.lisp b/tests/test-init.lisp index d0c9bca..e64a2ac 100644 --- a/tests/test-init.lisp +++ b/tests/test-init.lisp @@ -30,14 +30,14 @@ (defvar *test-database-type* nil) (defvar *test-database-underlying-type* nil) (defvar *test-database-user* nil) +(defvar *test-false-database-user* "adsfjalsdkfjlakjsdfl" + "For testing ownership, a user that isn't the owner.") (defvar *test-start-utime* nil) (defvar *test-connection-spec* nil) (defvar *test-connection-db-type* nil) - - (defun test-connect-to-database (db-type spec) (when (clsql-sys:db-backend-has-create/destroy-db? db-type) (ignore-errors (destroy-database spec :database-type db-type)) @@ -46,7 +46,7 @@ (setf *test-database-type* db-type) (setf *test-database-user* (cond - ((eq :oracle db-type) (second spec)) + ((member db-type '(:oracle :odbc :aodbc)) (second spec)) ((>= (length spec) 3) (third spec)))) ;; Connect to the database @@ -109,14 +109,15 @@ (when (db-type-spec db-type specs) (clsql-sys:initialize-database-type :database-type db-type)))) -(defun write-report-banner (report-type db-type stream) +(defun write-report-banner (report-type db-type stream db-name) (format stream "~& ****************************************************************************** *** CLSQL ~A begun at ~A *** ~A *** ~A on ~A -*** Database ~:@(~A~) backend~A. +*** Database ~:@(~A~) +*** Type: ~:@(~A~) backend~A. ****************************************************************************** " report-type @@ -126,6 +127,7 @@ (lisp-implementation-type) (lisp-implementation-version) (machine-type) + db-name db-type (if (not (eq db-type *test-database-underlying-type*)) (format nil " with underlying type ~:@(~A~)" @@ -140,7 +142,8 @@ (multiple-value-bind (test-forms skip-tests) (compute-tests-for-backend db-type *test-database-underlying-type*) - (write-report-banner "Test Suite" db-type *report-stream*) + (write-report-banner "Test Suite" db-type *report-stream* + (database-name-from-spec spec db-type)) ; (test-initialise-database) @@ -226,11 +229,19 @@ (push (cons test "syntax not supported") skip-tests)) ((and (eq *test-database-type* :odbc) (eq *test-database-underlying-type* :postgresql) - (clsql-sys:in test :fddl/owner/1)) + (clsql-sys:in test :fddl/owner/1 :fddl/owner/table + :fddl/owner/attributes + :fddl/owner/attribute-types + :fddl/owner/index + :fddl/owner/sequence)) (push (cons test "table ownership not supported by postgresql odbc driver") skip-tests)) ((and (not (member *test-database-underlying-type* '(:postgresql :oracle))) - (clsql-sys:in test :fddl/owner/1)) + (clsql-sys:in test :fddl/owner/1 :fddl/owner/table + :fddl/owner/attributes + :fddl/owner/attribute-types + :fddl/owner/index + :fddl/owner/sequence)) (push (cons test "table ownership not supported") skip-tests)) ((and (null (clsql-sys:db-type-has-intersect? db-underlying-type)) (clsql-sys:in test :fdml/query/7)) @@ -245,6 +256,20 @@ '(:postgresql :mysql :sqlite3))) (clsql-sys:in test :fdml/select/37 :fdml/select/38)) (push (cons test "LIMIT keyword not supported in SELECT") skip-tests)) + ((and (not (clsql-sys:db-type-has-auto-increment? db-underlying-type)) + (clsql-sys:in test :oodml/select/12 :oodml/select/13 :oodml/select/14 + :oodml/select/15 :oodml/select/16 :oodml/select/17 + :oodml/select/18 :oodml/select/19 :oodml/select/20 + :oodml/select/21 :oodml/select/22 + :oodml/update-records/4 :oodml/update-records/4-slots + :oodml/update-records/5 :oodml/update-records/5-slots + :oodml/update-records/6 :oodml/update-records/7 + :oodml/update-records/8 :oodml/update-records/9 + :oodml/update-records/9-slots :oodml/update-instance/3 + :oodml/update-instance/4 :oodml/update-instance/5 + :oodml/update-instance/6 :oodml/update-instance/7 + :oodml/db-auto-sync/3 :oodml/db-auto-sync/4)) + (push (cons test ":auto-increment not by backend.") skip-tests)) (t (push test-form test-forms))))) (values (nreverse test-forms) (nreverse skip-tests))))