Update the run task tests for 2.0

The test.helper needed to change the project map for the test projects
because eval-in-project uses get-classpath, which will return the
relative paths for some directories.  This breaks in this case since
the working directory is not the root of the test project.
This commit is contained in:
Nelson Morris 2011-12-02 21:25:57 -06:00
parent 2b074c09b0
commit cd5cd2c0d9
4 changed files with 16 additions and 5 deletions

View file

@ -9,9 +9,20 @@
(io/file local-repo
(if (string? n) n (or (namespace n) (name n))) (name n) v))
(defn- prepend-root [project key root]
(assoc project key (str root java.io.File/separator (key project))))
(defn- read-test-project [name]
(binding [*ns* (find-ns 'leiningen.core)]
(project/read (format "test_projects/%s/project.clj" name))))
(let [project (project/read (format "test_projects/%s/project.clj" name))
root (:root project)]
(-> project
(prepend-root :source-path root)
(prepend-root :compile-path root)
(prepend-root :test-path root)
(prepend-root :resources-path root)
(prepend-root :dev-resources-path root)
(prepend-root :target-path root)
(prepend-root :native-path root))))
(def sample-project (read-test-project "sample"))

View file

@ -4,7 +4,7 @@
;; "lein new".
(defproject nomnomnom "0.5.0-SNAPSHOT"
:dependencies [[clojure "1.2.0"]
:dependencies [[org.clojure/clojure "1.2.0"]
[janino "2.5.15"]]
:uberjar-exclusions [#"DUMMY"]
:test-selectors {:default (fn [m] (not (:integration m)))

View file

@ -1,6 +1,6 @@
(defproject org.domain/tricky-name "1.0"
:description "One with a tricky group and project name"
:dev-dependencies [[clojure "1.2.0"]]
:dev-dependencies [[org.clojure/clojure "1.2.0"]]
:shell-wrapper true
:main ^{:skip-aot true} org.domain.tricky-name.core
:run-aliases {:bbb org.domain.tricky-name.brunch