Megatest

Check-in [7f979aed51]
Login
Overview
Comment:More work on itemmaps
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: 7f979aed51bed1d0cae33c348431ce1e761ba310
User & Date: matt on 2015-09-13 02:11:28
Other Links: branch diff | manifest | tags
Context
2015-09-13
22:15
Basic support for waitors added to testconfig handling check-in: 5f864575d1 user: matt tags: v1.60
02:11
More work on itemmaps check-in: 7f979aed51 user: matt tags: v1.60
2015-09-12
05:26
itemmap table lookup needed to return the cdr of the found data. check-in: a01207a48a user: matt tags: v1.60
Changes

Modified dashboard-tests.scm from [9666ae3621] to [e8f3d0e868].

601
602
603
604
605
606
607
608

609
610
611


612
613

614
615
616
617
618
619
620
601
602
603
604
605
606
607

608
609


610
611
612

613
614
615
616
617
618
619
620







-
+

-
-
+
+

-
+







			       command-text-box "VALUE"
			       (conc "megatest -remove-runs -target " keystring " -runname " runname
				     " -testpatt " (conc testname "/" (if (equal? item-path "")
									  "%"
									  item-path))
				     " -v"))))
	       (clean-run-execute  (lambda (x)
				     (let ((cmd (conc "bmegatest -remove-runs -target " keystring " -runname " runname
				     (let ((cmd (conc "megatest -remove-runs -target " keystring " -runname " runname
						      " -testpatt " (conc testname "/" (if (equal? item-path "")
											   "%"
											   item-path))
						       					   "%"
						       					   item-path))
						      ";megatest -target " keystring " -runname " runname 
						      " -runtests " (conc testname "/" (if (equal? item-path "")
						      " -run -preclean -testpatt " (conc testname "/" (if (equal? item-path "")
											   "%" 
											   item-path))
						      )))
				       (system (conc (dtests:get-pre-command)
						     cmd 
						     (dtests:get-post-command))))))
	       (remove-test (lambda (x)

Modified docs/manual/reference.txt from [ae56b797b4] to [88bde1cc13].

184
185
186
187
188
189
190
191
192

193
194
195
196
197
198
199
184
185
186
187
188
189
190


191
192
193
194
195
196
197
198







-
-
+







.Testconfig for Test C
----------------------
[requirements]
waiton A B

[itemmap]
A (\d+)/aa aa/\1
B (\d+)/bb bb/\1
----------------------
B (\d+)/bb --------------------

.Testconfig for Test D
----------------------
[requirements]
waiton C
itemmap (\d+)/res \1/aa
----------------------
210
211
212
213
214
215
216
217

218
219
220
221
222
223

224
225
226
227
228
229
230
209
210
211
212
213
214
215

216
217
218
219
220
221
222
223
224
225
226
227
228
229
230







-
+






+








.Autogeneration waiton list for dynamic flow dependency trees
-------------------
[requirements]
# With a toplevel test you may wish to generate your list 
# of tests to run dynamically
#
# waiton #{shell get-valid-tests-to-run.sh}
waiton #{shell get-valid-tests-to-run.sh}
-------------------

Run time limit
^^^^^^^^^^^^^^

-----------------
[requirements]
runtimelim 1h 2m 3s  # this will automatically kill the test if it runs for more than 1h 2m and 3s
-----------------

Skip
^^^^

A test with a skip section will conditional skip running.

Modified tests.scm from [6518306e90] to [2605fb7b0b].

82
83
84
85
86
87
88
89

90
91
92
93
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
128
129
130
131

















132
133
134
135
136
137
138
82
83
84
85
86
87
88

89
90
91
92
93
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145







-
+













-
+
+
+
+
+
+
+
+

-
+









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







;; #       itemmap entry in requirements (legacy). The itemmap
;; #       requirements entry is deprecated
;;
(define (tests:get-itemmaps tconfig)
  (let ((base-itemmap  (configf:lookup tconfig "requirements" "itemmap"))
	(itemmap-table (configf:get-section tconfig "itemmap")))
    (append (if base-itemmap
		(list (cons "%" base-itemmap))
		(list (list "%" base-itemmap))
		'())
	    (if itemmap-table
		itemmap-table
		'()))))

;; given a list of itemmaps (testname . map), return the first match
;;
(define (tests:lookup-itemmap itemmaps testname)
  (let ((best-matches (filter (lambda (itemmap)
				(tests:match (car itemmap) testname #f))
			      itemmaps)))
    (if (null? best-matches)
	#f
	(cdr (car best-matches)))))
	(let ((res (car best-matches)))
	  (debug:print 0 "res=" res)
	  (cond
	   ((string? res) res) ;;; FIX THE ROOT CAUSE HERE ....
	   ((null? res)   #f)
	   ((string? (cdr res)) (cdr res))  ;; it is a pair
	   ((string? (cadr res))(cadr res)) ;; it is a list
	   (else cadr res))))))
					     
;; given test-b that is waiting on test-a extend test-patt appropriately
;; 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 /.*
;;
;;                                  test-a is waiting on test-b so we need to create a pattern for test-b given test-a and itemmap
(define (tests:extend-test-patts test-patt test-b test-a itemmaps)
  (let* ((itemmap    (tests:lookup-itemmap itemmaps test-b))
	 (patts      (string-split test-patt ","))
	 (test-b-len (+ (string-length test-b) 1))
	 (patts-b    (map (lambda (x)
			    (let* ((modpatt (if itemmap (db:convert-test-itempath x itemmap) x)) 
				   (newpatt (conc test-a "/" (substring modpatt test-b-len (string-length modpatt)))))
				         ;; (conc test-a "/," test-a "/" (substring modpatt test-b-len (string-length modpatt)))))
			      ;; (print "in map, x=" x ", newpatt=" newpatt)
			      newpatt))
			  (filter (lambda (x)
				    (eq? (substring-index (conc test-b "/") x) 0))
				  patts))))
    (string-intersperse (delete-duplicates (append patts (if (null? patts-b)
							     (list (conc test-a "/%"))
							     patts-b)))
;;                                  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)
  (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))))
    (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)))
			",")))
  
;; 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))