Megatest

Diff
Login

Differences From Artifact [ab11d5875b]:

To Artifact [f5f7549be1]:


319
320
321
322
323
324
325

326

327
328
329
330
331

332
333
334
335
336

337
338
339
340
341
342
343
319
320
321
322
323
324
325
326

327
328
329
330
331
332
333
334
335
336
337

338
339
340
341
342
343
344
345







+
-
+





+




-
+







	;; 2. unset MT_* vars
	;; 3. fix target
	;; 4. fix runname
	;; 5. fix testpatt or calculate it from contour
	;; 6. launch the run
	;; 7. roll up the run result and or roll up the logpro processed result
	(if (configf:lookup testconfig "subrun" "runwait") ;; we use runwait as the flag that a subrun is requested
            (configf:write-alist testconfig "testconfig.subrun") ;; BB: created here
	    (let* ((runarea   (let ((ra (configf:lookup testconfig "subrun" "runarea")))
	    (let* ((runarea   (let ((ra (configf:lookup testconfig "subrun" "run-area")))
				(if ra      ;; when runarea is not set we default to *toppath*. However 
				    ra      ;; we need to force the setting in the testconfig so it will
				    (begin  ;; be preserved in the testconfig.subrun file
				      (configf:set-section-var testconfig "subrun" "runarea" *toppath*)
				      *toppath*))))
                   ;;; BB: TODO - use common:param
		   (passfail  (configf:lookup testconfig "subrun" "passfail"))
		   (target    (or (configf:lookup testconfig "subrun" "target") (get-environment-variable "MT_TARGET")))
		   (runname   (or (configf:lookup testconfig "subrun" "runname")(get-environment-variable "MT_RUNNAME")))
		   (contour   (configf:lookup testconfig "subrun" "contour"))
		   (testpatt  (configf:lookup testconfig "subrun" "testpatt"))
		   (testpatt  (configf:lookup testconfig "subrun" "test-patt"))
		   (mode-patt (configf:lookup testconfig "subrun" "mode-patt"))
		   (tag-expr  (configf:lookup testconfig "subrun" "tag-expr"))
		   (run-wait  (configf:lookup testconfig "subrun" "runwait"))
		   (logpro    (configf:lookup testconfig "subrun" "logpro"))
		   (compact-stem (string-substitute "[/*]" "_" (conc target "-" runname "-" (or testpatt mode-patt tag-expr))))
		   (log-file (conc compact-stem ".log"))
		   (mt-cmd    (conc "megatest -run -target " target
364
365
366
367
368
369
370
371

372
373
374
375
376
377
378
366
367
368
369
370
371
372

373
374
375
376
377
378
379
380







-
+







	      ;; (common:without-vars mt-cmd "^MT_.*")
              (debug:print-info 0 *default-log-port* "Subrun command is \"" mt-cmd "\"")
              (set! ezsteps #t) ;; set the needed flag
	      (set! ezstepslst (append (or ezstepslst '())
                                       (list (list "subrun" (conc "{subrun=true} " mt-cmd)))))
	      (configf:set-section-var testconfig "logpro" "subrun" logpro) ;; append the logpro rules to the logpro section as stepname subrun
              (if runarea (configf:set-section-var testconfig "setup" "submegatest" runarea))
              (configf:write-alist testconfig "testconfig.subrun")

	      ))

	;; process the ezsteps
	(if ezsteps
	    (begin
	      (if (not (common:file-exists? ".ezsteps"))(create-directory ".ezsteps"))
	      ;; if ezsteps was defined then we are sure to have at least one step but check anyway