aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2021-08-05 20:30:21 -0500
committerFurkan Sahin <furkan-dev@proton.me>2021-08-05 20:30:21 -0500
commit327fa451745501cb87a1b8c98f9ba0ac418a76ac (patch)
tree1a142f4e8b74241ebe0ac9107ee566bccaef4681 /cmd
parent5d8cd855ed3d1f12bee941ede9a9098248d27b69 (diff)
License
Diffstat (limited to 'cmd')
-rw-r--r--cmd/sub/evaluate.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/cmd/sub/evaluate.go b/cmd/sub/evaluate.go
index 9f8413e..fcc8ae9 100644
--- a/cmd/sub/evaluate.go
+++ b/cmd/sub/evaluate.go
@@ -12,6 +12,8 @@ func Evaluate(params []string) {
fmt.Printf("\n\nREPORT:\n=======\n\n")
+ earned := 0.0
+ total := 0.0
for _, tc := range tcs {
cfg := tc.Config
@@ -20,19 +22,22 @@ func Evaluate(params []string) {
name = *cfg.Title
}
- status := "NOT RUN"
+ var points float64 = 0.0
+ if cfg.Points != nil {
+ points = float64(*cfg.Points)
+ }
+
+ status := "SILENT"
if tc.Result != nil {
if tc.Result.Pass {
status = "PASS"
+ earned += points
} else {
status = "FAIL"
}
}
- var points float32 = 0.0
- if cfg.Points != nil {
- points = *cfg.Points
- }
+ total += points
fmt.Printf("[%s] %s (%f)\n", status, name, points)
@@ -42,4 +47,6 @@ func Evaluate(params []string) {
fmt.Println()
}
+
+ fmt.Printf("Score: %f (%f%%)\n", earned, (earned / total) * 100)
}