On 10/14/12 Oct 14 -5:25 AM, Juan Jose Garcia-Ripoll wrote:
They seem to be executed as soon as one loads them. However, the fact that a variable is only set _after_ the test suite is loaded, with
(defmethod perform :after ((op load-op) (comp (eql (find-system :cl-json.test)))) (eval `(setf ,(intern (symbol-name '#:*json-test-files-path*) :json-test) (merge-pathnames "t/" *cl-json-directory*))))
means that a whole bunch of tests fail because late ASDF seems to only perform load-op on the system _after_ it has loaded all its components. A better, more robust way of doing this, which does not depend on ASDF's loading rules is adding this
(eval `(setf ,(intern (symbol-name '#:*json-test-files-path*) (or (find-package "JSON-TEST") (make-package "JSON-TEST"))) (merge-pathnames "t/" *cl-json-directory*)))
or, even better, split cl-json.asd into cl-json.asd and cl-json-test.asd to avoid that this side-effect happens for every user that loads cl-json.
Juanjo
-- Instituto de Física Fundamental, CSIC c/ Serrano, 113b, Madrid 28006 (Spain) http://juanjose.garciaripoll.googlepages.com
Attached is a darcs patch file that provides a fix for this. Instead of doing this in the ASDF system definition file, I moved this into the defvar (now DEFPARAMETER) for *JSON-TEST-FILES-PATH*. Bumped the patch number of the system.
I don't have permissions to apply this patch, though.
BTW, I find that two of the JSON-NUMBER tests fail on my copy of ECL (on Mac OS X). Do you by any chance have a suggested fix?
Cheers, r
On Sun, Oct 14, 2012 at 10:52 PM, Robert Goldman rpgoldman@sift.infowrote:
Attached is a darcs patch file that provides a fix for this. Instead of doing this in the ASDF system definition file, I moved this into the defvar (now DEFPARAMETER) for *JSON-TEST-FILES-PATH*. Bumped the patch number of the system.
I don't have permissions to apply this patch, though.
I've now applied it. Thanks to both of you! Cheers, Henrik