fix-test-after-method-bug-from-juanjo
Sun Oct 14 13:38:47 PDT 2012 rpgoldman@sift.info
* fix-test-after-method-bug-from-juanjo
juanjo (Juan Jose Garcia-Ripoli) found a bug in the binding of the
*JSON-TEST-FILES-PATH* global. Fixed by moving the initializer into
the test code, and using the ASDF:SYSTEM-RELATIVE-PATHNAME function.
At the same time, killed the testjson.lisp file, which does the testing
as a side-effect of loading. This is unnecessary because the testing
is done in the PERFORM method of the TEST-OP.
diff -rN -u old-cl-json/cl-json.asd new-cl-json/cl-json.asd
--- old-cl-json/cl-json.asd 2014-07-24 06:03:37.000000000 -0700
+++ new-cl-json/cl-json.asd 2014-07-24 06:03:37.000000000 -0700
@@ -20,7 +20,7 @@
(defsystem :cl-json
:name "cl-json"
:description "JSON in Lisp. JSON (JavaScript Object Notation) is a lightweight data-interchange format."
- :version "0.4.1"
+ :version "0.4.2"
:maintainer "Henrik Hjelte <henrik@evahjelte.com>"
:licence "MIT"
:in-order-to ((test-op (test-op "cl-json.test")))
@@ -42,7 +42,7 @@
:in-order-to ((test-op (load-op "cl-json.test")))
:components ((:module :t
:components ((:file "package")
- (:file "testjson" :depends-on ("package" "testdecoder" "testencoder" "testmisc"))
+ ;; (:file "testjson" :depends-on ("package" "testdecoder" "testencoder" "testmisc"))
(:file "testmisc" :depends-on ("package" "testdecoder" "testencoder"))
(:file "testdecoder" :depends-on ("package"))
(:file "testencoder" :depends-on ("package"))))))
@@ -51,11 +51,10 @@
(funcall (intern (symbol-name '#:run!) :it.bese.FiveAM)
(intern (symbol-name '#:json) :json-test)))
-(defparameter *cl-json-directory* (make-pathname :directory (pathname-directory *load-truename*)))
+(defparameter *cl-json-directory*
+ (make-pathname :directory (pathname-directory *load-truename*)))
+
-(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*))))
diff -rN -u old-cl-json/t/testdecoder.lisp new-cl-json/t/testdecoder.lisp
--- old-cl-json/t/testdecoder.lisp 2014-07-24 06:03:37.000000000 -0700
+++ new-cl-json/t/testdecoder.lisp 2014-07-24 06:03:37.000000000 -0700
@@ -266,7 +266,8 @@
(* 2.0 (expt 10.0 444)))))
-(defvar *json-test-files-path*)
+(defparameter *json-test-files-path*
+ (asdf:system-relative-pathname "cl-json.test" "t/"))
(defun test-file (name)
(make-pathname :name name :type "json" :defaults *json-test-files-path*))