Improve Makefile “test”, add general TEST package

This commit is contained in:
Jaidyn Ann 2024-06-22 17:44:08 -05:00
parent bf404c7605
commit 373f8a1194
3 changed files with 34 additions and 10 deletions

View File

@ -8,6 +8,7 @@
:author "Jaidyn Ann <jadedctrl@posteo.at>"
:homepage "https://hak.xwx.moe/jadedctrl/activitypub-servist"
:in-order-to ((test-op (test-op "activitypub/tests")))
:depends-on ("activitypub-servist/signatures"
"alexandria" "clack" "dexador"
"local-time" "purl" "str" "webtentacle" "yason")
@ -21,6 +22,7 @@
:author "Jaidyn Ann <jadedctrl@posteo.at>"
:homepage "https://hak.xwx.moe/jadedctrl/activitypub-servist"
:in-order-to ((test-op (test-op "activitypub/tests/activity-vocabulary")))
:depends-on ("alexandria" "closer-mop" "str" "yason")
:components ((:file "src/activity-vocabulary")))
@ -32,6 +34,7 @@
:author "Jaidyn Ann <jadedctrl@posteo.at>"
:homepage "https://hak.xwx.moe/jadedctrl/activitypub-servist"
:in-order-to ((test-op (test-op "activitypub/tests/signatures")))
:depends-on ("cl-base64" "flexi-streams" "inferior-shell" "ironclad" "str")
:components ((:file "src/signatures")))
@ -59,10 +62,23 @@
:components ((:file "t/signatures")))
(asdf:defsystem "activitypub-servist/tests"
:version "0.0"
:license "AGPLv3"
:author "Jaidyn Ann <jadedctrl@posteo.at>"
:description "Tests for all activitypub-servist subpacakges."
:depends-on (:activitypub-servist/tests/activity-vocabulary
:activitypub-servist/tests/signatures
:alexandria :lisp-unit2)
:components ((:file "t/t")))
;; Following method tweaked from lisp-unit2s documentation:
;; https://github.com/AccelerationNet/lisp-unit2/blob/master/README.md#asdf
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system :activitypub-servist/tests/activity-vocabulary))))
(eval (read-from-string "(activtiypub-servist/tests/activity-vocabulary:run)")))
(defmacro define-asdf-testing (package)
`(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system ',package))))
(eval (read-from-string (format nil "(~A:run-with-summary)" ',package)))))
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system :activitypub-servist/tests/signatures))))
(eval (read-from-string "(activtiypub-servist/tests/signatures:run)")))
(define-asdf-testing activitypub-servist/tests/activity-vocabulary)
(define-asdf-testing activitypub-servist/tests/signatures)
(define-asdf-testing activitypub-servist/tests)

View File

@ -18,14 +18,18 @@
(defpackage :activitypub-servist/tests/activity-vocabulary
(:use :cl :lisp-unit2)
(:nicknames "AP-S/T/AV")
(:export :run))
(:export :run :run-with-summary))
(in-package :activitypub-servist/tests/activity-vocabulary)
(defun run ()
"Run all ACTIVITY-VOCABULARY tests."
(lisp-unit2:with-summary ()
(lisp-unit2:run-tests :package :activitypub-servist/tests/activity-vocabulary)))
(lisp-unit2:run-tests :package :activitypub-servist/tests/activity-vocabulary))
(defun run-with-summary ()
"Run tests with summary for ACTIVITY-VOCABULARY."
(lisp-unit2:with-summary()
(run)))

View File

@ -18,14 +18,18 @@
(defpackage :activitypub-servist/tests/signatures
(:use :cl :lisp-unit2)
(:nicknames "AP-S/T/S")
(:export :run))
(:export :run :run-with-summary))
(in-package :activitypub-servist/tests/signatures)
(defun run ()
"Run all SIGNATURES tests."
(lisp-unit2:with-summary ()
(lisp-unit2:run-tests :package :activitypub-servist/tests/signatures)))
(lisp-unit2:run-tests :package :activitypub-servist/tests/signatures))
(defun run-with-summary ()
"Run tests with summary for SIGNATURES."
(lisp-unit2:with-summary()
(run)))