Browse files

Add some validation to report-properties

In particular add a check that the :name report-property is
given only simple names and not directories.
  • Loading branch information...
1 parent 0997b09 commit 6db065f50ecd49e6a1912e01e31ff8c1d95c824d @gwkkwg committed Mar 4, 2012
Showing with 17 additions and 1 deletion.
  1. +17 −1 dev/config.lisp
@@ -53,6 +53,12 @@ In all cases, the report will go into
(defgeneric handle-config-preference (name args)
+(defgeneric validate-report-property (name args))
+(defmethod validate-report-property (name args)
+ (declare (ignore name args))
+ t)
(defvar *current-configuration-stream* nil)
(defvar *current-asdf-system-name* nil
@@ -252,7 +258,17 @@ use asdf:test-op or bind *current-asdf-system-name* yourself."))))))
(defmethod handle-config-preference ((name (eql :report-property))
- (setf (test-result-property *test-result* (first args)) (second args)))
+ (let ((name (form-keyword (first args))))
+ (validate-report-property name (second args))
+ (setf (test-result-property *test-result* name) (second args))))
+(defmethod validate-report-property ((name (eql :name)) args)
+ ;; report name
+ (assert (stringp args) nil
+ ":name property must be given a string, was given ~s" args)
+ (assert (null (pathname-directory args)) nil
+ "The :name property must be a simple name (not a directory), use :full-pathname if
+you need more control"))
(defconfig-variable :profiling-threshold *profiling-threshold*)

0 comments on commit 6db065f

Please sign in to comment.