abcl-asdf: repackage with sub systems; renable test suite

#+BEGIN_SRC lisp
    (asdf:test-system :abcl-asdf)
#+END_SRC

Move abcl-asdf tests over to PROVE.

PROVE currently needs to be special cased for newer ASDF version.
Install into Quicklisp local projects via:

#+BEGIN_SRC sh
    cd ~/quicklisp/local-projects && git clone https://github.com/easye/prove
#+END_SRC

Patch with <https://github.com/easye/prove> for open
<https://github.com/fukamachi/prove/pull/34>.
parent 6d0bc625
;;;; -*- Mode: LISP -*-
(in-package :cl-user)
(asdf:defsystem :abcl-asdf
:author "Mark Evenson"
:version "1.5.1"
:description "<> asdf:defsystem <urn:abcl.org/release/1.5.0/contrib/abcl-asdf#1.5.1>"
:version "1.6.0"
:description "<> asdf:defsystem <urn:abcl.org/release/1.5.0/contrib/abcl-asdf#1.6.0>"
:depends-on (jss)
:components
((:module packages :pathname ""
((:module package :pathname ""
:components
((:file "packages")))
((:file "package")))
(:module base :pathname ""
:components
((:file "abcl-asdf")
......@@ -16,30 +17,23 @@
:depends-on ("abcl-asdf"))
(:file "maven-embedder"
:depends-on ("abcl-asdf" "asdf-jar")))
:depends-on (packages))))
:depends-on (package)))
:in-order-to ((asdf:test-op (asdf:test-op abcl-asdf/test))))
(asdf:defsystem :abcl-asdf-test
(asdf:defsystem :abcl-asdf/test
:author "Mark Evenson"
:depends-on (abcl abcl-test-lisp abcl-asdf rt)
:components ((:module tests :serial t
:components ((:file "example")
(:file "maven")
(:file "test")))))
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system 'abcl-asdf-test))))
(funcall (intern (symbol-name 'run) 'abcl-asdf-test)))
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system 'abcl-asdf))))
(asdf:load-system :abcl-asdf-test)
(asdf:test-system :abcl-asdf-test))
;;; FIXME
#+nil
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system 'abcl-asdf))))
"Invoke tests with (asdf:test-system 'abcl-asdf)."
(asdf:load-system 'abcl)
(asdf:load-system 'abcl-test-lisp)
(asdf:load-system 'abcl-asdf-test)
(funcall (intern (symbol-name 'run) 'abcl-asdf-test)))
:description "<> asdf:defsystem <urn:abcl.org/release/1.5.0/contrib/abcl-asdf/test#1.6.0>"
:defsystem-depends-on (prove-asdf)
:depends-on (abcl-asdf ;; our dependencies
;; Actual testing framework
prove
log4j)
:components ((:module package :pathname "t/"
:components ((:file "package")))
(:module tests :pathname "t/" :serial t
:depends-on (package)
:components ((:test-file "log4j")
(:test-file "maven"))))
:perform (asdf:test-op (op c)
(uiop:symbol-call :prove-asdf 'run-test-system c)))
......@@ -363,8 +363,8 @@ hint."
(warn "No proxy specified in *MAVEN-HTTP-PROXY*")
(return-from make-proxy nil))
(let* ((p (pathname *maven-http-proxy*))
(scheme (sys::url-pathname-scheme p))
(authority (sys::url-pathname-authority p))
(scheme (ext:url-pathname-scheme p))
(authority (ext:url-pathname-authority p))
(host (if (search ":" authority)
(subseq authority 0 (search ":" authority))
authority))
......
(defpackage #:abcl-asdf
(:use :cl)
(in-package :cl-user)
(defpackage abcl-asdf
(:use cl)
(:export
;;; Public API
#:resolve
......@@ -34,6 +36,5 @@
#:*added-to-classpath*
#:*inhibit-add-to-classpath*))
(defpackage #:abcl-asdf-test
(:use :cl :abcl-asdf)
(:export #:run))
(in-package :abcl-asdf-test)
(in-package :abcl-asdf/test)
(defun test-LOG4J.2 ()
(diag
"Output a message to the Console.
Note: for users of SLIME, this will appear in the associated *inferior-lisp* buffer."
(#"configure" 'log4j.BasicConfigurator)
(#"info" (#"getRootLogger" 'log4j.Logger) "Kilroy wuz here."))
Note: for users of SLIME, this will appear in the associated *inferior-lisp* buffer.")
(rt:deftest LOG4j.2
(test-LOG4J.2)
t)
(plan 1)
(ok
(require :log4j)
(#"configure" 'log4j.BasicConfigurator)
(#"info" (#"getRootLogger" 'log4j.Logger) "Kilroy wuz here."))
(finalize)
......
#|
(abcl-asdf:resolve-dependencies "log4j" "log4j")
|#
(in-package :abcl-asdf/test)
(plan 4)
(ok
(diag "Testing local bootable Maven version.")
(diag (format nil
"~{~&~a~}" (multiple-value-list (ensure-mvn-version)))))
(ok
(let ((result (abcl-asdf:resolve-dependencies "log4j" "log4j")))
(and result
(diag (format nil"~&~A~%" result))
(type-p result 'cons))))
(ok
(abcl-asdf:resolve "org.abcl/abcl"))
(ok
(let ((result (abcl-asdf:resolve-dependencies "org.armedbear.lisp" "abcl")))
(and result
(format *standard-output* "~&~A~%" result)
(type-p result 'cons))))
(finalize)
(defpackage abcl-asdf/test
(:nicknames #:abcl-asdf-test)
(:use cl abcl-asdf prove))
;;;; -*- Mode: LISP -*-
(asdf:defsystem :log4j
:defsystem-depends-on (abcl-asdf)
:components ((:module log4j.jar :components
((:mvn "log4j/log4j/1.2.15")))
(:module source :pathname "" :components
((:file "example"))
:depends-on (log4j.jar))))
(defmethod perform ((o asdf:test-op) (s (eql (asdf:find-system :log4j))))
(asdf:load-system :log4j)
(eval (read-from-string "(cl-user::test-log4j.2)")))
#|
(abcl-asdf:resolve-dependencies "log4j" "log4j")
(abcl-asdf:resolve-dependencies "org.armedbear.lisp" "abcl")
|#
; TODO figure out what sort of test framework we can hook in. Probably ABCL-RT
(in-package :abcl-asdf-test)
(rt:deftest LOG4J.1
(let ((result (abcl-asdf:resolve-dependencies "log4j" "log4j")))
(and result
(format *standard-output* "~&~A~%" result)
(type-p result 'cons)))
t)
(rt:deftest ABCL.1
(let ((result (abcl-asdf:resolve-dependencies "org.armedbear.lisp" "abcl")))
(and result
(format *standard-output* "~&~A~%" result)
(type-p result 'cons)))
t)
(in-package :abcl-asdf-test)
(defun run (&rest args)
(abcl-rt:do-tests))
(rt:deftest ABCL-ASDF.MAVEN.1
(multiple-value-list (ensure-mvn-version))
(t (3 0 4)))
;;;; -*- Mode: LISP -*-
(asdf:defsystem :log4j
:defsystem-depends-on (abcl-asdf)
:components ((:module log4j.jar
:components ((:mvn "log4j/log4j")))))
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