| | |
| | | (ns test-runner) |
| | | (ns test-runner |
| | | (:require |
| | | [clojure.string :as string] |
| | | [clojure.test :as t])) |
| | | |
| | | (def class-cache-dir ".cache/classes") |
| | | (.mkdirs (java.io.File. class-cache-dir)) |
| | |
| | | (println "Malli detected. Instrument functions...") |
| | | (require 'malli.dev) |
| | | (require 'malli.dev.pretty) |
| | | (require 'malli.dev.virhe) |
| | | (alter-var-root (get (ns-publics 'malli.dev.virhe) '-color) (constantly (fn [_ body _] [:span body]))) |
| | | ((find-var 'malli.dev/start!) {:report ((find-var 'malli.dev.pretty/thrower))})) |
| | | (let [test-namespaces (->> (all-ns) |
| | | (mapcat ns-publics) |
| | |
| | | (filter (comp test-files :file)) |
| | | (map :ns) |
| | | (set))] |
| | | |
| | | (set-validator! #'t/*testing-contexts* |
| | | (let [validator (get-validator #'t/*testing-contexts*)] |
| | | (fn [v] |
| | | (println "Testing:" (string/join " " v)) |
| | | (println) |
| | | (if validator |
| | | (validator v) |
| | | true)))) |
| | | |
| | | (with-redefs [t/report vim-report] |
| | | (System/exit |
| | | (if (pos? (if (and -test-file -test-line) |