:components ((:module "unit-tests"
:components ((:file "package")
- (:file "test*" :depends-on ("package"))))
+ (:file "test-graph" :depends-on ("package"))
+ (:file "test-graph-container" :depends-on ("test-graph"))
+ (:file "test-connected-components" :depends-on ("test-graph"))
+ (:file "test-graph-metrics" :depends-on ("test-graph"))
+ (:file "test-graph-algorithms" :depends-on ("test-graph"))
+ ))
(:module "dev"
:components ((:static-file "notes.text"))))
- :in-order-to ((test-op (load-op moptilities-test)))
-
- :perform (test-op :after (op c)
- (describe
- (funcall
- (intern (symbol-name '#:run-tests) '#:lift)
- :suite (intern (symbol-name '#:cl-graph-test) '#:cl-graph-test))))
+ :in-order-to ((test-op (load-op cl-graph-test)))
:depends-on (cl-graph lift))
;;; ---------------------------------------------------------------------------
-(defmethod operation-done-p
- ((o test-op)
- (c (eql (find-system 'moptilities-test))))
+(defmethod perform :after ((op test-op ) (c (eql (find-system 'cl-graph-test))))
+ (describe
+ (funcall
+ (intern (symbol-name '#:run-tests) '#:lift)
+ :suite (intern (symbol-name '#:cl-graph-test) '#:cl-graph-test))))
+
+;;; ---------------------------------------------------------------------------
+
+(defmethod perform :after ((o load-op) (c (eql (find-system 'cl-graph-test))))
+ )
+
+(defmethod operation-done-p ((o test-op) (c (eql (find-system 'cl-graph-test))))
+ ;; testing is never done...
(values nil))
--- /dev/null
+(in-package common-lisp-user)
+
+(defpackage #:cl-graph-test
+ (:use #:common-lisp #:cl-graph #:lift #:metatilities))
\ No newline at end of file
-(in-package metabang.graph)
+(in-package cl-graph-test)
(deftestsuite test-connected-component ()
())
-(in-package cl-graph)
+(in-package cl-graph-test)
(deftestsuite test-connected-components ()
())
;;; ---------------------------------------------------------------------------
+#+Ignore
(let ((graph (make-container 'graph-container)))
(loop for (a b) in '((r s) (r v) (s w) (t u) (t w) (t x)
(u y) (w x) (x y)) do
-(in-package metabang.graph)
+(in-package cl-graph-test)
;;; ---------------------------------------------------------------------------
;;; utilities
-(in-package metabang.graph)
+(in-package cl-graph-test)
;;; ---------------------------------------------------------------------------
-(in-package metabang.graph)
+(in-package cl-graph-test)
#|
(let ((g (make-container 'graph-container)))
(inspect g)))
|#
-(deftestsuite test-graph () ())
-
+(deftestsuite cl-graph-test () ())
(deftestsuite test-test-vertex () ())
(addtest (test-test-vertex)
test-1
- (bind ((x (float 2.1d0))
- (y (float 2.1d0))
- (g (make-container 'graph-container)))
+ (metatilities:bind ((x (float 2.1d0))
+ (y (float 2.1d0))
+ (g (make-container 'graph-container)))
(add-vertex g (+ x y))
(add-vertex g (+ x y))
;;; should do this for each _kind_ of graph
;;; ---------------------------------------------------------------------------
-(deftestsuite test-basic-graph-properties (test-graph)
+(deftestsuite test-basic-graph-properties (cl-graph-test)
((graph-undirected (make-container 'graph-container :default-edge-type :undirected))
(graph-directed (make-container 'graph-container :default-edge-type :directed)))
:setup ((loop for v in '(a b c d e) do
;;; ---------------------------------------------------------------------------
-(deftestsuite test-graph-traversal (test-graph)
+(deftestsuite cl-graph-test-traversal (cl-graph-test)
((g (make-container 'graph-container)))
:setup (loop for (src dst) in '((a b) (a c) (a d) (b e)
(b f) (d g) (d h) (h i)
|#
-(addtest (test-graph-traversal)
+(addtest (cl-graph-test-traversal)
(let ((result nil))
(traverse-elements
g :depth (lambda (v) (push (element v) result)))
;;; ---------------------------------------------------------------------------
-(addtest (test-graph-traversal)
+(addtest (cl-graph-test-traversal)
(let ((result nil))
(traverse-elements
g :breadth (lambda (v) (push (element v) result)))