changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/rt/pkg.lisp

changeset 698: 96958d3eb5b0
parent: 3dd1924ad5ea
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 ;;; pkg.lisp --- regression testing packages
2 
3 ;; Regression Testing framework. inspired by PCL, the original CMUCL
4 ;; code, and the SBCL port.
5 
6 ;;; Commentary:
7 
8 ;; - :rt https://www.merl.com/publications/docs/TR91-04.pdf Chapter 1
9 ;; - :com.gigamonkeys.test https://github.com/gigamonkey/monkeylib-test-framework
10 ;; - :sb-rt https://github.com/sbcl/sbcl/blob/master/contrib/sb-rt/rt.lisp
11 
12 ;; This package is intended to provide a modernized Lisp testing
13 ;; library with features found in some of the test frameworks listed
14 ;; below.
15 
16 ;; - :it.bese.fiveam https://github.com/lispci/fiveam
17 ;; - :try https://github.com/melisgl/try
18 ;; - :rove https://github.com/fukamachi/rove
19 
20 ;;; TODO:
21 #|
22 
23 - [ ] benchmark support: do-bench, test-count,
24 
25 - [ ] fixtures api
26 
27 - [ ] profiling
28 |#
29 ;;; Code:
30 (in-package :std-user)
31 (defpackage :rt
32  (:use
33  :cl :std :sxp :log
34  :sb-aprof)
35  (:export
36  :test-error
37  :*test-opts*
38  :*compile-tests*
39  :*catch-test-errors*
40  :*test-suffix*
41  :*default-test-suite-name*
42  :*test-suite*
43  :*test-suite-list*
44  ;; TODO 2023-09-04: :*test-profiler-list* not yet
45  :*testing*
46  :random-elt
47  :random-ref
48  :random-char
49  :random-chars
50  :random-bytes
51  :test-suite-designator
52  :check-suite-designator
53  :make-test
54  :make-suite
55  :test-name=
56  :do-test
57  :do-tests
58  :reset-tests
59  :continue-testing
60  :with-test-env
61  :%test-bail
62  :%test-result
63  :make-test-result
64  :ensure-suite
65  :test-fixture
66  :fixture-prototype
67  :make-fixture-prototype
68  :make-fixture
69  :with-fixture
70  :test-result
71  :test-fn
72  :test-pass-p
73  :test-fail-p
74  :test-skip-p
75  :test-failed
76  :fail!
77  :is
78  :signals
79  :deftest
80  :defsuite
81  :in-suite
82  :eval-test
83  :compile-test
84  :locked-tests
85  :push-test
86  :pop-test
87  :delete-test
88  :find-test
89  :find-suite
90  :do-suite
91  :test-object
92  :test
93  :test-fixture
94  :test-suite
95  :test-name
96  :tests
97  :test-form
98  :test-results
99  :*tmp*
100  :*default-tmp-directory*
101  :with-tmp-directory
102  :with-tmp-file))
103 
104 (defpackage :rt/bench
105  (:nicknames :bench)
106  (:use :cl :std :log :rt)
107  (:export
108  :*bench-count*
109  :defbench
110  :do-bench))
111 
112 (uiop:define-package :rt/cover
113  (:nicknames :cover)
114  (:use :cl :std :log :rt)
115  (:export
116  :with-coverage :start-coverage :stop-coverage
117  :*coverage-directory*
118  :coverage-report))
119 
120 (defpackage :rt/tracing
121  (:nicknames :tracing)
122  (:use :cl :std :log :rt)
123  (:export
124  :start-tracing
125  :stop-tracing
126  :with-tracing
127  :save-report
128  ;; Extra utility
129  :package-symbols-except))
130 
131 (defpackage :rt/flamegraph
132  (:nicknames :flamegraph)
133  (:use :cl :std :log :rt :sb-sprof)
134  (:export :save-flamegraph))
135 
136 (defpackage :rt/fuzz
137  (:nicknames :fuzz)
138  (:use :cl :std :log :rt)
139  (:export :fuzzer
140  :fuzz
141  :fuzz*
142  :fuzz-generator
143  :fuzz-state))