Megatest

Diff
Login

Differences From Artifact [41a7ac7d26]:

To Artifact [52b9831c5a]:


119
120
121
122
123
124
125
126

127
128
129
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
159
160

161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176


177
178
179
180
181
182
183
184
185
186
187
188


189
190
191
192










193
194
195
196
197
198
199
119
120
121
122
123
124
125

126
127
128
129
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
159
160
161

162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194




195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211







-
+




-
+



-
+
+









-
+
+














-
+
















+
+












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







		      (config-lookup config "requirements" "waiton")
		      (begin ;; No config means this is a non-existant test
			(debug:print 0 "ERROR: non-existent required test \"" test-name "\"")
			(exit 1))))
	   (instr2 (if config
		       (config-lookup config "requirements" "waitor")
		       "")))
       (debug:print-info 8 "waitons string is " instr ", waitors string is " instr2)
       (debug:print-info 0 "BB: RAW waiton("test-name") is >" instr "<, waitors string is >" instr2"<") ; BB 8 to 0
       (let ((newwaitons
	      (string-split (cond
			     ((procedure? instr)
			      (let ((res (instr)))
				(debug:print-info 8 "waiton procedure results in string " res " for test " test-name)
				(debug:print-info 0 "waiton procedure results in string " res " for test " test-name) ; BB changed from 8 to 0
				res))
			     ((string? instr)     instr)
			     (else 
			      ;; NOTE: This is actually the case of *no* waitons! ;; (debug:print 0 "ERROR: something went wrong in processing waitons for test " test-name)
			      ;; NOTE: This is actually the case of *no* waitons!
                              (debug:print 0 "BB: ERROR: something went wrong in processing waitons for test " test-name) ;; BB: uncommented.
			      ""))))
	     (newwaitors
	      (string-split (cond
			     ((procedure? instr2)
			      (let ((res (instr2)))
				(debug:print-info 8 "waitor procedure results in string " res " for test " test-name)
				res))
			     ((string? instr2)     instr2)
			     (else 
			      ;; NOTE: This is actually the case of *no* waitons! ;; (debug:print 0 "ERROR: something went wrong in processing waitons for test " test-name)
			      ;; NOTE: This is actually the case of *no* waitors! ;; BB: WRONG.  This seems to be the case of ALL waitors.
                              ;;(debug:print 0 "BB: ERROR: something went wrong in processing waitors for test " test-name) ; BB: uncommented/recommented
			      "")))))
	 (values
	  ;; the waitons
	  (filter (lambda (x)
		    (if (hash-table-ref/default all-tests-registry x #f)
			#t
			(begin
			  (debug:print 0 "ERROR: test " test-name " has unrecognised waiton testname " x)
			  #f)))
		  newwaitons)
	  (filter (lambda (x)
		    (if (hash-table-ref/default all-tests-registry x #f)
			#t
			(begin
			  (debug:print 0 "ERROR: test " test-name " has unrecognised waiton testname " x)
			  (debug:print 0 "ERROR: test " test-name " has unrecognised waitor testname " x)
			  #f)))
		  newwaitors)
	  config)))))
					     
;; given waiting-test that is waiting on waiton-test extend test-patt appropriately
;;
;;  genlib/testconfig               sim/testconfig
;;  genlib/sch                      sim/sch/cell1
;;
;;  [requirements]                  [requirements]
;;                                  mode itemwait
;;                                  # trim off the cell to determine what to run for genlib
;;                                  itemmap /.*
;;
;;                                  waiting-test is waiting on waiton-test so we need to create a pattern for waiton-test given waiting-test and itemmap
(define (tests:extend-test-patts test-patt waiting-test waiton-test itemmaps)

  (debug:print-info 0 "BB: iter="(counter test-patt)" test:extend-test-patts entered with test-patt="test-patt" waiting-test="waiting-test" waiton-test="waiton-test" itemmaps="itemmaps)
  (let* ((itemmap          (tests:lookup-itemmap itemmaps waiton-test))
	 (patts            (string-split test-patt ","))
	 (waiting-test-len (+ (string-length waiting-test) 1))
	 (patts-waiton     (map (lambda (x)  ;; for each incoming patt that matches the waiting test
				  (let* ((modpatt (if itemmap (db:convert-test-itempath x itemmap) x)) 
					 (newpatt (conc waiton-test "/" (substring modpatt waiting-test-len (string-length modpatt)))))
				    ;; (conc waiting-test "/," waiting-test "/" (substring modpatt waiton-test-len (string-length modpatt)))))
				    ;; (print "in map, x=" x ", newpatt=" newpatt)
				    newpatt))
				(filter (lambda (x)
					  (eq? (substring-index (conc waiting-test "/") x) 0)) ;; is this patt pertinent to the waiting test
					patts))))

    (let ((res
    (string-intersperse (delete-duplicates (append patts (if (null? patts-waiton)
							     (list (conc waiton-test "/%")) ;; really shouldn't add the waiton forcefully like this
							     patts-waiton)))
			",")))
           (string-intersperse
            (delete-duplicates
             (append
              patts
              (if (null? patts-waiton)
                  (list (conc waiton-test "/%")) ;; really shouldn't add the waiton forcefully like this
                  patts-waiton)))
            ",")))
      (debug:print-info 0 "BB: test:extend-test-patts returns "res)
      res)))
  
;; tests:glob-like-match 
(define (tests:glob-like-match patt str) 
  (let ((like (substring-index "%" patt)))
    (let* ((notpatt  (equal? (substring-index "~" patt) 0))
	   (newpatt  (if notpatt (substring patt 1) patt))
	   (finpatt  (if like