Megatest

Diff
Login

Differences From Artifact [225b8827e5]:

To Artifact [8ea3260641]:


67
68
69
70
71
72
73
74
75
76








77
78
79
80
81
82
83
67
68
69
70
71
72
73



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88







-
-
-
+
+
+
+
+
+
+
+







			       (list? x))
			     (map (lambda (x)
				    (debug:print 6 "item-assoc->item-list x: " x)
				    (if (< (length x) 2)
					(begin
					  (debug:print 0 "ERROR: malformed items spec " (string-intersperse x " "))
					  (list (car x)'()))
					(let ((name (car x))
					      (items (cadr x)))
					  (list name (string-split items)))))
					(let* ((name (car x))
					       (items (cadr x))
					       (ilist (list name (if (string? items)
								     (string-split items)
								     '()))))
					  (if (null? ilist)
					      (debug:print 0 "ERROR: No items specified for " name))
					  ilist)))
				  itemsdat))))
	(let ((debuglevel 5))
	  (debug:print 5 "item-assoc->item-list: itemsdat => itemlst ")
	  (if (debug:debug-mode 5)
	      (begin
		(pp itemsdat)
		(print " => ")
130
131
132
133
134
135
136
137
138


139

140
141
142
143
144
145
146
147
148
149















150
151
152


153
154
155
156
157
158
135
136
137
138
139
140
141


142
143
144
145










146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161


162
163
164
165
166
167
168
169







-
-
+
+

+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
-
+
+






    (if valid-values
	(if (member item valid-values)
	    item #f)
	item)))

(define (items:get-items-from-config tconfig)
  (let* (;; db is always at *toppath*/db/megatest.db
	 (items       (hash-table-ref/default tconfig "items" '()))
	 (itemstable  (hash-table-ref/default tconfig "itemstable" '())))
	 (items       (hash-table-ref/default tconfig "items" #f))
	 (itemstable  (hash-table-ref/default tconfig "itemstable" #f)))
    (debug:print 5 "items: " items " itemstable: " itemstable)
    (if items
    (set! items (map (lambda (item)
		       (if (procedure? (cadr item))
			   (list (car item)((cadr item)))
			   item))
		     items))
    (set! itemstable (map (lambda (item)
			    (if (procedure? (cadr item))
				(list (car item)((cadr item)))
				item))
			  itemstable))
	(set! items (map (lambda (item)
			   (if (procedure? (cadr item))
			       (list (car item)((cadr item)))
			       item))
			 items)))
    (if itemstable 
	(set! itemstable (map (lambda (item)
				(if (procedure? (cadr item))
				    (list (car item)((cadr item)))
				    item))
			      itemstable)))
    (if (and items (null? items))
	(debug:print 0 "ERROR: You have an [items] section in your testconfig but there were no items define!"))
    (if (and itemstable (null? itemstable))
	(debug:print 0 "ERROR: You have an [itemstable] section in your testconfig but there were no entries defined!"))
    (if (or (not (null? items))(not (null? itemstable)))
	(append (item-assoc->item-list items)
		(item-table->item-list itemstable))
	(append (if items      (item-assoc->item-list items)      '())
		(if itemstable (item-table->item-list itemstable) '()))
	'(()))))

;; (pp (item-assoc->item-list itemdat))