Make redblack a pure test

It basically was because we allow package creation in pure tests.
Just do a better job of scrubbing changes to PRINT-OBJECT.
(The purely functional redblack algorithm isn't built in any more,
but it's nice to have as another GC stress test)

Not to mention, the test manifest file was incorrect, because once
it was a pure test, then it wasn't. And apparently we have a bug that
the scaffolding doesn't check impure requisites carefully enough.
This commit is contained in:
Douglas Katzman 2023-01-23 10:35:17 -05:00
parent 057188b1f8
commit 7846cfce29
4 changed files with 15 additions and 5 deletions

View file

@ -32,7 +32,7 @@
(:shadow "DELETE")
(:export "INSERT" "DELETE"))
(in-package "SB-RBTREE")
(cl:in-package "SB-RBTREE")
(defmacro define-tree-class (&key key-type value-type (lessp '<)
&aux (data-type (if value-type 'cons key-type))

View file

@ -81,7 +81,7 @@
"tests/package-test-5.lisp"
"tests/package-test-6.lisp"
"tests/package-test-7.lisp")
("redblack.pure.lisp" "tests/bbtree-test-util.lisp")
("redblack.pure.lisp" "tests/bbtree-test-util.lisp" "../src/code/redblack.lisp")
("run-program.impure.lisp" "contrib/sb-posix.fasl")
("sb-aclrepl.impure.lisp" "contrib/sb-aclrepl.fasl"
"../contrib/sb-aclrepl/tests.lisp")

View file

@ -271,7 +271,8 @@
(n-new (when (and (slot-exists-p gf 'sb-pcl::methods)
(slot-boundp gf 'sb-pcl::methods))
(length (sb-mop:generic-function-methods gf)))))
(assert (eql n-old n-new)))))
(unless (eql n-old n-new)
(error "Generic-Function change: ~S (had ~D methods)" gf n-old)))))
(defun tersely-summarize-globaldb ()
(let* ((symbols-with-properties)
@ -352,7 +353,16 @@
(dolist (package delete)
(unuse-package (package-use-list package) package))
;; Then all deletions
(mapc 'delete-package delete))
(mapc 'delete-package delete)
(when delete
(format t "::: NOTE: Deleted ~D package~:P~%" (length delete))))
;; Remove PRINT-OBJECT methods specialized on uninterned symbols
(let ((gf #'print-object))
(dolist (method (sb-mop:generic-function-methods gf))
(let ((first-specializer
(class-name (car (sb-mop:method-specializers method)))))
(unless (symbol-package first-specializer)
(remove-method gf method)))))
(loop for x in (cdr globaldb-summary) for y in (cdr (tersely-summarize-globaldb))
for index from 0
unless (equal x y)
@ -482,8 +492,8 @@
(setq sb-disassem::*disassem-inst-space* nil
sb-disassem::*assembler-routines-by-addr* nil)
(compare-symbol-values global-symbol-values)
(compare-gf-summary gf-summary)
(globaldb-cleanup initial-packages globaldb-summary)
(compare-gf-summary gf-summary)
(dolist (symbol '(sb-pcl::compile-or-load-defgeneric
sb-kernel::%compiler-defclass))
(sb-int:unencapsulate symbol 'defblah-guard)))))