Commit f360ce0e authored by Vladimir Sedach's avatar Vladimir Sedach

Changed test runner to use asdf:test-system and conditions for reporting

parent 8470929a
#!/usr/local/bin/sbcl --script
;;; roughly in order of how long the tests take to run
(defvar implementations '("sbcl-bin" "ccl-bin" "allegro" "clisp"
(defvar implementations '("sbcl-bin" "clisp" "ccl-bin" "allegro"
"ecl" "abcl-bin"))
(let ((installed (with-output-to-string (out)
......@@ -29,11 +29,10 @@
(terpri)
(uiop:quit 1))))
(ql:quickload \"uri-template2/test\")
(setq fiveam:*print-names* nil)
(let ((fiveam:*test-dribble* uiop:*stderr*)
(test-results (fiveam:run :uri-template2)))
(unless (fiveam:results-status test-results)
(fiveam:explain! test-results)
(handler-case
(asdf:test-system \"uri-template2\")
(uri-template2/test:suite-failure (condition)
(princ condition uiop:*stderr*)
(uiop:quit 1)))")
;;; make sure ASDF is loading the system from the current directory
......
......@@ -19,12 +19,33 @@
;;; <https://www.gnu.org/licenses/>.
(defpackage #:uri-template2/test
(:use #:cl #:uri-template2 #:named-readtables #:fiveam))
(:use #:cl #:uri-template2 #:named-readtables #:fiveam)
(:export #:run-tests #:suite-failure))
(in-package #:uri-template2/test)
(in-readtable uri-template)
(define-condition suite-failure (warning)
((suite :initarg :suite
:reader suite-failure-suite)
(result-list :initarg :result-list
:reader suite-failure-result-list))
(:report (lambda (condition s)
(write-string "Error in suite " s)
(prin1 (suite-failure-suite condition) s)
(terpri s)
(let ((fiveam:*print-names* nil)
(fiveam:*test-dribble* s))
(fiveam:explain! (suite-failure-result-list condition))))))
(defun run-tests ()
(let ((test-results (fiveam:run :uri-template2)))
(or (fiveam:explain! test-results)
(signal 'suite-failure
:suite :uri-template2
:result-list test-results))))
(in-suite* :uri-template2)
(test interpolation3
......
;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
;;; -*- Mode: LISP; Syntax: COMMON-LISP; Base: 10; indent-tabs-mode: nil -*-
(asdf:defsystem "uri-template2"
(defsystem "uri-template2"
:description "An implementation of the URI Template proposed standard draft version 01."
:long-description "An implementation of the URI Template proposed standard draft version 01. Lets you easily create and parse URIs by using the URI Template reader macro syntax."
:author "Vladimir Sedach <vas@oneofus.la>"
......@@ -14,9 +14,10 @@
)
:in-order-to ((test-op (test-op "uri-template2/test"))))
(asdf:defsystem "uri-template2/test"
(defsystem "uri-template2/test"
:license "GPL-3.0-or-later"
:depends-on ("uri-template2" "fiveam")
:serial t
:components ((:file "test"))
:perform (test-op (o c) (symbol-call :fiveam '#:run! :uri-template2)))
:perform (test-op (o c)
(uiop:symbol-call :uri-template2/test '#:run-tests)))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment