Failing test for #1409.
This commit is contained in:
parent
a64a47b8b8
commit
e8da286ea7
3 changed files with 25 additions and 7 deletions
|
@ -139,13 +139,14 @@
|
|||
(str (second (b/ns-form-for-file possible-file)))
|
||||
possible-file))
|
||||
|
||||
(defn- read-args [args project]
|
||||
(defn ^:internal read-args [args project]
|
||||
(let [args (->> args (map convert-to-ns) (map read-string))
|
||||
[nses given-selectors] (split-selectors args)
|
||||
nses (or (seq nses)
|
||||
(sort
|
||||
(b/namespaces-on-classpath
|
||||
:classpath (map io/file (distinct (:test-paths project))))))
|
||||
:classpath (map io/file (distinct (:test-paths project)))
|
||||
:ignore-unreadable? true)))
|
||||
selectors (partial-selectors (merge {:all '(constantly true)}
|
||||
{:only only-form}
|
||||
(:test-selectors project))
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
(ns leiningen.test.test
|
||||
(:refer-clojure :exclude [test])
|
||||
(:use [clojure.test]
|
||||
[leiningen.test]
|
||||
[leiningen.test.helper :only [tmp-dir sample-no-aot-project abort-msg]])
|
||||
(:require [clojure.java.io :as io]))
|
||||
(:require [clojure.test :refer :all]
|
||||
[leiningen.test :refer :all]
|
||||
[leiningen.test.helper :refer [tmp-dir sample-no-aot-project
|
||||
sample-failing-project abort-msg]]
|
||||
[clojure.java.io :as io]
|
||||
[leiningen.core.main :as main]
|
||||
[leiningen.core.project :as project]))
|
||||
|
||||
(use-fixtures :each
|
||||
(fn [f]
|
||||
|
@ -74,3 +77,15 @@
|
|||
(let [file (io/file (first (:test-paths sample-no-aot-project)) "selectors.clj")]
|
||||
(test sample-no-aot-project (.getPath file)))
|
||||
(is (= (ran?) #{:regular :not-custom :int2 :fixture})))
|
||||
|
||||
(deftest test-unreadable-test-fails
|
||||
(let [project (project/merge-profiles sample-failing-project
|
||||
[{:aot ^:replace []
|
||||
:dependencies ^:replace
|
||||
[['org.clojure/clojure "1.5.1"]]}])]
|
||||
(binding [main/*exit-process?* false]
|
||||
(is (= (read-args [""] project) ['sample.unreadable]))
|
||||
(is (try (test project)
|
||||
false
|
||||
(catch Exception e
|
||||
(= "Tests failed." (.getMessage e))))))))
|
||||
|
|
2
test_projects/sample-failing/test/sample/unreadable.clj
Normal file
2
test_projects/sample-failing/test/sample/unreadable.clj
Normal file
|
@ -0,0 +1,2 @@
|
|||
(ns sample.unreadable
|
||||
|
Loading…
Reference in a new issue