Megatest

Diff
Login

Differences From Artifact [4c4fc29305]:

To Artifact [a0465e9dd6]:


14
15
16
17
18
19
20










21
22
23
24
25
26
27
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37







+
+
+
+
+
+
+
+
+
+







;;
;; Accessors for a dbstruct
;;

(use defstruct)

(defstruct dbr:dbstruct main strdb path local rundb inmem mtime rtime stime inuse refdb locdbs olddb rundb-path)

;; constructor for dbstruct
;;
(define (make-dbr:dbstruct-wrapper #!key (path #f)(local #f))
  (let ((res (make-dbr:dbstruct)))
    (dbr:dbstruct-path-set! res path)
    (dbr:dbstruct-local-set! res local)
    (dbr:dbstruct-locdbs-set! res (make-hash-table))
    res)) 

;;; (define d1 (make-dbr:dbstruct))
;;; (dbr:dbstruct-main d1)             ==> retrive value
;;; (dbr:dbstruct-main-set! d1 'def)   ==> set value

;; (define-inline (dbr:dbstruct-get-main    vec)    (vector-ref  vec 0)) ;; ( db path )
;; (define-inline (dbr:dbstruct-get-strdb   vec)    (vector-ref  vec 1)) ;; ( db path )
;; (define-inline (dbr:dbstruct-get-path    vec)    (vector-ref  vec 2)) 
60
61
62
63
64
65
66
67
68


69
70
71


72
73
74
75
76
77
78
70
71
72
73
74
75
76


77
78
79


80
81
82
83
84
85
86
87
88







-
-
+
+

-
-
+
+







;; constructor for dbstruct
;;

;; BB: commenting out following 3 methods since they are unused
;; (define (actual-make-dbr:dbstruct #!key (path #f)(local #f))
;;   (make-dbr:dbstruct path: path local: local locdbs: (make-hash-table)))

;; (define (dbr:dbstruct-get-localdb v run-ids)
;;   (hash-table-ref/default (dbr:dbstruct-locdbs v) run-id #f))
(define (dbr:dbstruct-localdb v run-id)
   (hash-table-ref/default (dbr:dbstruct-locdbs v) run-id #f))

;; (define (dbr:dbstruct-set-localdb! v run-id db)
;;   (hash-table-set! (dbr:dbstruct-locdbs v) run-id db))
(define (dbr:dbstruct-localdb-set! v run-id db)
  (hash-table-set! (dbr:dbstruct-locdbs v) run-id db))

(defstruct db:test id run_id testname state status event_time host cpuload
           diskfree uname rundir item-path run_duration final_logf
           comment process_id pass_count fail_count archived )
;; BB: 16ww4.3 begin comment out 
;; (define (make-db:test)(make-vector 20))
;; (define-inline (db:test-get-id           vec) (vector-ref vec 0))