sbcl.sbcl/cover-script.lisp
Christophe Rhodes 430495fb5f Allow compiling the system with coverage instrumentation
To build, pass `--with-sb-cover-for-internals` to make.sh

Test running scripts have been adapted; pass `--coverage` to
run-tests.sh and/or ansi-tests.sh to generate .coverage files, then
use a script like `cover-script.lisp` to generate a report.

Things that we need to fix:
- it's pretty slow (build time roughly doubles)
- the report is fairly ugly (and doesn't sort the sources in the way
  I would expect)
- it exposes some issue in combination with --with-sb-show
  Can't compute fixup relative to movable object
    #<code id=5419 [7] (FLET "PPRINT-BLOCK" :IN "SYS:SRC;CODE;WARM-ERROR.LISP") {1203AEC9BF..1203AED4A0}>
2025-11-21 18:25:03 +00:00

15 lines
658 B
Common Lisp

(require :sb-cover)
(load "src/cold/chill.lisp")
(require :sb-grovel) ; hack
(let* ((src (translate-logical-pathname "SYS:SRC;"))
(obj (merge-pathnames (make-pathname :directory '(:relative :back "obj" :wild-inferiors)
:name :wild :type :wild)
src)))
(push (list "SYS:OBJ;**;*.*.*" obj) ; hack
(logical-pathname-translations "SYS")))
(push :sb-bsd-sockets-addrinfo *features*) ; hack
(sb-cover:reset-coverage)
(map nil 'sb-cover:merge-coverage-from-file (directory "tests/*.coverage"))
(sb-cover:save-coverage-in-file "all-tests.coverage")
(sb-cover:report "/tmp/s/")