diff options
author | Stuart Halloway <stu@thinkrelevance.com> | 2010-04-13 10:03:12 -0400 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2010-04-13 10:03:12 -0400 |
commit | b52f0b60c0e777724fa3591c43bdba83a16968c8 (patch) | |
tree | 61fc36bb9dc9d950952d8dca2b0611d0a09dd830 /src/test/clojure | |
parent | b9db2805f9571d52d5f0bb0b726fee1ca70c821d (diff) |
test-load-all tries to load all nondeprecated namespaces
- fixed bug: misspelling in pom
- updated gen-html-docs to track c.c.string name changes
Diffstat (limited to 'src/test/clojure')
-rw-r--r-- | src/test/clojure/clojure/contrib/test_load_all.clj | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/test/clojure/clojure/contrib/test_load_all.clj b/src/test/clojure/clojure/contrib/test_load_all.clj new file mode 100644 index 00000000..15bcc4f1 --- /dev/null +++ b/src/test/clojure/clojure/contrib/test_load_all.clj @@ -0,0 +1,53 @@ +;;; test_load_all.clj - loads all contrib libraries for testing purposes + +;; by Stuart Halloway, http://blog.thinkrelevance.com + +;; Copyright (c) Stuart Halloway, 2009. All rights reserved. The use +;; and distribution terms for this software are covered by the Eclipse +;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) +;; which can be found in the file epl-v10.html at the root of this +;; distribution. By using this software in any fashion, you are +;; agreeing to be bound by the terms of this license. You must not +;; remove this notice, or any other, from this software. + +;; This is only intended to check that the libraries will load without +;; errors, not that they work correctly. + +;; The code includes several design choices I don't love, but find +;; tolerable in a test-only lib: +;; +;; * namespaces that blow up to document deprecation +;; * using directory paths to find contrib +;; * using a macro to reflectively write tests +;; +;; I *am* happy that code that won't even load now breaks the build. + +(ns clojure.contrib.test-load-all + (:use clojure.test clojure.contrib.find-namespaces)) + +(def deprecated-contrib-namespaces + '[clojure.contrib.javadoc]) + +(defn loadable-contrib-namespaces + "Contrib namespaces that can be loaded (everything except + deprecated nses that throw on load.)" + [] + (apply disj + (into #{} (find-namespaces-in-dir (java.io.File. "src/main"))) + deprecated-contrib-namespaces)) + +(defn emit-test-load + [] + `(do + ~@(map + (fn [ns] + `(deftest ~(symbol (str "test-loading-" (.replace (str ns) "." "-"))) + (require :reload '~ns))) + (loadable-contrib-namespaces)))) + +(defmacro test-load + [] + (emit-test-load)) + +(test-load) + |