Enclose every test in the "TESTING" package.

This commit is contained in:
jjgarcia 2001-12-25 16:11:13 +00:00
parent b2cc15acfa
commit fcc26bd2c6
28 changed files with 66 additions and 18 deletions

View file

@ -4,6 +4,8 @@
;;; BOYER -- Logic programming benchmark, originally written by Bob Boyer.
;;; Fairly CONS intensive.
(in-package "TESTING")
(defvar **unify-subst**)
(defvar **temp-temp**)

View file

@ -4,6 +4,8 @@
;;; BROWSE -- Benchmark to create and browse through an AI-like data base
;;; of units.
(in-package "TESTING")
;;; n is # of symbols
;;; m is maximum amount of stuff on the plist
;;; npats is the number of basic patterns on the unit

View file

@ -3,6 +3,8 @@
;;; CTAK -- A version of the TAKeuchi function that uses the CATCH/THROW facility.
(in-package "TESTING")
(defun ctak (x y z)
(catch 'ctak (ctak-aux x y z)))

View file

@ -16,6 +16,8 @@
;;; property list of FOO under the indicator BAR, in this case. You may have
;;; to do something like:
(in-package "TESTING")
;;; :property keyword is not Common Lisp.
(defun dderiv-aux (a)

View file

@ -4,6 +4,8 @@
;;; DERIV -- Symbolic derivative benchmark written by Vaughn Pratt.
;;; It uses a simple subset of Lisp and does a lot of CONSing.
(in-package "TESTING")
(defun deriv-aux (a) (list '/ (deriv a) a))
(defun deriv (a)

View file

@ -6,7 +6,8 @@
;;mod: add fixnum declaration for n in the following let:
;; (let ((n (floor (the fixnum (length (car l1))) 2)))
(in-package "TESTING")
(defun destructive (n m)
(declare (type fixnum n m))
(let ((l (do ((i 10. (the fixnum (1- i)))

View file

@ -3,6 +3,8 @@
;; DESTRU -- Destructive operation benchmark
(in-package "TESTING")
(defun destructive (n m)
(declare (type fixnum n m))
(let ((l (do ((i 10. (the fixnum (1- i)))

View file

@ -4,6 +4,8 @@
;;; DIV2 -- Benchmark which divides by 2 using lists of n ()'s.
;;; This file contains a recursive as well as an iterative test.
(in-package "TESTING")
(defun create-n (n)
(declare (type fixnum n))
(do ((n n (the fixnum (1- n)))

View file

@ -4,6 +4,8 @@
;; FFT -- This is an FFT benchmark written by Harry Barrow.
;; It tests a variety of floating point operations, including array references.
(in-package "TESTING")
(defvar **fft-re**
(make-array 1025. :element-type
#+excl 'single-float #+lucid 'float #+KCL 'single-float

View file

@ -4,6 +4,8 @@
;; FFT -- This is an FFT benchmark written by Harry Barrow.
;; It tests a variety of floating point operations, including array references.
(in-package "TESTING")
(defvar **fft-re**
(make-array 1025. :element-type
#+excl 'single-float #+lucid 'float #+KCL 'single-float

View file

@ -3,6 +3,8 @@
;;; FPRINT -- Benchmark to print to a file.
(in-package "TESTING")
(defvar test-atoms '(abcdef12 cdefgh23 efghij34 ghijkl45 ijklmn56 klmnop67
mnopqr78 opqrst89 qrstuv90 stuvwx01 uvwxyz12
wxyzab23 xyzabc34 123456ab 234567bc 345678cd

View file

@ -5,6 +5,8 @@
;;; Pronounced "FRED". Requires the existance of FPRINT.TST which is created
;;; by FPRINT.
(in-package "TESTING")
(defun fread ()
(let ((stream (open "/tmp/fprint.tst" :direction :input)))
(read stream)

View file

@ -18,6 +18,8 @@
;; used to handle polynomial coefficients in a recursive
;; way. Declaring them global is the wrong approach.
(in-package "TESTING")
(defvar ans)
(defvar coef)
(defvar f)

View file

@ -18,6 +18,8 @@
;; used to handle polynomial coefficients in a recursive
;; way. Declaring them global is the wrong approach.
(in-package "TESTING")
(defvar ans)
(defvar coef)
(defvar f)

View file

@ -1,6 +1,8 @@
;; $Header$
;; $Locker$
(in-package "TESTING")
(eval-when (compile load eval)
(defconstant puzzle-size 511.)
(defconstant puzzle-classmax 3.)

View file

@ -1,6 +1,8 @@
;; $Header$
;; $Locker$
(in-package "TESTING")
(eval-when (compile load eval)
(defconstant puzzle-size 511.)
(defconstant puzzle-classmax 3.)

View file

@ -1,6 +1,8 @@
;; $Header$
;; $Locker$
(in-package "TESTING")
(eval-when (compile load eval)
(defconstant puzzle-size 511.)
(defconstant puzzle-classmax 3.)

View file

@ -1,6 +1,8 @@
;; $Header$
;; $Locker$
(in-package "TESTING")
(eval-when (compile load eval)
(defconstant puzzle-size 511.)
(defconstant puzzle-classmax 3.)

View file

@ -4,6 +4,8 @@
;;; STAK -- The TAKeuchi function with special variables instead of
;;; parameter passing.
(in-package "TESTING")
(defvar stak-x)
(defvar stak-y)
(defvar stak-z)

View file

@ -1,6 +1,8 @@
;; $Header$
;; $Locker$
(in-package "TESTING")
#+excl
(eval-when (compile) (setq comp::register-use-threshold 6))

View file

@ -1,6 +1,8 @@
;; $Header$
;; $Locker$
(in-package "TESTING")
#+excl
(eval-when (compile) (setq comp::register-use-threshold 6))

View file

@ -3,6 +3,8 @@
;;; TAKL -- The TAKeuchi function using lists as counters.
(in-package "TESTING")
(defun listn (n)
(declare (type fixnum n))
(if (not (= 0 n))

View file

@ -5,6 +5,8 @@
;;; memory effects. Results should be the same as for TAK on stack machines.
;;; Distribution of calls is not completely flat.
(in-package "TESTING")
(defun tak0 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)

View file

@ -3,6 +3,8 @@
;;; TPRINT -- Benchmark to print and read to the terminal.
(in-package "TESTING")
(defvar test-atoms '(abc1 cde2 efg3 ghi4 ijk5 klm6 mno7 opq8 qrs9
stu0 uvw1 wxy2 xyz3 123a 234b 345c 456d
567d 678e 789f 890g))

View file

@ -3,6 +3,7 @@
;;; TRAVERSE -- Benchmark which creates and traverses a tree structure.
(in-package "TESTING")
(eval-when (eval compile load)
(defstruct node

View file

@ -3,6 +3,8 @@
;;; TRIANG -- Board game benchmark.
(in-package "TESTING")
(defvar a)
(defvar b)
(defvar c)
@ -10,10 +12,10 @@
(defvar final)
(eval-when (eval compile)
(proclaim '(special board sequence a b c))
(proclaim '(special board sequence a b c))
(proclaim '(special board seq a b c))
(proclaim '(special board seq a b c))
(proclaim '(type (vector fixnum ) board))
(proclaim '(type (vector fixnum ) sequence))
(proclaim '(type (vector fixnum ) seq))
(proclaim '(type (vector fixnum ) a))
(proclaim '(type (vector fixnum ) b))
(proclaim '(type (vector fixnum ) c))
@ -26,7 +28,7 @@
(defun triang-setup ()
(setq board (make-array 16 :element-type 'fixnum :initial-element 1))
(setq sequence (make-array 14 :element-type 'fixnum :initial-element 0))
(setq seq (make-array 14 :element-type 'fixnum :initial-element 0))
(setq a
(make-array
37
@ -61,8 +63,8 @@
(let ((lp (last-position)))
(unless (member lp final :test #'eq)
(push lp final)))
;;; (format t "~&~s" (cdr (simple-vector-to-list sequence)))
(push (cdr (simple-vector-to-list sequence))
;;; (format t "~&~s" (cdr (simple-vector-to-list seq)))
(push (cdr (simple-vector-to-list seq))
answer) t) ; this is a hack to replace LISTARRAY
((and (eql 1 (aref board (aref a i)))
(eql 1 (aref board (aref b i)))
@ -70,7 +72,7 @@
(setf (aref board (aref a i)) 0)
(setf (aref board (aref b i)) 0)
(setf (aref board (aref c i)) 1)
(setf (aref sequence depth) i)
(setf (aref seq depth) i)
(do ((j 0 (the fixnum (+ j 1)))
(depth (the fixnum (+ depth 1))))
((or (= j 36)
@ -94,11 +96,5 @@
(try i 1)))
(defun testtriang ()
(declare (notinline cos aref))
(print (cos 1.0))
(triang-setup)
(print board)
(print (aref a 22))
(print (aref b 22))
(print (aref c 22))
(gogogo 22))

View file

@ -3,6 +3,8 @@
;;; TRIANG -- Board game benchmark.
(in-package "TESTING")
(proclaim '(special board sequence a b c))
(proclaim '(type (vector fixnum) a b c))

View file

@ -3,13 +3,15 @@
;;; TRIANG -- Board game benchmark.
(declaim (special board sequence a b c))
(in-package "TESTING")
(declaim (special board seq a b c))
(defvar answer)
(defvar final)
(defun triang-setup ()
(setq board (make-array 16 :initial-element 1))
(setq sequence (make-array 14 :initial-element 0))
(setq seq (make-array 14 :initial-element 0))
(setq a
(make-array
37
@ -39,7 +41,7 @@
(let ((lp (last-position)))
(unless (member lp final :test #'eq)
(push lp final)))
(push (cdr (simple-vector-to-list sequence))
(push (cdr (simple-vector-to-list seq))
answer) t) ; this is a hack to replace LISTARRAY
((and (eq 1 (svref board (svref a i)))
(eq 1 (svref board (svref b i)))
@ -47,7 +49,7 @@
(setf (svref board (svref a i)) 0)
(setf (svref board (svref b i)) 0)
(setf (svref board (svref c i)) 1)
(setf (svref sequence depth) i)
(setf (svref seq depth) i)
(do ((j 0 (the fixnum (+ j 1)))
(depth (the fixnum (+ depth 1))))
((or (= j 36)