Skip to content

Commit

Permalink
Filter test-options
Browse files Browse the repository at this point in the history
  • Loading branch information
eval committed Nov 2, 2023
1 parent 1cbb9ae commit 3c7f554
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@

(def class-dir "target/classes")

(defn ^#:fika{:examples [":d '\"some-dir\"'" ":n '\"some.namespace-test\"'" "# see all runner options\n:H true"]}
test "Run all the tests.
(defn- extract-keys-with-ns
"E.g. `{:test/H true :foo :bar} ;;=> {:H true}`"
[ns m]
(update-keys (filter (comp #(= (name ns) %) namespace key) m)
(comp keyword name)))

(defn ^#:fika{:examples [":test/d '\"some-dir\"'"
":test/n '\"some.namespace-test\"'"
"# see all runner options\n:test/H true"]}
test
"Run all the tests.
Passing options to test-runner possible, see examples." [opts]
#_(prn :opts opts)
(let [opts (update-vals (update-keys opts (fn [k] (let [k (name k)]
(cond-> (str "-" k)
(> (count k) 1) (str "-")))))
str)
(let [test-options (extract-keys-with-ns "test" opts)
opts (-> test-options
(update-keys (fn [k]
;; :H => "-H", :help => "--help"
(let [k (name k)]
(cond->> (str "-" k)
(> (count k) 1) (str "-")))))
(update-vals str))
basis (b/create-basis {:aliases [:test]})
cmds (doto (b/java-command
{:basis basis
Expand Down

0 comments on commit 3c7f554

Please sign in to comment.