Coverage report: /home/ellis/comp/core/lib/rt/tests.lisp
Kind | Covered | All | % |
expression | 6 | 25 | 24.0 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; tests.lisp --- RT Tests
5
(:use :cl :std :rt :rt/flamegraph :rt/tracing :rt/cover :rt/bench :rt/fuzz))
10
:policy '(optimize sb-cover:store-coverage-data debug)
12
(make-fixture :tmp :name :fx1)))
17
(loop for x below input
18
collect (loop for y in (%foo x)
21
(deftest rt (:profile t :persist t)
22
(with-fixture (fx :tmp :directory "/tmp/")
23
(istype 'tmp-fixture fx))
24
(signals (error t) (test-form (make-instance 'test-result))))
26
(deftest flamegraph (:profile t :cover t)
27
(let ((f "/tmp/test.txt")) ;; open with https://speedscope.app or
28
;; output svg with flamegraph.pl >>
30
(with-flamegraph (f :sample-interval 0.00001 :show-progress t :report :flat)
35
(deftest tracing (:profile t)
36
(let ((f "/tmp/tracing.json")
37
(tracing::*default-arg-converter* tracing::+arg-converter-store-only-simple-objects-and-strings+)) ;; open with chrome://tracing
39
(with-tracing ("RT" "RT/TESTS")
45
(deftest cover (:profile t :skip t)
49
(deftest fixture (:fx "fx1")
53
(is (null (with-tmp-directory ())))
54
(is (null (with-tmp-file (file))))
55
(is (with-tmp-file (f1 :name "temporary-file")
56
(is (probe-file *tmp*))
57
(write-string "1 2 3 4" f1)
59
(is (= 7 (file-length f1)))))
60
(is (with-tmp-directory ("foobar")
61
(is (directory-path-p (probe-file *tmp*))))))
64
(defclass foo-fuzz (fuzzer) ())
66
(fuzz (make-instance 'foo-fuzz))))
67
(is (= 100 (length (fuzz* (make-random-state) (fuzz-generator (make-instance 'foo-fuzz)) :count 100)))))