build.clj 676 B

12345678910111213141516171819
  1. (ns build
  2. (:refer-clojure :exclude [test])
  3. (:require [clojure.tools.build.api :as b]
  4. [clojure.tools.deps :as t]))
  5. (defn test "Run all the tests."
  6. [_opts]
  7. (println "\nRunning tests...")
  8. (let [basis (b/create-basis {:aliases [:eftest]})
  9. combined (t/combine-aliases basis [:eftest])
  10. cmds (b/java-command
  11. {:basis basis
  12. :java-opts (:jvm-opts combined)
  13. :main 'logseq.e2e.core
  14. ;; :main-args ["-m" "cognitect.test-runner"]
  15. })
  16. {:keys [exit]} (b/process cmds)]
  17. (when-not (zero? exit)
  18. (throw (ex-info "Tests failed" {})))))