18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
|
;;======================================================================
;;======================================================================
;; Test info panel
;;======================================================================
(use format fmt)
(require-library iup)
(import (prefix iup iup:))
(use canvas-draw)
(use srfi-1 posix regex regex-case srfi-69)
(use (prefix sqlite3 sqlite3:))
(declare (unit dashboard-tests))
(declare (uses common))
(declare (uses db))
(declare (uses gutils))
(declare (uses rmt))
(declare (uses ezsteps))
(declare (uses commonmod))
(declare (uses dbmod))
;; (declare (uses gutils))
(declare (uses rmtmod))
(declare (uses ezstepsmod))
;; (declare (uses sdb))
;; (declare (uses filedb))
(declare (uses subrun))
(declare (uses subrunmod))
(declare (uses debugprint))
(declare (uses configfmod))
(declare (uses testsmod))
(declare (uses mtmod))
(declare (uses dcommon))
(declare (uses launchmod))
(module dashboard-tests
(
message-window
test-info-panel
test-meta-panel-get-description
test-meta-panel
run-info-panel
host-info-panel
submegatest-panel
update-state-status-buttons
set-fields-panel
dashboard-tests:run-a-step
dashboard-tests:waiver
dashboard-tests:examine-test
colors-similar?
dashboard:draw-tests
dboard:tabdat-test-patts-use
dashboard:update-run-command
iuplistbox-fill-list
*tim*
*dashboard-comment-share-slot*
*state-status*
*dashboard-test-db*
*dashboard-comment-share-slot*
)
(import scheme
chicken.file.posix
chicken.base
chicken.string
chicken.condition
chicken.file
chicken.process-context
chicken.time
format
fmt
(prefix iup iup:)
canvas-draw
srfi-1
srfi-18
regex regex-case srfi-69
(prefix sqlite3 sqlite3:))
;; (include "common_records.scm")
;; (include "db_records.scm")
;; (include "run_records.scm")
(import commonmod
(include "common_records.scm")
(include "db_records.scm")
(include "run_records.scm")
dcommon
dbmod
rmtmod
ezstepsmod
subrunmod
debugprint
;; gutils
configfmod
testsmod
mtmod
launchmod
)
;;======================================================================
;; C O M M O N
;;======================================================================
(define *tim* (iup:timer))
(define *dashboard-comment-share-slot* #f)
(define (message-window msg)
(iup:show
(iup:dialog
(iup:vbox
|
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
|
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
|
-
-
+
+
|
dlog))
;;======================================================================
;;
;;======================================================================
(define (dashboard-tests:examine-test run-id test-id) ;; run-id run-key origtest)
(let* ((db-path (db:dbfile-path)) ;; (conc (configf:lookup *configdat* "setup" "linktree") "/db/" run-id ".db"))
(dbstruct #f) ;; NOT ACTUALLY USED (db:setup)) ;; (make-dbr:dbstruct path: (db:dbfile-path #f) ;; (configf:lookup *configdat* "setup" "linktree")
(let* ((db-path (common:get-db-tmp-area)) ;; (conc (configf:lookup *configdat* "setup" "linktree") "/db/" run-id ".db"))
(dbstruct #f) ;; NOT ACTUALLY USED (db:setup)) ;; (make-dbr:dbstruct path: (common:get-db-tmp-area #f) ;; (configf:lookup *configdat* "setup" "linktree")
;; local: #t))
(testdat (rmt:get-test-info-by-id run-id test-id)) ;; (db:get-test-info-by-id dbstruct run-id test-id))
(db-mod-time 0) ;; (file-modification-time db-path))
(last-update 0) ;; (current-seconds))
(request-update #t))
(if (not testdat)
(begin
|
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
|
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
|
-
-
-
+
+
+
|
(dcommon:initial-draw-tests cnv xadj yadj sizex sizey sizexmm sizeymm originx originy tests-draw-state sorted-testnames test-records))
(dcommon:redraw-tests cnv xadj yadj sizex sizey sizexmm sizeymm originx originy tests-draw-state sorted-testnames test-records))
))
(define (dboard:tabdat-test-patts-use vec)
(let ((val (dboard:tabdat-test-patts vec)))(if val val ""))) ;;RADT => What is the if for?
;; additional setters for dboard:data
(define (dboard:tabdat-test-patts-set!-use vec val)
(dboard:tabdat-test-patts-set! vec (if (equal? val "") #f val)))
;; ;; additional setters for dboard:data
;; (define (dboard:tabdat-test-patts-set!-use vec val)
;; (dboard:tabdat-test-patts-set! vec (if (equal? val "") #f val)))
;; Extract the various bits of data from tabdat and create the command line equivalent that will be displayed
;;
(define (dashboard:update-run-command tabdat)
(let* ((cmd-tb (dboard:tabdat-command-tb tabdat))
(cmd (dboard:tabdat-command tabdat))
(test-patt (let ((tp (dboard:tabdat-test-patts tabdat)))
|
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
|
987
988
989
990
991
992
993
994
|
-
-
-
-
-
-
-
-
-
-
-
+
|
(if (equal? selected-item item)
(iup:attribute-set! lb "VALUE" i))) ;; (number->string i))))
(set! i (+ i 1)))
items)
;; (iup:attribute-set! lb "VALUE" (if selected-item selected-item ""))
i))
;; if tab-num passed in then use it, otherwise look in commondat at curr-tab-num
;; adds the updater passed in the updaters list at that hashkey
;;
(define (dboard:commondat-add-updater commondat updater #!key (tab-num #f))
(let* ((tnum (or tab-num
(dboard:commondat-curr-tab-num commondat)))
(curr-updaters (hash-table-ref/default (dboard:commondat-updaters commondat) tnum '())))
(hash-table-set! (dboard:commondat-updaters commondat)
tnum
(cons updater curr-updaters))))
)
|