Skip to content
Snippets Groups Projects
Commit 6ca5f330 authored by pfdietz's avatar pfdietz
Browse files

Enable macrolet in armedbear lisp. Make the size be randomly distributed from...

Enable macrolet in armedbear lisp.  Make the size be randomly distributed from 1..size rather than always be 'size'.
parent eea4a749
No related branches found
No related tags found
No related merge requests found
...@@ -28,14 +28,27 @@ ...@@ -28,14 +28,27 @@
;;; values, and results are collected. A list of all these discrepancies is returned ;;; values, and results are collected. A list of all these discrepancies is returned
;;; after testing finishes (assuming nothing breaks). ;;; after testing finishes (assuming nothing breaks).
;;; ;;;
;;; The variable *compile-unoptimized-form* controls whether the low optimization
;;; form is compiled, or if a form funcalling it is EVALed. The latter is often
;;; faster, and may find more problems since an interpreter and compiler may evaluate
;;; forms in very different ways.
;;;
;;; The rctest/ subdirectory contains fragments of a more OO random form generator ;;; The rctest/ subdirectory contains fragments of a more OO random form generator
;;; that will eventually replace this preliminary effort. ;;; that will eventually replace this preliminary effort.
;;; ;;;
;;; The file misc.lsp contains tests that were mostly for bugs found by this
;;; random tester in various Common Lisp implementations.
;;;
(declaim (special *optimized-fn-src* *unoptimized-fn-src* *int-form-vals* (declaim (special *optimized-fn-src* *unoptimized-fn-src* *int-form-vals*
*opt-result* *unopt-result* $x $y $z *opt-result* *unopt-result* $x $y $z
*compile-unoptimized-form*)) *compile-unoptimized-form*))
;;; Little functions used to run collected tests.
;;; (f i) runs the ith collected optimized test
;;; (g i) runs the ith collected unoptimized test
;;; (p i) prints the ith test (forms, input values, and other information)
(defun f (i) (let ((plist (elt $y i))) (defun f (i) (let ((plist (elt $y i)))
(apply (compile nil (getf plist :optimized-lambda-form)) (apply (compile nil (getf plist :optimized-lambda-form))
(getf plist :vals)))) (getf plist :vals))))
...@@ -56,6 +69,9 @@ ...@@ -56,6 +69,9 @@
(defparameter *loop-random-int-form-period* 2000) (defparameter *loop-random-int-form-period* 2000)
;;; Run the random tester, collecting failures into the special
;;; variable $y.
(defun loop-random-int-forms (&optional (size 200) (nvars 3)) (defun loop-random-int-forms (&optional (size 200) (nvars 3))
(unless (boundp '$x) (setq $x nil)) (unless (boundp '$x) (setq $x nil))
(unless (boundp '$y) (setq $y nil)) (unless (boundp '$y) (setq $y nil))
...@@ -149,7 +165,7 @@ ...@@ -149,7 +165,7 @@
(*random-int-form-catch-tags* nil) (*random-int-form-catch-tags* nil)
(*go-tags* nil) (*go-tags* nil)
) )
(make-random-integer-form size))) (make-random-integer-form (1+ (random size)))))
(vals-list (vals-list
(loop repeat *random-vals-list-bound* (loop repeat *random-vals-list-bound*
collect collect
...@@ -303,7 +319,6 @@ ...@@ -303,7 +319,6 @@
(1 `(cl:handler-bind nil ,(make-random-integer-form (1- size)))) (1 `(cl:handler-bind nil ,(make-random-integer-form (1- size))))
(1 `(restart-bind nil ,(make-random-integer-form (1- size)))) (1 `(restart-bind nil ,(make-random-integer-form (1- size))))
#-(or armedbear)
(1 `(macrolet () ,(make-random-integer-form (1- size)))) (1 `(macrolet () ,(make-random-integer-form (1- size))))
;; dotimes ;; dotimes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment