X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-introspect%2Ftest-driver.lisp;h=e6bee2e088388c78f7c806babefc85b1d5af8013;hb=8369a441bfd49566e70939c25f42f8d1f5423e4e;hp=f1c896b1d50f934f758e171092e6401afc073e85;hpb=4e77726ecbe2bb33d3208610266db3b8c9cb2719;p=sbcl.git diff --git a/contrib/sb-introspect/test-driver.lisp b/contrib/sb-introspect/test-driver.lisp index f1c896b..e6bee2e 100644 --- a/contrib/sb-introspect/test-driver.lisp +++ b/contrib/sb-introspect/test-driver.lisp @@ -12,6 +12,12 @@ (in-package :sb-introspect-test) +(defmacro deftest* ((name &key fails-on) form &rest results) + `(progn + (when (sb-impl::featurep ',fails-on) + (pushnew ',name sb-rt::*expected-failures*)) + (deftest ,name ,form ,@results))) + (deftest function-lambda-list.1 (function-lambda-list 'cl-user::one) (cl-user::a cl-user::b cl-user::c)) @@ -188,6 +194,14 @@ (not (find-definition-sources-by-name 'fboundp :type)) t) +(deftest find-source-stuff.31 + (matchp-name :function 'cl-user::compile-time-too-fun 28) + t) + +(deftest find-source-stuff.32 + (matchp-name :function 'cl-user::loaded-as-source-fun 3) + t) + ;;; Check wrt. interplay of generic functions and their methods. (defgeneric xuuq (gf.a gf.b &rest gf.rest &key gf.k-X)) @@ -284,13 +298,28 @@ (tai 42 :immediate nil) t) -(deftest allocation-information.4 +;;; Skip the whole damn test on GENCGC PPC -- the combination is just +;;; to flaky for this to make too much sense. GENCGC SPARC almost +;;; certainly exhibits the same behavior patterns (or antipatterns) as +;;; GENCGC PPC. +;;; +;;; -- It appears that this test can also fail due to systematic issues +;;; (possibly with the C compiler used) which we cannot detect based on +;;; *features*. Until this issue has been fixed, I am marking this test +;;; as failing on Windows to allow installation of the contrib on +;;; affected builds, even if the underlying issue is (possibly?) not even +;;; strictly related to windows. C.f. lp1057631. --DFL +;;; +(deftest* (allocation-information.4 + ;; Ignored as per the comment above, even though it seems + ;; unlikely that this is the right condition. + :fails-on (or :win32 (and (or :ppc :sparc) :gencgc))) #+gencgc (tai #'cons :heap ;; FIXME: This is the canonical GENCGC result. On PPC we sometimes get ;; :LARGE T, which doesn't seem right -- but ignore that for now. '(:space :dynamic :generation 6 :write-protected t :boxed t :pinned nil :large nil) - :ignore #+ppc '(:large) #-ppc nil) + :ignore (list :page #+ppc :large)) #-gencgc (tai :cons :heap ;; FIXME: Figure out what's the right cheney-result. SPARC at least @@ -375,12 +404,10 @@ (deftest function-type.2 (values (type-equal (function-type 'sun) (function-type #'sun)) - ;; Does not currently work due to Bug #384892. (1.0.31.26) - #+nil (type-equal (function-type #'sun) '(function (fixnum fixnum &key (:k1 (member nil t))) (values (member t) &optional)))) - t #+nil t) + t t) ;; Local functions @@ -413,6 +440,7 @@ ;; Interpreted functions +#+sb-eval (deftest function-type.8 (type-equal (function-type (interpret (lambda (x) (declare (fixnum x)) x))) '(function (&rest t) *)) @@ -450,7 +478,7 @@ #+nil (progn - + (defstruct (struct (:predicate our-struct-p) (:copier copy-our-struct)) (a 42 :type fixnum)) @@ -512,7 +540,7 @@ '(function ((member nil t) fixnum fixnum &key (:k1 (member nil t))) - *))) + (values (member nil t) &optional)))) t t) ;; Misc @@ -522,3 +550,33 @@ (type-equal (function-type #'nullary) '(function () (values null &optional)))) t) + +;;; Defstruct accessor, copier, and predicate + +(deftest defstruct-fun-sources + (let ((copier (find-definition-source #'cl-user::copy-three)) + (accessor (find-definition-source #'cl-user::three-four)) + (predicate (find-definition-source #'cl-user::three-p))) + (values (and (equalp copier accessor) + (equalp copier predicate)) + (equal "test.lisp" + (file-namestring (definition-source-pathname copier))) + (equal '(5) + (definition-source-form-path copier)))) + t + t + t) + +(deftest defstruct-fun-sources-by-name + (let ((copier (car (find-definition-sources-by-name 'cl-user::copy-three :function))) + (accessor (car (find-definition-sources-by-name 'cl-user::three-four :function))) + (predicate (car (find-definition-sources-by-name 'cl-user::three-p :function)))) + (values (and (equalp copier accessor) + (equalp copier predicate)) + (equal "test.lisp" + (file-namestring (definition-source-pathname copier))) + (equal '(5) + (definition-source-form-path copier)))) + t + t + t)