Skip to content

Commit

Permalink
Refactor smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Jun 11, 2023
1 parent c21f075 commit 4e2e935
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/smoke_test.bb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
(:require [babashka.process :as p]
[clojure.test :refer [deftest is run-tests]]))

(defn- shell-ok?
([cmd] (shell-ok? cmd {}))
([cmd opts]
(zero? (:exit (p/shell (assoc opts :continue true) cmd)))))

(deftest check-lein-plugin
(is (zero? (:exit (p/shell {:dir "lein-cljfmt", :continue true}
"lein cljfmt check")))))
(is (shell-ok? "lein cljfmt check" {:dir "lein-cljfmt"})))

(deftest check-clj-tool
(is (zero? (:exit
(p/shell
"clojure -M -m cljfmt.main check cljfmt/src cljfmt/test")))))
(is (shell-ok? "clojure -M -m cljfmt.main check cljfmt/src cljfmt/test")))

(deftest check-standalone
(is (zero? (:exit (p/shell
"cljfmt/target/cljfmt check cljfmt/src cljfmt/test")))))
(is (shell-ok? "cljfmt/target/cljfmt check cljfmt/src cljfmt/test")))

(defn -main []
(let [{:keys [fail error]} (run-tests 'smoke-test)]
Expand Down

0 comments on commit 4e2e935

Please sign in to comment.