Skip to content

Commit dec5efb

Browse files
author
matt
committed
Roll up to NOT_STARTED/CHECK if some items are NOT_STARTED in itemized test
1 parent 70793f9 commit dec5efb

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

db.scm

+6-3
Original file line numberDiff line numberDiff line change
@@ -3304,12 +3304,13 @@
33043304
(non-completes (filter (lambda (x)
33053305
(not (equal? x "COMPLETED")))
33063306
all-curr-states))
3307+
(num-non-completes (length non-completes))
33073308
(newstate (cond
33083309
((> running 0)
33093310
"RUNNING") ;; anything running, call the situation running
33103311
((> bad-not-started 0) ;; we have an ugly situation, it is completed in the sense we cannot do more.
33113312
"COMPLETED")
3312-
((> (length non-completes) 0) ;;
3313+
((> num-non-completes 0) ;;
33133314
(car non-completes)) ;; (remove (lambda (x)(equal? "COMPLETED" x)) all-curr-states)))
33143315
(else
33153316
(car all-curr-states))))
@@ -3318,8 +3319,10 @@
33183319
;; (if (> bad-not-started 0)
33193320
;; "COMPLETED"
33203321
;; (car all-curr-states))))
3321-
(newstatus (if (> bad-not-started 0)
3322-
"CHECK"
3322+
(newstatus (if (or (> bad-not-started 0)
3323+
(and (equal? newstate "NOT_STARTED")
3324+
(> num-non-completes 0)))
3325+
"CHECK"
33233326
(car all-curr-statuses))))
33243327
;; (print "bad-not-supported: " bad-not-support " all-curr-states: " all-curr-states " all-curr-statuses: " all-curr-states)
33253328
;; " newstate: " newstate " newstatus: " newstatus)

gutils.scm

+14-3
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,30 @@
2222
(delta (map (lambda (a b)(abs (- a b))) c1 c2)))
2323
(null? (filter (lambda (x)(> x 3)) delta))))
2424

25+
(define gutils:colors
26+
'((PASS . "70 249 73")
27+
(FAIL . "253 33 49")
28+
(SKIP . "230 230 0")))
29+
30+
(define (gutils:get-color-spec effective-state)
31+
(or (alist-ref effective-state gutils:colors)
32+
(alist-ref 'FAIL gutils:colors)))
33+
2534
(define (gutils:get-color-for-state-status state status);; #!key (get-label #f))
2635
;; ((if get-label cadr car)
2736
(case (string->symbol state)
2837
((COMPLETED) ;; ARCHIVED)
2938
(case (string->symbol status)
3039
((PASS) (list "70 249 73" status))
3140
((WARN WAIVED) (list "255 172 13" status))
32-
((SKIP) (list "230 230 0" status))
41+
((SKIP) (list (gutils:get-color-spec 'SKIP) status))
3342
((ABORT) (list "198 36 166" status))
3443
(else (list "253 33 49" status))))
3544
((ARCHIVED)
3645
(case (string->symbol status)
3746
((PASS) (list "70 170 73" status))
3847
((WARN WAIVED) (list "200 130 13" status))
39-
((SKIP) (list "180 180 0" status))
48+
((SKIP) (list (gutils:get-color-spec 'SKIP) status))
4049
(else (list "180 33 49" status))))
4150
;; (if (equal? status "PASS")
4251
;; '("70 249 73" "PASS")
@@ -50,7 +59,9 @@
5059
((RUNNING) (list "9 131 232" state))
5160
((KILLREQ) (list "39 82 206" state))
5261
((KILLED) (list "234 101 17" state))
53-
((NOT_STARTED) (list "240 240 240" state))
62+
((NOT_STARTED) (case (string->symbol status)
63+
((CHECK)(list (gutils:get-color-spec 'SKIP) state))
64+
(else (list "240 240 240" state))))
5465
;; for xor mode below
5566
;;
5667
((CLEAN)

0 commit comments

Comments
 (0)