Skip to content
Snippets Groups Projects
Commit 627f1e35 authored by pfdietz's avatar pfdietz
Browse files

Enhance tests of print, verbose

parent 8274417a
No related branches found
No related tags found
No related merge requests found
...@@ -5,14 +5,17 @@ ...@@ -5,14 +5,17 @@
(in-package :cl-test) (in-package :cl-test)
(defun compile-file-test (file funname &rest args &key expect-warnings (defun compile-file-test (file funname &rest args &key
expect-warnings
expect-style-warnings output-file expect-style-warnings output-file
print verbose external-format) (print nil print-p)
(declare (ignorable verbose external-format)) (verbose nil verbose-p)
(*compile-print* nil)
(*compile-verbose* nil)
external-format)
(declare (ignorable external-format))
(let* ((target-pathname (or output-file (let* ((target-pathname (or output-file
(compile-file-pathname file))) (compile-file-pathname file)))
(*compile-print* nil)
(*compile-verbose* nil)
(actual-warnings-p nil) (actual-warnings-p nil)
(actual-style-warnings-p nil)) (actual-style-warnings-p nil))
(when (probe-file target-pathname) (when (probe-file target-pathname)
...@@ -27,7 +30,6 @@ ...@@ -27,7 +30,6 @@
nil)) nil))
((or error warning) ((or error warning)
#'(lambda (c) #'(lambda (c)
(declare (ignore c))
(unless (typep c 'style-warning) (unless (typep c 'style-warning)
(setf actual-warnings-p t)) (setf actual-warnings-p t))
nil))) nil)))
...@@ -41,8 +43,13 @@ ...@@ -41,8 +43,13 @@
(print (namestring (truename target-pathname))) (print (namestring (truename target-pathname)))
(print (namestring output-truename)) (print (namestring output-truename))
(values (values
(let ((v1 (or print verbose (string= str ""))) (let ((v1 (or print verbose
(v2 (or (not verbose) (position #\; str))) (and (not print-p) *compile-print*)
(and (not verbose-p) *compile-verbose*)
(string= str "")))
(v2 (or (and verbose-p (not verbose))
(and (not verbose-p) (not *compile-verbose*))
(position #\; str)))
(v3 (if actual-warnings-p failure-p t)) (v3 (if actual-warnings-p failure-p t))
(v4 (if expect-warnings failure-p t)) (v4 (if expect-warnings failure-p t))
(v5 (if expect-style-warnings warnings-p t)) (v5 (if expect-style-warnings warnings-p t))
...@@ -180,8 +187,15 @@ ...@@ -180,8 +187,15 @@
:output-file file)) :output-file file))
t nil) t nil)
(deftest compile-file.19
(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 "compile-file-test-file.lsp" 'compile-file-test-fun.1
:*compile-print* t)
t nil)
(deftest compile-file-pathname.1 (deftest compile-file-pathname.1
*compile-file-pathname* *compile-file-pathname*
......
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