Skip to content

Commit 0fb06bc

Browse files
committed
AOT for clojure.test
1 parent 5edcf14 commit 0fb06bc

File tree

4 files changed

+4580
-6
lines changed

4 files changed

+4580
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ generate:
5555

5656
.PHONY: aot
5757
aot: gocmd $(STDLIB_TARGETS)
58-
@echo "(map compile '[clojure.core clojure.core.async clojure.walk clojure.string clojure.template clojure.uuid glojure.go.types glojure.go.io])" | \
58+
@echo "(map compile '[clojure.core clojure.core.async clojure.string clojure.template clojure.test clojure.uuid clojure.walk glojure.go.types glojure.go.io])" | \
5959
GLOJURE_USE_AOT=false GLOJURE_STDLIB_PATH=./pkg/stdlib $(GO_CMD) run -tags glj_no_aot_stdlib ./cmd/glj
6060

6161
.PHONY: build

pkg/stdlib/clojure/test.glj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@
267267

268268
(def ^:dynamic *testing-contexts* (list)) ; bound to hierarchy of "testing" strings
269269

270-
(def ^:dynamic *test-out* *out*) ; PrintWriter for test reporting output
270+
(def ^{:dynamic true} *test-out* nil) ; PrintWriter for test reporting output
271271

272272
(defmacro with-test-out
273273
"Runs body with *out* bound to the value of *test-out*."
274274
{:added "1.1"}
275275
[& body]
276-
`(binding [*out* *test-out*]
276+
`(binding [*out* (or *test-out* *out*)]
277277
~@body))
278278

279279
;;; UTILITIES FOR REPORTING FUNCTIONS
@@ -287,7 +287,7 @@
287287
{:added "1.1"
288288
:deprecated "1.2"}
289289
[n]
290-
(let [^StackTraceElement s (nth (.getStackTrace (new java.lang.Throwable)) n)]
290+
(let [^StackTraceElement s (nth (.getStackTrace (new github.com:glojurelang:glojure:pkg:lang.Throwable)) n)]
291291
[(.getFileName s) (.getLineNumber s)]))
292292

293293
(defn testing-vars-str
@@ -410,8 +410,7 @@
410410
{:added "1.1"}
411411
[v]
412412
(try (var-get v)
413-
(catch IllegalStateException e
414-
nil)))
413+
(catch github.com:glojurelang:glojure:pkg:lang.IllegalStateException e nil)))
415414

416415
(defn function?
417416
"Returns true if argument is a function or a symbol that resolves to

0 commit comments

Comments
 (0)