Megatest

Diff
Login

Differences From Artifact [8a33d5ef0f]:

To Artifact [770c175ffa]:


3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287




3288








3289



3290



3291
3292
3293
3294
3295
3296
3297
	    (equal? (string-substitute pattern "" patha)
		    (string-substitute pattern "" pathb))))
      (equal? patha pathb)))

;; A routine to convert test/itempath using a itemmap
(define (db:convert-test-itempath path-in itemmap)
  (debug:print-info 6 "ITEMMAP is " itemmap)
  (let* ((mapparts    (string-split itemmap))
	 (pattern     (car mapparts))
	 (replacement (if (> (length mapparts) 1) (cadr mapparts) ""))
	 (path-parts  (string-split path-in "/"))
	 (test-name   (car path-parts))
	 (item-path   (string-intersperse (cdr path-parts) "/")))
    (conc test-name "/" 




	  (if replacement








	      (string-substitute pattern replacement item-path)



	      (string-substitute pattern "" path-in)))))




;; the new prereqs calculation, looks also at itempath if specified
;; all prereqs must be met:
;;    if prereq test with itempath='' is COMPLETED and PASS, WARN, CHECK, or WAIVED then prereq is met
;;    if prereq test with itempath=ref-item-path and COMPLETED with PASS, WARN, CHECK, or WAIVED then prereq is met
;;
;; Note: mode 'normal means that tests must be COMPLETED and ok (i.e. PASS, WARN, CHECK, SKIP or WAIVED)







<
<
<
|



>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
>
>
|
>
>
>







3274
3275
3276
3277
3278
3279
3280



3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
	    (equal? (string-substitute pattern "" patha)
		    (string-substitute pattern "" pathb))))
      (equal? patha pathb)))

;; A routine to convert test/itempath using a itemmap
(define (db:convert-test-itempath path-in itemmap)
  (debug:print-info 6 "ITEMMAP is " itemmap)



  (let* ((path-parts  (string-split path-in "/"))
	 (test-name   (car path-parts))
	 (item-path   (string-intersperse (cdr path-parts) "/")))
    (conc test-name "/" 
	  (db:multi-pattern-apply item-path itemmap))))

;; patterns are:
;;    "rx1"  "replacement1"\n
;;    "rx2"  "replacement2"
;; etc.
;;
(define (db:multi-pattern-apply item-path itemmap)
  (let ((all-patts (string-split itemmap "\n")))
    (if (null? all-patts)
	item-path
	(let loop ((hed (car all-patts))
		   (tal (cdr all-patts))
		   (res item-path))
	  (let* ((parts (string-split hed))
		 (patt  (car parts))
		 (repl  (if (> (length parts) 1)(cadr parts) ""))
		 (newr  (string-substitute patt repl res)))
	    (if (null? tal)
		newr
		(loop (car tal)(cdr tal) newr)))))))

;; the new prereqs calculation, looks also at itempath if specified
;; all prereqs must be met:
;;    if prereq test with itempath='' is COMPLETED and PASS, WARN, CHECK, or WAIVED then prereq is met
;;    if prereq test with itempath=ref-item-path and COMPLETED with PASS, WARN, CHECK, or WAIVED then prereq is met
;;
;; Note: mode 'normal means that tests must be COMPLETED and ok (i.e. PASS, WARN, CHECK, SKIP or WAIVED)