Blame


1 3c0eb591 2024-11-30 lh (defpackage #:aoc-test/all
2 3c0eb591 2024-11-30 lh (:use #:cl #:lisp-unit2)
3 3c0eb591 2024-11-30 lh (:nicknames #:aoc-test)
4 3c0eb591 2024-11-30 lh (:import-from #:aoc-test/utils)
5 3c0eb591 2024-11-30 lh (:export
6 3c0eb591 2024-11-30 lh #:test-day
7 3c0eb591 2024-11-30 lh #:test-all))
8 3c0eb591 2024-11-30 lh (in-package #:aoc-test/all)
9 3c0eb591 2024-11-30 lh
10 3c0eb591 2024-11-30 lh (defun test-day (&optional (day (aoc:today)))
11 3c0eb591 2024-11-30 lh (run-tests :package (format nil "AOC-TEST/DAY-~A" day)
12 3c0eb591 2024-11-30 lh :run-contexts 'with-summary-context))
13 3c0eb591 2024-11-30 lh
14 3c0eb591 2024-11-30 lh ;; TODO: the recursive asdf/ql stuff might not be so great here
15 3c0eb591 2024-11-30 lh (defun test-all ()
16 3c0eb591 2024-11-30 lh (run-tests :tests (nconc
17 3c0eb591 2024-11-30 lh (get-tests :package '#:aoc-test/utils)
18 3c0eb591 2024-11-30 lh (loop for day from 1 to 25
19 3c0eb591 2024-11-30 lh for system-name = (format nil "aoc-test/day-~A" day)
20 3c0eb591 2024-11-30 lh for system = (asdf:find-system system-name nil)
21 3c0eb591 2024-11-30 lh when system
22 3c0eb591 2024-11-30 lh do (ql:quickload system-name)
23 3c0eb591 2024-11-30 lh and nconc (get-tests :package (string-upcase system-name))))
24 3c0eb591 2024-11-30 lh :run-contexts 'with-summary-context))