Skip to content

Commit 056da08

Browse files
committed
update to latest Clojure idioms
1 parent 5fb4fc4 commit 056da08

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

deps.edn

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
:deps {org.clojure/tools.namespace {:mvn/version "0.3.0-alpha4"}
33
org.clojure/tools.cli {:mvn/version "0.3.5"}
44
org.clojure/clojure {:mvn/version "1.9.0"}}
5-
:aliases {:dev {:extra-paths ["test" "dev"]
6-
:extra-deps {org.clojure/test.check {:mvn/version "0.9.0"}}}}
5+
:aliases {:test {:extra-paths ["test" "dev"]
6+
:extra-deps {org.clojure/test.check {:mvn/version "0.9.0"}}
7+
:main-opts ["-m" "cognitect.test-runner"]}}
78
:mvn/repos {"central" {:url "https://repo1.maven.org/maven2/"}
89
"clojars" {:url "https://clojars.org/repo"}}}

readme.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# test-runner
22

33
`test-runner` is a small library for discovering and running tests in
4-
plain Clojure projects (i.e, those that use only Clojure's built-in
5-
deps tooling, not Leiningen/boot/etc.)
4+
projects using native Clojure deps (i.e, those that use only Clojure's
5+
built-in dependency tooling, not Leiningen/boot/etc.)
66

77
## Rationale
88

@@ -19,28 +19,28 @@ towards the "quick and dirty," besides being nonstandard from project
1919
to project.
2020

2121
This library aims to fill in the gap and provide a standardized,
22-
easy-to-use entry entry point for discovering and running unit and
22+
easy-to-use entry point for discovering and running unit and
2323
property-based tests while remaining a lightweight entry in Clojure's
2424
suite of decomplected project management tools.
2525

2626
## Usage
2727

2828
Include a dependency on this project in your `deps.edn`. You will
29-
probably wish to put it in a `dev` or `test` alias. For example:
29+
probably wish to put it in `test` alias. You can also include the main
30+
namespace invocation using Clojure's `:main-opts` key. For example:
3031

3132

3233
```clojure
33-
:aliases {:dev {:extra-paths ["test"]
34-
:extra-deps {com.cognitect/test-runner {:git/url "[email protected]:cognitect-labs/test-runner"
35-
:sha "e3e4ce3d7e29349eeff44afd654bc2de6d5f3ae5"}}}}
34+
:aliases {:test {:extra-paths ["test"]
35+
:extra-deps {com.cognitect/test-runner {:git/url "[email protected]:cognitect-labs/test-runner"
36+
:sha "5fb4fc46ad0bf2e0ce45eba5b9117a2e89166479"}}
37+
:main-opts ["-m" "cognitect.test-runner"]}}
3638
```
3739

38-
Then, invoke Clojure via the command line, passing
39-
`cognitect.test-runner` as the main namespace to run using the
40-
`-m` option.
40+
Then, invoke Clojure via the command line, invoking the `test` alias:
4141

4242
```bash
43-
clj -Adev -m cognitect.test-runner
43+
clj -Atest
4444
```
4545

4646
This will scan your project's `test` directory for any tests defined
@@ -63,7 +63,7 @@ the `foo.bar` and `foo.baz` namespaces, in the `test` and `src`
6363
directories:
6464

6565
```
66-
clj -Adev -m cognitect.test-runner -d test -d src -n foo.bar -n foo.baz
66+
clj -Atest -d test -d src -n foo.bar -n foo.baz
6767
```
6868

6969
### Using Inclusions and Exclusions
@@ -80,13 +80,13 @@ For example, you could tag your integration tests like so:
8080
Then to run only integration tests, you could do:
8181

8282
```
83-
clj -Adev -m cognitect.test-runner -i :integration
83+
clj -Atest -i :integration
8484
```
8585

8686
Or to run all tests *except* for integration tests:
8787

8888
```
89-
clj -Adev -m cognitect.test-runner -e :integration
89+
clj -Atest -e :integration
9090
```
9191

9292
If both inclusions and exclusions are present, exclusions take priority over inclusions.

src/cognitect/test_runner.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
(defn- help
9494
[args]
9595
(println "\nUSAGE:\n")
96-
(println "clj -m" (namespace `help) "<test-dir> <options>\n")
96+
(println "clj -m" (namespace `help) "<options>\n")
9797
(println (:summary args))
9898
(println "\nAll options may be repeated multiple times for a logical OR effect.")
9999
)

0 commit comments

Comments
 (0)