Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -18,10 +18,11 @@ (import (prefix base64 base64:)) (import (prefix sqlite3 sqlite3:)) (declare (unit launch)) +(declare (uses subrun)) (declare (uses common)) (declare (uses configf)) (declare (uses db)) (include "common_records.scm") @@ -322,11 +323,11 @@ ;; 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 logpro) + (subrun:initialize-toprun-test testconfig test-run-dir) (let* ((mt-cmd (subrun:launch-cmd test-run-dir))) (debug:print-info 0 *default-log-port* "Subrun command is \"" mt-cmd "\"") (set! ezsteps #t) ;; set the needed flag (set! ezstepslst (append (or ezstepslst '()) Index: subrun.scm ================================================================== --- subrun.scm +++ subrun.scm @@ -11,45 +11,47 @@ ;; strftime('%m/%d/%Y %H:%M:%S','now','localtime') (use (prefix sqlite3 sqlite3:) srfi-1 posix regex regex-case srfi-69 (srfi 18) posix-extras directory-utils pathname-expand typed-records format) (declare (unit subrun)) -(declare (uses runs)) -(declare (uses db)) +;;(declare (uses runs)) +;;(declare (uses db)) (declare (uses common)) -(declare (uses items)) -(declare (uses runconfig)) -(declare (uses tests)) -(declare (uses server)) -(declare (uses mt)) -(declare (uses archive)) +;;(declare (uses items)) +;;(declare (uses runconfig)) +;;(declare (uses tests)) +;;(declare (uses server)) +;;(declare (uses mt)) +;;(declare (uses archive)) ;; (declare (uses filedb)) (include "common_records.scm") -(include "key_records.scm") -(include "db_records.scm") -(include "run_records.scm") -(include "test_records.scm") - - -(define (subrun:initialize-toprun-test test-run-dir testconfig) - (let ((ra (configf:lookup testconfig "subrun" "run-area"))) - (when (not ra) ;; when runarea is not set we default to *toppath*. However +;;(include "key_records.scm") +;;(include "db_records.scm") +;;(include "run_records.scm") +;;(include "test_records.scm") + + +(define (subrun:initialize-toprun-test testconfig test-run-dir) + + (let ((ra (configf:lookup testconfig "subrun" "run-area")) + (logpro (configf:lookup testconfig "subrun" "logpro"))) + (when (not ra) ;; when runarea is not set we default to *toppath*. However ;; we need to force the setting in the testconfig so it will ;; be preserved in the testconfig.subrun file - (configf:set-section-var testconfig "subrun" "runarea" *toppath*) - ) - - (configf:write-alist testconfig "testconfig.subrun") - ) + (configf:set-section-var testconfig "subrun" "runarea" *toppath*)) + (configf:set-section-var testconfig "logpro" "subrun" logpro) ;; append the logpro rules to the logpro section as stepname subrun + (configf:write-alist testconfig "testconfig.subrun"))) -(define (subrun:launch ) - - - - ) +(define (subrun:launch-cmd test-run-dir) + (let ((log-prefix "run") + (switches (subrun:selector+log-switches test-run-dir log-prefix)) + (run-wait #t) + (cmd (conc "megatest -run "switches" " + (if runwait "-run-wait " "")))) + cmd)) ;; set state/status of test item ;; fork off megatest ;; set state/status of test item ;; @@ -73,17 +75,17 @@ defval))) (if val (list switch val) #f))) switch-def-alist))) - (target (or (alist-ref switch-alist "-target" equal?) + (target (or (alist-ref "-target" switch-alist equal? #f) ;; want data-structures alist-ref, not alist-lib alist-ref "NO-TARGET")) - (runname (or (alist-ref switch-alist "-runname" equal?) + (runname (or (alist-ref "-runname" switch-alist equal? #f) "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?)) + (testpatt (alist-ref "-testpatt" switch-alist equal? #f)) + (mode-patt (alist-ref "-modepatt" switch-alist equal? #f)) + (tag-expr (alist-ref "-tagexpr" switch-alist equal? #f)) (compact-stem (string-substitute "[/*]" "_" (conc target "-" runname @@ -97,10 +99,15 @@ ;; note - get precmd from subrun section ;; apply to submegatest commands (conc " -start-dir " run-area " " + " -runname " runname " " + " -target " target " " + (if testpatt (conc "-testpatt " testpatt" ") "") + (if modepatt (conc "-modepatt " modepatt" ") "") + (if tag-expr (conc "-tag-expr " tag-expr" ") "") (string-intersperse (apply append (map (lambda (x) (list (car x) (cdr x))) switch-def-alist)) " ")