Merge pull request #995 from cldwalker/test-command-docs

document ns tagging and :only features of test subcommand
This commit is contained in:
Michael Klishin 2013-02-09 16:42:04 -08:00
commit 77e29f81b6

View file

@ -130,8 +130,8 @@
(defn test (defn test
"Run the project's tests. "Run the project's tests.
Marking deftest forms with metadata allows you to pick selectors to specify Marking deftest or ns forms with metadata allows you to pick selectors to
a subset of your test suite to run: specify a subset of your test suite to run:
(deftest ^:integration network-heavy-test (deftest ^:integration network-heavy-test
(is (= [1 2 3] (:numbers (network-operation))))) (is (= [1 2 3] (:numbers (network-operation)))))
@ -145,7 +145,11 @@ Write the selectors in project.clj:
Arguments to this task will be considered test selectors if they are keywords; Arguments to this task will be considered test selectors if they are keywords;
if they are symbols they will be treated as a list of test namespaces to run. if they are symbols they will be treated as a list of test namespaces to run.
With no arguments the :default test selector is used if present, otherwise all With no arguments the :default test selector is used if present, otherwise all
tests are run." tests are run.
A default :only test-selector is available to run select tests. For example,
`lein test :only leiningen.test.test/test-default-selector` only runs the
specified test."
[project & tests] [project & tests]
(binding [main/*exit-process?* (if (= :leiningen (:eval-in project)) (binding [main/*exit-process?* (if (= :leiningen (:eval-in project))
false false