From: Nikodemus Siivola Date: Sat, 19 May 2012 14:09:12 +0000 (+0300) Subject: robustify COUNT-FULL-CALLS in the test suite X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=dc2b10f2cc464b6d0003c3adc4541c3895eebbd5;p=sbcl.git robustify COUNT-FULL-CALLS in the test suite Move it to compiler-test-utils.lisp, while at it. --- diff --git a/tests/compiler-test-util.lisp b/tests/compiler-test-util.lisp index f0745d2..352db70 100644 --- a/tests/compiler-test-util.lisp +++ b/tests/compiler-test-util.lisp @@ -17,6 +17,7 @@ (:export #:assert-consing #:assert-no-consing #:compiler-derived-type + #:count-full-calls #:find-value-cell-values #:find-code-constants #:find-named-callees @@ -110,3 +111,16 @@ (values warn fail))) (ignore-errors (delete-file lisp)) (ignore-errors (delete-file fasl))))) + +;; Pretty horrible, but does the job +(defun count-full-calls (name function) + (let ((code (with-output-to-string (s) + (disassemble function :stream s))) + (n 0)) + (with-input-from-string (s code) + (loop for line = (read-line s nil nil) + while line + when (and (search name line) + (search "#