Mercurial > core / lisp/lib/rt/tests.lisp
changeset 632: |
bbd9024f2fe2 |
parent: |
83f8623a6ec3
|
child: |
74e563ed4537 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Sat, 31 Aug 2024 22:34:56 -0400 |
permissions: |
-rw-r--r-- |
description: |
lib/rt upgrades and refactoring |
2 (:use :cl :std :rt :sb-sprof :rt/flamegraph :rt/tracing :rt/cover :rt/bench)) 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 ()))) 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*))))))