Commit e6f016aa authored by Daniel Kochmański's avatar Daniel Kochmański

makefile: run tests in sandbox/ directory

Signed-off-by: 's avatarDaniel Kochmański <daniel@turtleware.eu>
parent e93ee420
......@@ -70,7 +70,8 @@
(when *load-pathname*
(mapc #'regression-test:rem-test '(load-pathname.1 load-truename.1)))
(time (regression-test:do-tests))
(ext:chdir #P"sandbox/")
(time (regression-test:do-tests)))
#+allegro (cl-user::exit)
#+(or cmu sbcl gcl armedbear clisp) (cl-user::quit)
......@@ -6,23 +6,23 @@
(deftest directory.1
(directory "sample-files/nonexistent")
(directory "nonexistent")
nil)
(deftest directory.2
(directory #p"sample-files/nonexistent")
(directory #p"nonexistent")
nil)
(deftest directory.3
(directory "sample-files/nonexistent" :allow-other-keys nil)
(directory "nonexistent" :allow-other-keys nil)
nil)
(deftest directory.4
(directory "sample-files/nonexistent" :allow-other-keys t :foo 'bar)
(directory "nonexistent" :allow-other-keys t :foo 'bar)
nil)
(deftest directory.5
(directory "sample-files/nonexistent" :foo 0 :allow-other-keys t)
(directory "nonexistent" :foo 0 :allow-other-keys t)
nil)
(deftest directory.6
......@@ -62,7 +62,7 @@
(deftest directory.9
(do-special-strings
(s "sample-files/nonexistent" nil)
(s "nonexistent" nil)
(assert (null (directory s))))
nil)
......
......@@ -6,7 +6,7 @@
(deftest file-write-date.1
(let* ((pn "sample-files/file-write-date.txt")
(let* ((pn "file-write-date.txt")
(date (file-write-date pn))
(time (get-universal-time)))
(or (null date)
......@@ -16,7 +16,7 @@
t)
(deftest file-write-date.2
(let* ((pn #p"sample-files/file-write-date.txt")
(let* ((pn #p"file-write-date.txt")
(date (file-write-date pn))
(time (get-universal-time)))
(or (null date)
......@@ -26,7 +26,7 @@
t)
(deftest file-write-date.3
(let* ((pn (truename "sample-files/file-write-date.txt"))
(let* ((pn (truename "file-write-date.txt"))
(date (file-write-date pn))
(time (get-universal-time)))
(or (null date)
......@@ -47,13 +47,13 @@
nil)
(deftest file-write-date.5
(length (multiple-value-list (file-write-date "sample-files/file-write-date.txt")))
(length (multiple-value-list (file-write-date "file-write-date.txt")))
1)
;;; Specialized string tests
(deftest file-write-date.6
(let* ((str "sample-files/file-write-date.txt")
(let* ((str "file-write-date.txt")
(date (file-write-date str)))
(do-special-strings
(s str nil)
......@@ -70,7 +70,7 @@
t)
(deftest file-write-date.error.2
(signals-error (file-write-date "sample-files/file-write-date.txt" nil)
(signals-error (file-write-date "file-write-date.txt" nil)
program-error)
t)
......
......@@ -12,7 +12,7 @@ MAKE=make
test:
@rm -rf scratch
cat doit.lsp | $(LISP) | tee test.out
cd sandbox | cat doit.lsp | $(LISP) | tee test.out
test-symbols:
(cat doit1.lsp ; echo "(load \"load-symbols.lsp\")"; cat doit2.lsp) | $(LISP) | tee test-symbols.out
......
......@@ -7,7 +7,7 @@
(deftest directory-namestring.1
(let* ((vals (multiple-value-list
(directory-namestring "sample-files/directory-namestring.txt")))
(directory-namestring "directory-namestring.txt")))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
......@@ -18,7 +18,7 @@
(deftest directory-namestring.2
(do-special-strings
(s "sample-files/directory-namestring.txt" nil)
(s "directory-namestring.txt" nil)
(let ((ns (directory-namestring s)))
(assert (stringp ns))
(assert (string= (directory-namestring ns) ns))))
......@@ -31,7 +31,7 @@
;;; in which so much is left up to the implementation.)
#-lispworks
(deftest directory-namestring.3
(let* ((name "sample-files/directory-namestring.txt")
(let* ((name "directory-namestring.txt")
(pn (merge-pathnames (pathname name)))
(name2 (with-open-file (s pn :direction :input)
(directory-namestring s)))
......@@ -47,6 +47,6 @@
(deftest directory-namestring.error.2
(signals-error
(directory-namestring "sample-files/directory-namestring.txt" nil)
(directory-namestring "directory-namestring.txt" nil)
program-error)
t)
......@@ -7,7 +7,7 @@
(deftest enough-namestring.1
(let* ((vals (multiple-value-list
(enough-namestring "sample-files/enough-namestring.txt")))
(enough-namestring "enough-namestring.txt")))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
......@@ -18,14 +18,14 @@
(deftest enough-namestring.2
(do-special-strings
(s "sample-files/enough-namestring.txt" nil)
(s "enough-namestring.txt" nil)
(let ((ns (enough-namestring s)))
(assert (stringp ns))
(assert (string= (enough-namestring ns) ns))))
nil)
(deftest enough-namestring.3
(let* ((name "sample-files/enough-namestring.txt")
(let* ((name "enough-namestring.txt")
(pn (merge-pathnames (pathname name)))
(name2 (enough-namestring pn))
(name3 (enough-namestring name)))
......@@ -33,7 +33,7 @@
t)
(deftest enough-namestring.4
(let* ((name "sample-files/enough-namestring.txt")
(let* ((name "enough-namestring.txt")
(pn (merge-pathnames (pathname name)))
(name2 (with-open-file (s pn :direction :input) (enough-namestring s)))
(name3 (enough-namestring name)))
......@@ -42,7 +42,7 @@
(deftest enough-namestring.5
(let* ((vals (multiple-value-list
(enough-namestring "sample-files/enough-namestring.txt"
(enough-namestring "enough-namestring.txt"
*default-pathname-defaults*)))
(s (first vals)))
(if (and (null (cdr vals))
......@@ -54,7 +54,7 @@
(deftest enough-namestring.6
(let* ((vals (multiple-value-list
(enough-namestring "sample-files/enough-namestring.txt"
(enough-namestring "enough-namestring.txt"
(namestring *default-pathname-defaults*))))
(s (first vals)))
(if (and (null (cdr vals))
......@@ -68,7 +68,7 @@
(do-special-strings
(s (namestring *default-pathname-defaults*) nil)
(let* ((vals (multiple-value-list
(enough-namestring "sample-files/enough-namestring.txt" s)))
(enough-namestring "enough-namestring.txt" s)))
(s2 (first vals)))
(assert (null (cdr vals)))
(assert (stringp s2))
......@@ -83,7 +83,7 @@
(deftest enough-namestring.error.2
(signals-error
(enough-namestring "sample-files/enough-namestring.txt"
(enough-namestring "enough-namestring.txt"
*default-pathname-defaults* nil)
program-error)
t)
......@@ -5,7 +5,7 @@
(deftest file-namestring.1
(let* ((vals (multiple-value-list
(file-namestring "sample-files/file-namestring.txt")))
(file-namestring "file-namestring.txt")))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
......@@ -16,14 +16,14 @@
(deftest file-namestring.2
(do-special-strings
(s "sample-files/file-namestring.txt" nil)
(s "file-namestring.txt" nil)
(let ((ns (file-namestring s)))
(assert (stringp ns))
(assert (string= (file-namestring ns) ns))))
nil)
(deftest file-namestring.3
(let* ((name "sample-files/file-namestring.txt")
(let* ((name "file-namestring.txt")
(pn (merge-pathnames (pathname name)))
(name2 (with-open-file (s pn :direction :input)
(file-namestring s)))
......@@ -38,6 +38,6 @@
t)
(deftest file-namestring.error.2
(signals-error (file-namestring "sample-files/file-namestring.txt" nil)
(signals-error (file-namestring "file-namestring.txt" nil)
program-error)
t)
......@@ -7,7 +7,7 @@
(deftest host-namestring.1
(let* ((vals (multiple-value-list
(host-namestring "sample-files/host-namestring.txt")))
(host-namestring "host-namestring.txt")))
(s (first vals)))
(if (and (null (cdr vals))
(or (null s)
......@@ -20,7 +20,7 @@
(deftest host-namestring.2
(do-special-strings
(s "sample-files/host-namestring.txt" nil)
(s "host-namestring.txt" nil)
(let ((ns (host-namestring s)))
(when ns
(assert (stringp ns))
......@@ -29,7 +29,7 @@
nil)
(deftest host-namestring.3
(let* ((name "sample-files/host-namestring.txt")
(let* ((name "host-namestring.txt")
(pn (merge-pathnames (pathname name)))
(name2 (with-open-file (s pn :direction :input)
(host-namestring s)))
......@@ -44,6 +44,6 @@
t)
(deftest host-namestring.error.2
(signals-error (host-namestring "sample-files/host-namestring.txt" nil)
(signals-error (host-namestring "host-namestring.txt" nil)
program-error)
t)
......@@ -38,7 +38,7 @@
(deftest logical-pathname.error.3
(signals-error
(with-open-file (s #p"sample-files/logical-pathname.txt" :direction :input)
(with-open-file (s #p"logical-pathname.txt" :direction :input)
(logical-pathname s))
type-error)
t)
......
......@@ -10,21 +10,21 @@
t)
(deftest pathname.2
(equalt #p"sample-files/pathname.txt" (pathname "sample-files/pathname.txt"))
(equalt #p"pathname.txt" (pathname "pathname.txt"))
t)
(deftest pathname.3
(let ((s (open "sample-files/pathname.txt" :direction :input)))
(let ((s (open "pathname.txt" :direction :input)))
(prog1 (equalt (truename (pathname s))
(truename #p"sample-files/pathname.txt"))
(truename #p"pathname.txt"))
(close s)))
t)
(deftest pathname.4
(let ((s (open "sample-files/pathname.txt" :direction :input)))
(let ((s (open "pathname.txt" :direction :input)))
(close s)
(equalt (truename (pathname s))
(truename #p"sample-files/pathname.txt")))
(truename #p"pathname.txt")))
t)
(deftest pathname.5
......@@ -33,41 +33,41 @@
t)
(deftest pathname.6
(equalt #p"sample-files/pathname.txt"
(equalt #p"pathname.txt"
(pathname
(make-array 25
:initial-contents "sample-files/pathname.txt"
:initial-contents "pathname.txt"
:element-type 'base-char)))
t)
(deftest pathname.7
(equalt #p"sample-files/pathname.txt"
(equalt #p"pathname.txt"
(pathname (make-array 28
:initial-contents "sample-files/pathname.txtXXX"
:initial-contents "pathname.txtXXX"
:element-type 'base-char
:fill-pointer 25)))
t)
(deftest pathname.8
(equalt #p"sample-files/pathname.txt"
(equalt #p"pathname.txt"
(pathname (make-array 25
:initial-contents "sample-files/pathname.txt"
:initial-contents "pathname.txt"
:element-type 'base-char
:adjustable t)))
t)
(deftest pathname.9
(equalt #p"sample-files/pathname.txt"
(equalt #p"pathname.txt"
(pathname (make-array 28
:initial-contents "sample-files/pathname.txtXXX"
:initial-contents "pathname.txtXXX"
:element-type 'character
:fill-pointer 25)))
t)
(deftest pathname.10
(equalt #p"sample-files/pathname.txt"
(equalt #p"pathname.txt"
(pathname (make-array 25
:initial-contents "sample-files/pathname.txt"
:initial-contents "pathname.txt"
:element-type 'character
:adjustable t)))
t)
......@@ -75,11 +75,11 @@
(deftest pathname.11
(loop for etype in '(standard-char base-char character)
collect
(equalt #p"sample-files/pathname.txt"
(equalt #p"pathname.txt"
(pathname
(let* ((s (make-array 28
:initial-contents
"XXsample-files/pathname.txtX"
"XXpathname.txtX"
:element-type etype)))
(make-array 25
:element-type etype
......
......@@ -11,7 +11,7 @@
(deftest file-length.error.2
(signals-error
(with-open-file (is "sample-files/file-length.txt" :direction :input)
(with-open-file (is "file-length.txt" :direction :input)
(file-length is nil))
program-error)
t)
......@@ -37,7 +37,7 @@
(deftest file-length.error.5
(signals-error
(with-open-file
(is "sample-files/file-length.txt" :direction :input)
(is "file-length.txt" :direction :input)
(with-open-file
(os "tmp.txt" :direction :output :if-exists :supersede)
(let ((s (make-two-way-stream is os)))
......@@ -48,7 +48,7 @@
(deftest file-length.error.6
(signals-error
(with-open-file
(is "sample-files/file-length.txt" :direction :input)
(is "file-length.txt" :direction :input)
(with-open-file
(os "tmp.txt" :direction :output :if-exists :supersede)
(let ((s (make-echo-stream is os)))
......@@ -71,7 +71,7 @@
(deftest file-length.error.10
(signals-error
(with-open-file
(is "sample-files/file-length.txt" :direction :input)
(is "file-length.txt" :direction :input)
(let ((s (make-concatenated-stream is)))
(unwind-protect (file-length s) (close s))))
type-error)
......@@ -94,7 +94,7 @@
(deftest file-length.1
(let ((results (multiple-value-list
(with-open-file
(is "sample-files/file-length.txt" :direction :input)
(is "file-length.txt" :direction :input)
(file-length is)))))
(and (= (length results) 1)
(typep (car results) '(integer 1))
......@@ -167,7 +167,7 @@
(deftest file-length.6
(with-open-file
(*foo* "sample-files/file-length.txt" :direction :input)
(*foo* "file-length.txt" :direction :input)
(declare (special *foo*))
(let ((s (make-synonym-stream '*foo*)))
(unwind-protect
......
......@@ -6,12 +6,12 @@
(in-package :cl-test)
(deftest file-position.1
(with-open-file (is "sample-files/file-position.txt":direction :input)
(with-open-file (is "file-position.txt":direction :input)
(file-position is))
0)
(deftest file-position.2
(with-open-file (is "sample-files/file-position.txt":direction :input)
(with-open-file (is "file-position.txt":direction :input)
(values
(multiple-value-list
(notnot-mv (file-position is :start)))
......@@ -20,7 +20,7 @@
(t) 0)
(deftest file-position.3
(with-open-file (is "sample-files/file-position.txt":direction :input)
(with-open-file (is "file-position.txt":direction :input)
(values
(multiple-value-list
(notnot-mv (file-position is :end)))
......@@ -29,7 +29,7 @@
(deftest file-position.4
(with-open-file
(is "sample-files/file-position.txt":direction :input)
(is "file-position.txt":direction :input)
(values
(file-position is)
(read-char is)
......@@ -149,7 +149,7 @@
(deftest file-position.error.3
(signals-error
(with-open-file
(is "sample-files/file-position.txt" :direction :input)
(is "file-position.txt" :direction :input)
(flet ((%fail () (error 'type-error)))
(unless (file-position is :end) (%fail))
(let ((fp (file-position is)))
......@@ -161,7 +161,7 @@
(deftest file-position.error.4
(signals-error
(with-open-file
(is "sample-files/file-position.txt" :direction :input)
(is "file-position.txt" :direction :input)
(file-position is 1000000000000000000000))
error)
t)
......
......@@ -14,7 +14,7 @@
t)
(deftest input-stream-p.3
(with-open-file (s "sample-files/input-stream-p.txt" :direction :input)
(with-open-file (s "input-stream-p.txt" :direction :input)
(notnot-mv (input-stream-p s)))
t)
......
......@@ -39,7 +39,7 @@
(deftest listen.7
(with-open-file
(s "sample-files/listen.txt")
(s "listen.txt")
(values
(notnot (listen s))
(handler-case
......
......@@ -16,7 +16,7 @@
nil)
(deftest open-stream-p.2
(with-open-file (s "sample-files/open-stream-p.txt" :direction :input)
(with-open-file (s "open-stream-p.txt" :direction :input)
(notnot-mv (open-stream-p s)))
t)
......@@ -27,7 +27,7 @@
t)
(deftest open-stream-p.4
(let ((s (open "sample-files/open-stream-p.txt" :direction :input)))
(let ((s (open "open-stream-p.txt" :direction :input)))
(close s)
(open-stream-p s))
nil)
......
......@@ -14,7 +14,7 @@
t)
(deftest output-stream-p.3
(with-open-file (s "sample-files/output-stream-p.txt" :direction :input)
(with-open-file (s "output-stream-p.txt" :direction :input)
(output-stream-p s))
nil)
......
......@@ -64,86 +64,86 @@
(funcall funname)))))))
(deftest compile-file.1
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1) t nil)
(deftest compile-file.2
(compile-file-test "sample-files/compile-file-test-file-2.lsp"
(compile-file-test "compile-file-test-file-2.lsp"
'compile-file-test-fun.2
:expect-style-warnings t)
t nil)
(deftest compile-file.2a
(compile-file-test "sample-files/compile-file-test-file-2a.lsp"
(compile-file-test "compile-file-test-file-2a.lsp"
'compile-file-test-fun.2a
:expect-warnings t)
t nil)
(deftest compile-file.3
(let ((*package* (find-package "CL-TEST")))
(compile-file-test "sample-files/compile-file-test-file-3.lsp"
(compile-file-test "compile-file-test-file-3.lsp"
'compile-file-test-fun.3)) t nil)
(deftest compile-file.4
(let ((*package* (find-package "CL-USER")))
(compile-file-test "sample-files/compile-file-test-file-3.lsp"
(compile-file-test "compile-file-test-file-3.lsp"
'cl-user::compile-file-test-fun.3)) t nil)
(deftest compile-file.5
(compile-file-test #p"sample-files/compile-file-test-file.lsp"
(compile-file-test #p"compile-file-test-file.lsp"
'compile-file-test-fun.1) t nil)
(deftest compile-file.6
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:output-file "foo.fasl")
t nil)
(deftest compile-file.6a
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:output-file "foo.ufsl")
t nil)
(deftest compile-file.7
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:external-format :default)
t nil)
(deftest compile-file.8
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:output-file #p"foo.fasl")
t nil)
(deftest compile-file.9
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:print t)
t nil)
(deftest compile-file.10
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:verbose t)
t nil)
(deftest compile-file.11
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:print nil)
t nil)
(deftest compile-file.12
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:verbose nil)
t nil)
;;; A file stream is a pathname designator
(deftest compile-file.13
(with-open-file (s "sample-files/compile-file-test-file.lsp" :direction :input)
(with-open-file (s "compile-file-test-file.lsp" :direction :input)
(compile-file-test s 'compile-file-test-fun.1))
t nil)
......@@ -151,7 +151,7 @@
(let ((s (open "foo.fasl" :direction :output :if-exists :supersede
:if-does-not-exist :create)))
(close s)
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:output-file s))
t nil)
......@@ -159,13 +159,13 @@
(deftest compile-file.15
(let ((*readtable* (copy-readtable nil)))
(set-macro-character #\! (get-macro-character #\'))
(compile-file-test "sample-files/compile-file-test-file-4.lsp"
(compile-file-test "compile-file-test-file-4.lsp"
'compile-file-test-fun.4)) t foo)
;;; Tests for *compile-file-truename*, *compile-file-pathname*
(deftest compile-file.16
(let* ((file #p"sample-files/compile-file-test-file-5.lsp")
(let* ((file #p"compile-file-test-file-5.lsp")
(target-pathname (compile-file-pathname file))
(*compile-print* nil)
(*compile-verbose* nil))
......@@ -193,19 +193,19 @@
(let ((file (logical-pathname "CLTEST:COMPILE-FILE-TEST-LP.OUT")))
(with-open-file
(s file :direction :output :if-exists :supersede :if-does-not-exist :create))
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:output-file file))
t nil)
(deftest compile-file.19
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:*compile-verbose* t)
t nil)
(deftest compile-file.20
(compile-file-test "sample-files/compile-file-test-file.lsp"
(compile-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:*compile-print* t)
t nil)
......@@ -221,7 +221,7 @@
;;; Error cases
(deftest compile-file.error.1
(signals-error (compile-file "sample-files/nonexistent-file-to-compile.lsp")
(signals-error (compile-file "nonexistent-file-to-compile.lsp")
file-error) t)
(deftest compile-file.error.2
......
......@@ -36,11 +36,11 @@
(funcall funname))))
(deftest load.1
(load-file-test "sample-files/compile-file-test-file.lsp"
(load-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1) t nil)
(deftest load.2
(load-file-test #p"sample-files/compile-file-test-file.lsp"
(load-file-test #p"compile-file-test-file.lsp"
'compile-file-test-fun.1) t nil)
(deftest load.3
......@@ -50,25 +50,25 @@
t good)
(deftest load.4
(load-file-test "sample-files/compile-file-test-file.lsp"
(load-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:external-format :default)
t nil)
(deftest load.5
(load-file-test "sample-files/compile-file-test-file.lsp"
(load-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1
:verbose t)
t nil)
(deftest load.6
(load-file-test "sample-files/compile-file-test-file.lsp"
(load-file-test "compile-file-test-file.lsp"
'compile-file-test-fun.1