Don't try to print highly nested forms for type errors.
[sbcl.git] / tests / time.pure.lisp
blob38a374f65c1c17762212dfc1217f172d8a8c9fa4
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; While most of SBCL is derived from the CMU CL system, the test
5 ;;;; files (like this one) were written from scratch after the fork
6 ;;;; from CMU CL.
7 ;;;;
8 ;;;; This software is in the public domain and is provided with
9 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
10 ;;;; more information.
12 (in-package "CL-USER")
14 ;;; Test for monotonicity of GET-INTERNAL-RUN-TIME. (On OpenBSD, this
15 ;;; is not a given, because of a longstanding bug in getrusage().)
16 (with-test (:name (get-internal-run-time :monotonic))
17 (checked-compile-and-assert (:optimize nil)
18 '(lambda (n-seconds)
19 (declare (type fixnum n-seconds))
20 (let* ((n-internal-time-units
21 (* n-seconds
22 internal-time-units-per-second))
23 (time0 (get-internal-run-time))
24 (time1 (+ time0 n-internal-time-units)))
25 (loop for time = (get-internal-run-time)
26 while (< time time1)
27 always (>= time time0))))
28 ((1) t)))
30 (with-test (:name (time :lambdas-converted))
31 (let ((output (with-output-to-string (*trace-output*)
32 (time (checked-compile '(lambda () 42))))))
33 (assert (search "1 lambda converted" output))))