Mercurial > core / lisp/lib/rt/tests.lisp
changeset 698: |
96958d3eb5b0 |
parent: |
74e563ed4537
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
2 (:use :cl :std :rt :sb-sprof :rt/flamegraph :rt/tracing :rt/cover :rt/bench :rt/fuzz)) 9 (deftest rt (:profile t :persist t) 10 (with-fixture (fx (:tmp :directory "/tmp/")) 12 (signals (error t) (test-form (make-instance 'test-result)))) 14 (deftest flamegraph (:profile t) 15 (let ((f "/tmp/test.txt")) ;; open with https://speedscope.app or 16 ;; output svg with flamegraph.pl >> 18 (save-flamegraph (f :sample-interval 0.001 :show-progress t :report :flat) 19 (loop for x from 0 to 1000 24 (deftest tracing (:profile t :skip t) ;; fails in x 25 (let ((f "/tmp/tracing.json") 26 (*default-arg-converter* +arg-converter-store-only-simple-objects-and-strings+)) ;; open with chrome://tracing 28 (let ((v0 (make-bit-vector 256)) 29 (v1 (make-bit-vector 256 1))) 32 collect (list y (+ i x)))))) 35 (dotimes (i 100) (foo i)) 40 (deftest cover (:profile t) 46 (is (null (with-tmp-directory ()))) 47 (is (null (with-tmp-file (file)))) 48 (is (with-tmp-file (f1 :name "temporary-file") 49 (is (probe-file *tmp*)) 50 (write-string "1 2 3 4" f1) 52 (is (= 7 (file-length f1))))) 53 (is (with-tmp-directory ("foobar") 54 (is (directory-path-p (probe-file *tmp*)))))) 57 (defclass foo-fuzz (fuzzer) ()) 59 (fuzz (make-instance 'foo-fuzz)))) 60 (is (= 100 (length (fuzz* (make-random-state) (fuzz-generator (make-instance 'foo-fuzz)) :count 100)))))