Skip to content

Commit 39b8ac8

Browse files
committed
fixes #30 and updates all deps
1 parent 031f55f commit 39b8ac8

File tree

10 files changed

+80
-50
lines changed

10 files changed

+80
-50
lines changed

.github/workflows/test-and-release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
with:
1414
fetch-depth: 0
15-
- uses: actions/setup-java@v2
15+
- uses: actions/setup-java@v3
1616
with:
1717
distribution: 'adopt'
1818
java-version: '11'
1919
- name: Clojure CLI
2020
uses: DeLaGuardo/setup-clojure@master
2121
with:
22-
tools-deps: '1.10.3.1053'
22+
tools-deps: '1.11.1.1208'
2323
- name: Cache All The Things
24-
uses: actions/cache@v2
24+
uses: actions/cache@v3
2525
with:
2626
path: |
2727
~/.m2/repository

.github/workflows/test-and-snapshot.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ jobs:
99
build-and-snapshot:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-java@v2
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-java@v3
1414
with:
1515
distribution: 'adopt'
1616
java-version: '11'
1717
- name: Clojure CLI
1818
uses: DeLaGuardo/setup-clojure@master
1919
with:
20-
tools-deps: '1.10.3.1053'
20+
tools-deps: '1.11.1.1208'
2121
- name: Cache All The Things
22-
uses: actions/cache@v2
22+
uses: actions/cache@v3
2323
with:
2424
path: |
2525
~/.m2/repository
@@ -41,17 +41,17 @@ jobs:
4141
matrix:
4242
java: [ '8', '14', '17' ]
4343
steps:
44-
- uses: actions/checkout@v2
45-
- uses: actions/setup-java@v2
44+
- uses: actions/checkout@v3
45+
- uses: actions/setup-java@v3
4646
with:
4747
distribution: 'adopt'
4848
java-version: ${{ matrix.java }}
4949
- name: Clojure CLI
5050
uses: DeLaGuardo/setup-clojure@master
5151
with:
52-
tools-deps: '1.10.3.1053'
52+
tools-deps: '1.11.1.1208'
5353
- name: Cache All The Things
54-
uses: actions/cache@v2
54+
uses: actions/cache@v3
5555
with:
5656
path: |
5757
~/.m2/repository

.github/workflows/test.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ jobs:
99
matrix:
1010
java: [ '8', '11', '14', '17' ]
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-java@v2
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-java@v3
1414
with:
1515
distribution: 'adopt'
1616
java-version: ${{ matrix.java }}
1717
- name: Clojure CLI
1818
uses: DeLaGuardo/setup-clojure@master
1919
with:
20-
tools-deps: '1.10.3.1053'
20+
tools-deps: '1.11.1.1208'
2121
- name: Cache All The Things
22-
uses: actions/cache@v2
22+
uses: actions/cache@v3
2323
with:
2424
path: |
2525
~/.m2/repository

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Only accretive/fixative changes will be made from now on.
88

99
* 2.0.next in progress
10+
* Fix [#30](https://github.com/clojure-expectations/clojure-test/issues/30) by removing `build-clj` and using raw `tools.build`.
1011
* Address [#27](https://github.com/clojure-expectations/clojure-test/issues/27) by changing `refer`'d note in stub macros' docstrings.
1112

1213
* 2.0.160 -- 2022-03-26

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,6 @@ This will set you up with `defexpect` and `expect`. Add others as required.
289289

290290
## License & Copyright
291291

292-
Copyright © 2018-2021 Sean Corfield, all rights reserved.
292+
Copyright © 2018-2023 Sean Corfield, all rights reserved.
293293

294294
Distributed under the Eclipse Public License version 1.0.

build.clj

+44-21
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,67 @@
1010
1111
clojure -A:deps -T:build help/doc"
1212
(:refer-clojure :exclude [test])
13-
(:require [clojure.tools.build.api :as b]
14-
[org.corfield.build :as bb]))
13+
(:require [clojure.string :as str]
14+
[clojure.tools.build.api :as b]
15+
[clojure.tools.deps :as t]
16+
[deps-deploy.deps-deploy :as dd]))
1517

1618
(def lib 'com.github.seancorfield/expectations)
1719
(defn- the-version [patch] (format "2.0.%s" patch))
1820
(def version (the-version (b/git-count-revs nil)))
1921
(def snapshot (the-version "999-SNAPSHOT"))
22+
(def class-dir "target/classes")
2023

2124
(defn run-tests "Run the tests."
2225
[{:keys [aliases] :as opts}]
23-
(-> opts
24-
(cond->
25-
(some #{:humane :cljs} aliases)
26-
(assoc :main-opts ["-e" ":negative"]))
27-
(bb/run-tests)))
26+
(println "\nRunning tests for" (str/join ", " (map name aliases)) "...")
27+
(let [basis (b/create-basis {:aliases (into [:test] aliases)})
28+
combined (t/combine-aliases basis (into [:test] aliases))
29+
cmds (b/java-command
30+
{:basis basis
31+
:main 'clojure.main
32+
:main-args (cond-> (:main-opts combined)
33+
(some #{:humane :cljs} aliases)
34+
(into ["-e" ":negative"]))})
35+
{:keys [exit]} (b/process cmds)]
36+
(when-not (zero? exit) (throw (ex-info "Tests failed" {}))))
37+
opts)
2838

2939
(defn test "Run all the tests." [opts]
3040
(reduce (fn [opts alias]
3141
(run-tests (assoc opts :aliases [alias])))
3242
opts
33-
(cond-> [:1.9 :1.10 :master :humane]
43+
(cond-> [:1.9 :1.10 :1.11 :master :humane]
3444
(:cljs opts)
3545
(conj :cljs)))
3646
opts)
3747

38-
(defn ci
39-
"Run the CI pipeline of tests (and build the JAR).
48+
(defn- jar-opts [opts]
49+
(let [version (if (:snapshot opts) snapshot version)]
50+
(assoc opts
51+
:lib lib :version version
52+
:jar-file (format "target/%s-%s.jar" lib version)
53+
:scm {:tag (str "v" version)}
54+
:basis (b/create-basis {})
55+
:class-dir class-dir
56+
:target "target"
57+
:src-dirs ["src"]
58+
:src-pom "template/pom.xml")))
4059

41-
Specify :cljs true to run the ClojureScript tests as well."
42-
[opts]
43-
(-> opts
44-
(assoc :lib lib :version (if (:snapshot opts) snapshot version))
45-
(test)
46-
(bb/clean)
47-
(assoc :src-pom "template/pom.xml")
48-
(bb/jar)))
60+
(defn ci "Run the CI pipeline of tests (and build the JAR)." [opts]
61+
(test opts)
62+
(b/delete {:path "target"})
63+
(let [opts (jar-opts opts)]
64+
(println "\nWriting pom.xml...")
65+
(b/write-pom opts)
66+
(println "\nCopying source...")
67+
(b/copy-dir {:src-dirs ["resources" "src"] :target-dir class-dir})
68+
(println "\nBuilding JAR...")
69+
(b/jar opts))
70+
opts)
4971

5072
(defn deploy "Deploy the JAR to Clojars." [opts]
51-
(-> opts
52-
(assoc :lib lib :version (if (:snapshot opts) snapshot version))
53-
(bb/deploy)))
73+
(let [{:keys [jar-file] :as opts} (jar-opts opts)]
74+
(dd/deploy {:installer :remote :artifact (b/resolve-path jar-file)
75+
:pom-file (b/pom-path (select-keys opts [:lib :class-dir]))}))
76+
opts)

deps.edn

+12-6
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,29 @@
33
:deps {org.clojure/clojure {:mvn/version "1.9.0"}}
44
:aliases
55
{;; for help: clojure -A:deps -T:build help/doc
6-
:build {:deps {io.github.seancorfield/build-clj
7-
{:git/tag "v0.8.0" :git/sha "9bd8b8a"}}
6+
:build {:deps {io.github.clojure/tools.build
7+
{:git/tag "v0.9.2" :git/sha "fe6b140"}
8+
slipset/deps-deploy {:mvn/version "0.2.0"}}
89
:ns-default build}
910

1011
;; versions to test against:
1112
:1.9 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0"}}}
1213
:1.10 {:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}}
13-
:master {:override-deps {org.clojure/clojure {:mvn/version "1.11.1-master-SNAPSHOT"}}}
14+
:1.11 {:override-deps {org.clojure/clojure {:mvn/version "1.11.1"}}}
15+
:master {:override-deps {org.clojure/clojure {:mvn/version "1.12.0-master-SNAPSHOT"}}}
1416

1517
;; running tests/checks of various kinds:
1618
:test ; can also run clojure -X:test
1719
{:extra-paths ["test"]
18-
:extra-deps {io.github.cognitect-labs/test-runner
19-
{:git/tag "v0.5.0" :git/sha "48c3c67"}}
20-
:exec-fn cognitect.test-runner.api/test}
20+
:extra-deps {io.github.cognitect-labs/test-runner
21+
{:git/tag "v0.5.1" :git/sha "dfb30dd"}
22+
org.clojure/core.cache {:mvn/version "RELEASE"}}
23+
:main-opts ["-m" "cognitect.test-runner"]
24+
:exec-fn cognitect.test-runner.api/test}
25+
2126
:humane
2227
{:extra-deps {pjstadig/humane-test-output {:mvn/version "RELEASE"}}}
28+
2329
:cljs
2430
{:extra-deps {olical/cljs-test-runner {:mvn/version "3.8.0"}
2531
pjstadig/humane-test-output {:mvn/version "0.11.0"}}

run-tests.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#!/bin/sh
2-
for v in 9 10
2+
for v in 1.9 1.10 1.11 master
33
do
4-
clojure -X:1.${v}:test
4+
clojure -X:${v}:test
55
if test $? -ne 0
66
then
77
exit 1
88
fi
9-
clojure -X:1.${v}:test:humane :excludes '[:negative]'
9+
clojure -X:${v}:test:humane :excludes '[:negative]'
1010
if test $? -ne 0
1111
then
1212
exit 1
1313
fi
1414
done
1515
if test "$1" != "clj-only"
1616
then
17-
clojure -M:cljs-test -e :negative
17+
clojure -M:cljs -e :negative
1818
if test $? -ne 0
1919
then
2020
exit 1

src/expectations/clojure/test.cljc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;; copyright (c) 2018-2021 sean corfield, all rights reserved
1+
;; copyright (c) 2018-2023 sean corfield, all rights reserved
22

33
(ns expectations.clojure.test
44
"This namespace provides compatibility with `clojure.test` and related tooling.

test/expectations/clojure/test_test.cljc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;; copyright (c) 2019-2021 sean corfield, all rights reserved
1+
;; copyright (c) 2019-2023 sean corfield, all rights reserved
22

33
(ns expectations.clojure.test-test
44
"Test the testing framework -- this is sometimes harder than you might think!

0 commit comments

Comments
 (0)