-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7566c8b
commit 7b6bd0a
Showing
3 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,42 @@ | ||
(ns k16.forge | ||
(:refer-clojure :exclude [run!]) | ||
(:require [k16.forge.runner :as runner])) | ||
(:gen-class) | ||
(:require | ||
[cli-matic.core :as cli] | ||
[clojure.string :as str] | ||
[k16.forge.runner :as runner])) | ||
|
||
(defn run! [_] | ||
(runner/run-all)) | ||
(def ^:private cli-configuration | ||
{:command "forge" | ||
:description "A simple test runner for clojure.test" | ||
:version "0.0.0" | ||
:opts [{:option "focus" | ||
:short "f" | ||
:as "Only run the given test or namespace. Alias for '--include'" | ||
:type :string} | ||
|
||
{:option "include" | ||
:short "i" | ||
:as "Only run the test or namespace described by the given pattern" | ||
:type :string} | ||
|
||
{:option "exclude" | ||
:short "e" | ||
:as "Exclude the test or namespace described by the given pattern from running" | ||
:type :string} | ||
|
||
{:option "parallelism" | ||
:short "p" | ||
:as "The maximum number of tests to run concurrently. Defaults to the number of cores" | ||
:type :int}] | ||
:runs | ||
(fn [props] | ||
(let [include (or (:include props) | ||
(:focus props)) | ||
exclude (:exclude props) | ||
props (cond-> props | ||
include (assoc :include (str/split include #",")) | ||
exclude (assoc :exclude (str/split exclude #",")))] | ||
(runner/run-all props)))}) | ||
|
||
(defn -main [& args] | ||
(runner/run-all)) | ||
(cli/run-cmd args cli-configuration)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters