Skip to content

Instantly share code, notes, and snippets.

Created September 12, 2016 12:33
What would you like to do?
A very small script for running spec tests. I have a lein alias for running the main function and that works quite well.
(ns spec-test
(:require [clojure.pprint]
[ :refer (refresh)]))
(defn run-analysis
(let [results (clojure.spec.test/check)
failures (remove (comp true? :result :clojure.spec.test.check/ret) results)]
[:success? :symbol :seed]
(for [result results]
{:success? (true? (get-in result [:clojure.spec.test.check/ret :result]))
:symbol (get result :sym)
:seed (get-in result [:clojure.spec.test.check/ret :seed])}))
(System/exit (if (seq failures) 1 0))))
(defn -main
[& args]
(refresh :after 'spec-test/run-analysis))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment