Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -164,13 +164,19 @@ ;; set pre-launch-env-vars before launching, keep the vars in prevvals and put the envionment back when done (let* ((commonprevvals (alist->env-vars (hash-table-ref/default *configdat* "env-override" '()))) (testprevvals (alist->env-vars (hash-table-ref/default test-conf "pre-launch-env-overrides" '()))) + (miscprevvals (alist->env-vars ;; consolidate this code with the code in megatest.scm for "-execute" + (append (list (list "MT_TEST_NAME" test-name) + (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_RUNNAME" (args:get-arg ":runname"))) + itemdat))) (launch-results (apply cmd-run-proc-each-line (car fullcmd) print (cdr fullcmd)))) ;; launcher fullcmd)));; (apply cmd-run-proc-each-line launcher print fullcmd))) ;; (cmd-run->list fullcmd)) (print "Launching completed, updating db") + (alist->env-vars miscprevvals) (alist->env-vars testprevvals) (alist->env-vars commonprevvals)))) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -6,11 +6,11 @@ ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. (include "common.scm") -(define megatest-version 1.07) +(define megatest-version 1.08) (define help (conc " Megatest, documentation at http://www.kiatoa.com/fossils/megatest version " megatest-version " license GPL, Copyright Matt Welland 2006-2011 Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -260,10 +260,11 @@ (run-one-test db test-name) (print "WARNING: Max running jobs exceeded, current number running: " num-running ", max_concurrent_jobs: " max-concurrent-jobs)))) test-names)) +;; VERY INEFFICIENT! Move stuff that should be done once up to calling proc (define (run-one-test db test-name) (print "Launching test " test-name) (let* ((test-path (conc *toppath* "/tests/" test-name)) (test-configf (conc test-path "/testconfig")) (testexists (and (file-exists? test-configf)(file-read-access? test-configf))) @@ -281,10 +282,11 @@ (items (hash-table-ref/default test-conf "items" #f)) (allitems (item-assoc->item-list items)) (run-id (register-run db keys)) ;; test-name))) (runconfigf (conc *toppath* "/runconfigs.config"))) ;; (print "items: ")(pp allitems) + (set-megatest-env-vars db run-id) ;; these may be needed by the launching process (if (args:get-arg "-m") (db:set-comment-for-run db run-id (args:get-arg "-m"))) (let loop ((itemdat (car allitems)) (tal (cdr allitems))) ;; (lambda (itemdat) ;;; ((ripeness "overripe") (temperature "cool") (season "summer")) Index: tests/megatest.config ================================================================== --- tests/megatest.config +++ tests/megatest.config @@ -11,10 +11,15 @@ [jobtools] # ## launcher launches jobs, the job is managed on the target host ## by megatest, comment out launcher to run local # workhosts localhost hermes launcher nbfake + +## use "xterm -e csi -- " as a launcher to examine the launch environment. +## exit with (exit) +## get a shell with (system "bash") +# launcher xterm -e csi -- [validvalues] state start end completed status pass fail n/a