-
Notifications
You must be signed in to change notification settings - Fork 0
/
do-test.lisp
64 lines (48 loc) · 1.98 KB
/
do-test.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#|
This file is a part of pddl-tools
(c) 2023 Robert P. Goldman and SIFT, LLC
Author: Robert P. Goldman <rpgoldman@sift.net>
|#
(in-package :common-lisp-user)
(defpackage test
(:use :common-lisp))
(in-package :test)
(let ((home-dir (user-homedir-pathname)))
(let ((path (uiop:ensure-directory-pathname home-dir)))
(load (merge-pathnames "quicklisp/setup.lisp" path))))
(push (namestring (uiop:pathname-directory-pathname *load-truename*)) ql:*local-project-directories*)
(ql:quickload "fiveam-asdf") ; without this, the ASDF defsystems don't load properly.
#+nil
(handler-case
(assert (uiop:pathname-equal (uiop:pathname-directory-pathname (asdf:component-pathname (asdf:find-system "pddl-utils")))
(uiop:pathname-directory-pathname *load-truename*)))
(error () (uiop:die 2 "Not loading PDDL-tools from the expected location: ~A instead of expected ~a."
(asdf:component-pathname (asdf:find-system "pddl-utils"))
)))
;;; check for clean build
(defmacro build-system (name)
`(handler-bind
((error #'(lambda (c) (uiop:die 3 "Failed to build ~a cleanly with error:~%~T~a" ,name c))))
(let ((asdf:*compile-file-failure-behaviour* :error)
(asdf:*compile-file-warnings-behaviour* :error))
(ql:quickload ,name :silent nil :verbose t))))
;;; these are done outside the bounds of BUILD-SYSTEM below, because
;;; CL-PPCRE doesn't build clean (at least on SBCL) and CL-JSON does not
;;; build clean on Allegro
(ql:quickload "cl-ppcre")
(ql:quickload "cl-json")
(build-system "pddl-utils")
(build-system "hddl-utils")
(build-system "hddl-to-json")
(ql:quickload "pddl-utils/tests")
(ql:quickload "hddl-utils/tests")
(ql:quickload "hddl-to-json/tests")
(defmacro test-system (name)
`(handler-case
(asdf:test-system ,name)
(fiveam-asdf:fiveam-test-fail ()
(uiop:quit 1))))
(test-system "pddl-utils")
(test-system "hddl-utils")
(test-system "hddl-to-json")
(uiop:quit 0)