File tree Expand file tree Collapse file tree 4 files changed +60
-1
lines changed Expand file tree Collapse file tree 4 files changed +60
-1
lines changed Original file line number Diff line number Diff line change 32
32
33
33
(def marata-test
34
34
(do
35
- (prn " ---------------------------------------------" )
35
+ ; ; (prn "---------------------------------------------")
36
36
; ;(-main "--path=/Users/aitem/Work/HS/ssty/t" "--ns=rmis" "tests")
37
37
(prn " ---------------------------------------------" )
38
38
(-main " --path=/Users/aitem/Work/HS/ssty/t" " --format=stdout" " --ns=rmis" " tests" )
39
+ (prn " ---------------------------------------------" )
40
+ (def p (-main " --path=/Users/aitem/Work/HS/ssty/t" " --format=report" " --ns=rmis" " tests" ))
39
41
))
40
42
41
43
(def ctx (-main " server" " --port=8888" ))
Original file line number Diff line number Diff line change
1
+ (ns stresty.format.report
2
+ (:require [stresty.format.core :as fmt]
3
+ [clojure.string :as str]))
4
+
5
+ (defmethod fmt /do-format
6
+ 'sty /report-fmt
7
+ [ztx _ state {tp :type ts :ts :as event}]
8
+ (cond
9
+ (= tp 'sty/on-tests-start)
10
+ (swap! state assoc :start ts)
11
+
12
+ (= tp 'sty/on-zen-errors)
13
+ (do
14
+ (println " Syntax errors:" )
15
+ (println (str/join " \n "
16
+ (->>
17
+ (:errors event)
18
+ (mapv (fn [{msg :message res :resource pth :path }]
19
+ (str " >> " msg " in " res " at " pth)))))))
20
+
21
+ (= tp 'sty/on-env-start)
22
+ (print (get-in event [:env :zen/name ]) " {" )
23
+
24
+ (= tp 'sty/on-case-start)
25
+ (print " (" )
26
+
27
+ (= tp 'sty/on-step-start)
28
+ :nop
29
+
30
+ (tp (set ['sty/on-step-success 'sty/on-match-ok]))
31
+ (print " ." )
32
+
33
+ (tp (set ['sty/on-step-fail 'sty/on-match-fail]))
34
+ (print " x" )
35
+
36
+ ; ;(= tp 'sty/tests-summary)
37
+ ; ;(summary ztx)
38
+
39
+ (= tp 'sty/on-step-exception)
40
+ (print " !" )
41
+
42
+ (= tp 'sty/on-case-end)
43
+ (print " )" )
44
+
45
+ (= tp 'sty/on-env-end)
46
+ (print " }\n " )
47
+
48
+
49
+ (= tp 'sty/tests-done)
50
+ (print " done \n " )
51
+
52
+ )
53
+
54
+ )
Original file line number Diff line number Diff line change 107
107
(let [env (zen/get-symbol ztx env-ref)]
108
108
(run-env ztx env)))
109
109
(fmt/emit ztx {:type 'sty/tests-summary})
110
+ (fmt/emit ztx {:type 'sty/tests-done})
110
111
{:result params})
111
112
112
113
(defmethod call-op 'sty /gen
Original file line number Diff line number Diff line change 7
7
[stresty.server.cli]
8
8
[stresty.operations.core]
9
9
[stresty.format.core :as fmt]
10
+ [stresty.format.report]
10
11
[stresty.sci]
11
12
[clojure.string :as str]))
12
13
@@ -64,6 +65,7 @@ sty => help
64
65
(swap! ztx assoc :opts opts :formatters
65
66
(let [fmt (get {" ndjson" 'sty/ndjson-fmt
66
67
" stdout" 'sty/stdout-fmt
68
+ " report" 'sty/report-fmt ; ; html report
67
69
" debug" 'sty/debug-fmt}
68
70
(:format opts)
69
71
'sty/debug-fmt)]
You can’t perform that action at this time.
0 commit comments