Overview
Context
Changes
Modified launch.scm
from [e40ed8df21]
to [a8e0155aa6].
︙ | | |
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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
|
;; 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
(subrun:initialize-toprun-test testconfig test-run-dir)
(subrun:initialize-toprun-test testconfig test-run-dir logpro)
(let* ((mt-cmd (subrun:launch-cmd test-run-dir)))
(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" "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
" -runname " runname
(conc " -start-dir " runarea) ;; (if runarea runarea *toppath*))
(if testpatt (conc " -testpatt " testpatt) "")
(if mode-patt (conc " -modepatt " mode-patt) "")
(if tag-expr (conc " -tag-expr" tag-expr) "")
(if (equal? run-wait "yes") " -run-wait " "")
" -log " log-file)))
;; change directory to runarea, create it if needed, we do NOT create the directory
;; (if runarea
;; (if (directory-exists? runarea)
;; (change-directory runarea)
;; (begin
;; (debug:print 0 *default-log-port* "ERROR: for sub-megatest run the runarea \"" runarea "\" does not exist! EXITING.")
;; (exit 1))))
;; (let ((subrun (conc *toppath* "/subrun") #t))
;; (create-directory subrun)
;; (change-directory subrun)))
;; by this point we are in the right place to run the subrun and we have a Megatest command to run
;; (filter (lambda (x)(string-match "MT_.*" (car x))) (get-environment-variables))
;; (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)))))
(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))
))
;; 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
(if (not (> (length ezstepslst) 0))
|
︙ | | |
Modified subrun.scm
from [1080da5c1d]
to [f8b080e239].
︙ | | |
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
-
-
+
+
+
+
-
+
-
+
|
(defval (alist-ref defvals switch equal?))
(val (or (configf:lookup subrunconfig switch)
defval)))
(if val
(list switch val)
#f)))
switch-def-alist)))
(target (alist-ref switch-alist "-target" equal?))
(runname (alist-ref switch-alist "-runname" equal?))
(target (or (alist-ref switch-alist "-target" equal?)
"NO-TARGET"))
(runname (or (alist-ref switch-alist "-runname" equal?)
"NO-RUNNAME"))
(testpatt (alist-ref switch-alist "-testpatt" equal?))
(mode-patt (alist-ref switch-alist "-modepatt" equal?))
(tag-expr (alist-ref switch-alist "-tagexpr" equal?))
(compact-stem (string-substitute "[/*]" "_"
(conc
(or target "NO-TARGET")
target
"-"
(or runname "NO-RUNNAME")
runname
"-" (or testpatt mode-patt tag-expr "NO-TESTPATT"))))
(logfile (conc
test-run-dir "/"
(or log-prefix "")
(if log-prefix "-" "")
compact-stem
".log")))
|
︙ | | |