diff options
Diffstat (limited to 'test/all.lisp')
| -rw-r--r-- | test/all.lisp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/all.lisp b/test/all.lisp new file mode 100644 index 0000000..b0a731b --- /dev/null +++ b/test/all.lisp | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | ;; SPDX-License-Identifier: EUPL-1.2 | ||
| 2 | ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs <perkontevs@gmail.com> | ||
| 3 | (defpackage :ukkoclot/test/all | ||
| 4 | (:documentation "Main test runner package.") | ||
| 5 | (:use :c2cl :fiveam | ||
| 6 | :ukkoclot/test/rw-lock) | ||
| 7 | (:import-from :bt2 :with-timeout) | ||
| 8 | (:import-from :uiop) | ||
| 9 | (:export #:*should-quit* #:run-tests)) | ||
| 10 | (in-package :ukkoclot/test/all) | ||
| 11 | |||
| 12 | (defvar *should-quit* nil | ||
| 13 | "Bind as true if `run-tests' should exit the process with 0 or 1. | ||
| 14 | |||
| 15 | Useful for CI.") | ||
| 16 | |||
| 17 | ;; TODO: Maybe I should signal on failure instead :thinking: | ||
| 18 | (defun run-tests () | ||
| 19 | "Run all tests" | ||
| 20 | (with-timeout (100) | ||
| 21 | (let ((status (run-all-tests))) | ||
| 22 | (when *should-quit* | ||
| 23 | (format t "~2&BTW Ignore the fatal ERROR condition below") | ||
| 24 | (cond | ||
| 25 | (status (format t "~&!GREAT SUCCESS!~2%") | ||
| 26 | (uiop:quit 0)) | ||
| 27 | (t (format t "~&!!! TESTS R FUCKED MATE !!!~2%") | ||
| 28 | (uiop:quit 1))))))) | ||