X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-init.lisp;h=7a46089b16b820e7fab2420dd393dff3d5fe8b3f;hb=799820388d21ad2d81502816025fdc6f89f71bf2;hp=5f68e471ab7be2ea4251a58398f31377ddc24b51;hpb=907a36ee9f2a80d6e296f76ea4dfd9532260b9bb;p=clsql.git diff --git a/tests/test-init.lisp b/tests/test-init.lisp index 5f68e47..7a46089 100644 --- a/tests/test-init.lisp +++ b/tests/test-init.lisp @@ -30,6 +30,8 @@ (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) @@ -44,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 @@ -107,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 @@ -124,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~)" @@ -138,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) @@ -166,7 +171,7 @@ (if skip-tests (dolist (skipped skip-tests) (format *report-stream* - "~& ~20A ~A~%" (car skipped) (cdr skipped))) + "~& ~30A ~A~%" (car skipped) (cdr skipped))) (format *report-stream* " None~%"))) (disconnect))) @@ -178,6 +183,9 @@ *rt-ooddl* *rt-oodml* *rt-syntax*)) (let ((test (second test-form))) (cond + ((and (not (eql db-underlying-type :mysql)) + (clsql-sys:in test :connection/query-command)) + (push (cons test "Known to only work in mysql as yet.") skip-tests)) ((and (null (clsql-sys:db-type-has-views? db-underlying-type)) (clsql-sys:in test :fddl/view/1 :fddl/view/2 :fddl/view/3 :fddl/view/4)) (push (cons test "views not supported.") skip-tests)) @@ -224,12 +232,20 @@ (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)) - (push (cons test "table ownership not supported by postgresql odbc driver.") skip-tests)) + (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)) - (push (cons test "table ownership not supported.") skip-tests)) + (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)) (push (cons test "intersect not supported.") skip-tests)) @@ -256,7 +272,7 @@ :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 supported.") skbip-tests)) + (push (cons test ":auto-increment not supported.") skip-tests)) (t (push test-form test-forms))))) (values (nreverse test-forms) (nreverse skip-tests))))