test-undeferred-warnings.script 2.06 KB
Newer Older
1
2
3
4
5
6
7
8
;;; -*- Lisp -*-

;;;---------------------------------------------------------------------------
;;; Intended to test behaviors that we see when the deferred warnings check is
;;; NOT deferred.
;;; ---------------------------------------------------------------------------

(in-package :asdf-test)
9
10
11
(uiop:uiop-debug)

(disable-deferred-warnings-check)
12
13
14
15

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

Robert Goldman's avatar
Robert Goldman committed
16
17
18
19
20
21
22
23
24
;;; 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))
25

26
27
;; GCL fails to warn; CMUCL, SBCL and presumably SCL defer warning to end of compilation unit;
;; SCL and XCL not actually tested
28
(DBG "Check for proper errors on warning.")
29
30
(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
31
        (let ((*compile-file-warnings-behaviour* :error))
32
33
          (load-system :undefined-variables :force t)))
(DBG "Check for proper warnings on warning.")
34
35
(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
36
37
        (let ((*compile-file-warnings-behaviour* :warning))
          (load-system :undefined-variables :force t)))
38
(DBG "check for undefined variable warnings to not fail a build.")
Robert Goldman's avatar
Robert Goldman committed
39
40
41
(assert
 (let ((*compile-file-warnings-behaviour* :ignore))
   (load-system :undefined-variables :force t)))
42
(DBG "check for undefined variable-warnings throttled by PERFORM around method not failing a build.")
Robert Goldman's avatar
Robert Goldman committed
43
44
45
(assert
 (let ((*compile-file-warnings-behaviour* :error))
   (asdf:load-system :undefined-variables-throttled :force t)))