Commit a835c309 authored by Robert Goldman's avatar Robert Goldman
Browse files

More tests for (un)deferred warnings.

parent e4586127
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

(in-package :asdf-test)

(uiop:uiop-debug)
(enable-deferred-warnings-check)

(def-test-system :unintern-foo
@@ -9,6 +10,13 @@
(def-test-system :use-foo-only
  :depends-on (:unintern-foo)
  :components ((:file "use-foo")))
(def-test-system :use-foo-with-wrapper
  :depends-on (:unintern-foo)
  :components ((:file "use-foo"
                :perform (compile-op :around (op c)
                                 (declare (ignorable op c))
                                 (let ((asdf:*compile-file-warnings-behaviour* :error))
                                   (call-next-method))))))
(def-test-system :use-then-defun-foo
  :depends-on (:unintern-foo)
  :serial t
@@ -37,6 +45,10 @@
  (let ((*compile-file-warnings-behaviour* :ignore))
    (load-system :use-foo-only :force t)))

(handler-bind
    ((error (lambda (c) (DBG :cfwbi-ufww c))))
  (load-system :use-foo-with-wrapper :force t))

(handler-bind
    ((error (lambda (c) (DBG :cfwbi-usfo c))))
  (let ((*compile-file-warnings-behaviour* :ignore))
+22 −2
Original line number Diff line number Diff line
@@ -7,18 +7,38 @@

(in-package :asdf-test)

(disable-deferred-warnings-check)

(def-test-system :undefined-variables
  :components ((:file "fun-with-undefined-locals")))

;;; DEF-TEST-SYSTEM cannot parse :PERFORM arguments
#+nil(def-test-system :undefined-variables-throttled
  :components ((:file "fun-with-undefined-locals"
                  :perform (compile-op :around (op c)
                                 (declare (ignorable op c))
                                 (let ((asdf:*compile-file-warnings-behaviour* :ignore))
                                   (call-next-method))))))
(assert
 (asdf:find-system :undefined-variables-throttled))

;; GCL fails to warn; CMUCL, SBCL and presumably SCL defer warning to end of compilation unit;
;; SCL and XCL not actually tested

(format t "Check for proper errors on warning.~%")
(errors #+(or abcl allegro clisp clozure (and ecl (not ecl-bytecmp)) lispworks mkcl xcl) compile-file-error
        #+(or cmu (and ecl ecl-bytecmp) gcl sbcl scl) null
        (let ((*compile-file-warnings-behaviour* :error))
          (load-system :undefined-variables)))
          (load-system :undefined-variables :force t)))
(format t  "Check for proper warnings on warning.~%")
(errors #+(or abcl allegro clisp clozure (and ecl (not ecl-bytecmp)) lispworks mkcl xcl) compile-file-error
        #+(or cmu (and ecl ecl-bytecmp) gcl sbcl scl) null
        (let ((*compile-file-warnings-behaviour* :warning))
          (load-system :undefined-variables :force t)))
(format t "check for undefined variable warnings to not fail a build.~%")
(assert
 (let ((*compile-file-warnings-behaviour* :ignore))
   (load-system :undefined-variables :force t)))
(format t "check for undefined variable-warnings throttled by PERFORM around method not failing a build.~%")
(assert
 (let ((*compile-file-warnings-behaviour* :error))
   (asdf:load-system :undefined-variables-throttled :force t)))
+6 −0
Original line number Diff line number Diff line
(defsystem :undefined-variables-throttled
  :components ((:file "fun-with-undefined-locals"
                  :perform (compile-op :around (op c)
                                 (declare (ignorable op c))
                                 (let ((asdf:*compile-file-warnings-behaviour* :ignore))
                                   (call-next-method))))))