* Based on patch by Pierre Mai.
* bug fix: restart computation during the execution of a restart
test function no longer causes infinite recursion. (reported by
Michael Weber)
+ * bug fix: calling SB-COVER:REPORT with a non-directory pathname now
+ signals an error. (thanks to Pierre Mai)
changes in sbcl-1.0.19 relative to 1.0.18:
* new feature: user-customizable variable SB-EXT:*MUFFLED-WARNINGS*;
(restore-coverage (read stream))))
(values)))
+(defun pathname-as-directory (pathname &optional (errorp t))
+ (let ((pathname (merge-pathnames pathname)))
+ (if (and (member (pathname-name pathname) '(nil :unspecific))
+ (member (pathname-type pathname) '(nil :unspecific)))
+ pathname
+ (if errorp
+ (error "~S does not designate a directory" pathname)
+ (make-pathname :directory (append (or (pathname-directory pathname)
+ (list :relative))
+ (list (file-namestring pathname)))
+ :name nil :type nil
+ :defaults pathname)))))
+
(defun report (directory &key ((:form-mode *source-path-mode*) :whole)
(external-format :default))
"Print a code coverage report of all instrumented files into DIRECTORY.
The former mode shows explicitly which forms were instrumented, while the
latter mode is generally easier to read."
(let ((paths)
- (*default-pathname-defaults* (merge-pathnames (pathname directory))))
+ (*default-pathname-defaults* (pathname-as-directory directory)))
(ensure-directories-exist *default-pathname-defaults*)
(maphash (lambda (k v)
(declare (ignore v))
(load (compile-file (merge-pathnames #p"test-data-1.lisp" *path*)))
(report-expect-failure)
-;;; Instrument the file, try again
+;;; Instrument the file, try again -- first with a non-directory pathname
(proclaim '(optimize sb-cover:store-coverage-data))
(load (compile-file (merge-pathnames #p"test-data-1.lisp" *path*)))
+(catch 'ok
+ (handler-case
+ (sb-cover:report #p"/tmp/foo")
+ (error ()
+ (throw 'ok nil)))
+ (error "REPORT with a non-pathname directory did not signal an error."))
+
(report)
(assert (probe-file (make-pathname :name "cover-index" :type "html"
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.19.7"
+"1.0.19.8"