Skip to content

Commit 2a58830

Browse files
committed
Merge branch 'iss124-test' into 'master'
Test for issue 124. See merge request asdf/asdf!212
2 parents bc94075 + c5144de commit 2a58830

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

test/poor-package-control.script

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
;;; -*- Mode: common-lisp; -*-
2+
3+
;;; Test for cl.net gitlab issue #124
4+
;;; If *PACKAGE* is bound to the package named foobar in the context in which
5+
;;; file1.lisp is compiled, that will cause an error (defpackage not found).
6+
7+
;;; ABCL does not issue the errors we expect.
8+
(when (member :abcl *features*)
9+
(leave-test "This test does not function properly on ABCL." 0))
10+
11+
(defpackage foobar
12+
(:use))
13+
14+
(def-test-system test-bad-package-discipline
15+
:components ((:file "file1")))
16+
17+
(setf asdf:*compile-file-warnings-behaviour* :error
18+
asdf:*compile-file-failure-behaviour* :error)
19+
20+
(with-expected-failure ("Value of *PACKAGE* not controlled")
21+
(let ((*package* (find-package :foobar))
22+
(asdf:*compile-file-warnings-behaviour* :error))
23+
(asdf:compile-system "test-bad-package-discipline" :force t)))
24+
25+
(with-expected-failure ("Value of *PACKAGE* not controlled")
26+
(in-package :foobar)
27+
(cl:let ((asdf:*compile-file-warnings-behaviour* :error))
28+
(asdf:compile-system "test-bad-package-discipline" :force cl:t)))

test/script-support.lisp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,15 @@ is bound, write a message and exit on an error. If
632632
`(:output-translations
633633
(,(acall :wilden *asdf-directory*) ,(acall :wilden (resolve-output "asdf/")))
634634
(t ,(acall :wilden (resolve-output "root")))
635-
:ignore-inherited-configuration)))
635+
:ignore-inherited-configuration))
636+
637+
(let ((fasl-dir (resolve-output "asdf/test/")))
638+
(when (acall (list '#:directory-exists-p :uiop) fasl-dir)
639+
(format t "Removing old fasls from directory ~a.~%" fasl-dir)
640+
(funcall (asym '#:delete-directory-tree :uiop t)
641+
fasl-dir
642+
:validate #'(lambda (x)
643+
(member "build" (pathname-directory x) :test 'equal))))))
636644
(when (asym :*central-registry*)
637645
(set (asym :*central-registry*) `(,*test-directory*)))
638646
(format t "Being a bit verbose~%")

0 commit comments

Comments
 (0)