94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
(numtarg (length targlist))
(targtweaked (if (> numkeys numtarg)
(append targlist (make-list (- numkeys numtarg) ""))
targlist)))
(map (lambda (key targ)
(list (vector-ref key 0) targ))
keys targtweaked)))
;;======================================================================
;; key <=> args routines
;;======================================================================
;; Using the keys pulled from the database (initially set from the megatest.config file)
;; look for the equivalent value on the command line and add it to a list, or #f if not found.
;; default => (val1 val2 val3 ...)
;; withkey => (:key1 val1 :key2 val2 :key3 val3 ...)
(define (keys->vallist keys . withkey) ;; ORDERING IS VERY IMPORTANT, KEEP PROPER ORDER HERE!
(let* ((keynames (map key:get-fieldname keys))
(argkeys (map (lambda (k)(conc ":" k)) keynames))
(withkey (not (null? withkey)))
(newremargs (args:get-args (cons "blah" remargs) argkeys '() args:arg-hash 0))) ;; the cons blah works around a bug in args [args assumes ("calling-prog-name" .... ) ]
;;(debug:print 0 "remargs: " remargs " newremargs: " newremargs)
(apply append (map (lambda (x)
(let ((val (args:get-arg x)))
;; (debug:print 0 "x: " x " val: " val)
(if (not val)
(begin
(if (not (hash-table-ref/default keys:warning-suppress-hash x #f))
|
>
>
|
>
>
>
>
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
(numtarg (length targlist))
(targtweaked (if (> numkeys numtarg)
(append targlist (make-list (- numkeys numtarg) ""))
targlist)))
(map (lambda (key targ)
(list (vector-ref key 0) targ))
keys targtweaked)))
;;======================================================================
;; key <=> args routines
;;======================================================================
;; Using the keys pulled from the database (initially set from the megatest.config file)
;; look for the equivalent value on the command line and add it to a list, or #f if not found.
;; default => (val1 val2 val3 ...)
;; withkey => (:key1 val1 :key2 val2 :key3 val3 ...)
(define (keys->vallist keys . withkey) ;; ORDERING IS VERY IMPORTANT, KEEP PROPER ORDER HERE!
(let* ((keynames (map key:get-fieldname keys))
(argkeys (map (lambda (k)(conc ":" k)) keynames))
(withkey (not (null? withkey)))
(newremargs (args:get-args
(cons "blah" remargs) ;; the cons blah works around a bug in args [args assumes ("calling-prog-name" .... ) ]
argkeys
'()
args:arg-hash
0)))
;;(debug:print 0 "remargs: " remargs " newremargs: " newremargs)
(apply append (map (lambda (x)
(let ((val (args:get-arg x)))
;; (debug:print 0 "x: " x " val: " val)
(if (not val)
(begin
(if (not (hash-table-ref/default keys:warning-suppress-hash x #f))
|