@@ -65,10 +65,14 @@ (define-inline (keys->key/field keys . additional) (string-join (map (lambda (k)(conc (key:get-fieldname k) " " (key:get-fieldtype k)))(append keys additional)) ",")) (define (args:usage . a) #f) + +;; keys->vallist is called several times (quite unnecessarily), use this hash to suppress multiple +;; reporting of missing keys on the command line. +(define keys:warning-suppress-hash (make-hash-table)) ;; 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 ...) @@ -80,12 +84,16 @@ ;;(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) - ;; (debug:print 0 "WARNING: missing key " x ". Specified in database but not on command line, using \"unk\"") - (set! val "default")) + (begin + (if (not (hash-table-ref/default keys:warning-suppress-hash x #f)) + (begin + (debug:print 0 "WARNING: missing key " x ". Specified in database but not on command line, using \"unk\"") + (hash-table-set! keys:warning-suppress-hash x #t))) + (set! val "default"))) (if withkey (list x val) (list val)))) argkeys)))) ;; Given a list of keys (list of vectors) return an alist ((key argval) ...) (define (keys->alist keys defaultval)