Index: bigmod.scm ================================================================== --- bigmod.scm +++ bigmod.scm @@ -19,14 +19,15 @@ ;;====================================================================== (declare (unit bigmod)) (declare (uses debugprint)) +(declare (uses mtargs)) (declare (uses commonmod)) (declare (uses configfmod)) -(declare (uses rmtmod)) (declare (uses dbmod)) +(declare (uses rmtmod)) (module bigmod () (import scheme @@ -43,17 +44,18 @@ chicken.string chicken.time chicken.module debugprint + (prefix mtargs args:) commonmod configfmod - dbmod - rmtmod +;; dbmod +;; rmtmod (prefix base64 base64:) - (prefix dbi dbi:) + ;; (prefix dbi dbi:) (prefix sqlite3 sqlite3:) (srfi 18) directory-utils format matchable @@ -69,12 +71,49 @@ typed-records z3 ) -(reexport debugprint +(reexport scheme + + chicken.base + chicken.condition + chicken.file + chicken.io + chicken.pathname + chicken.port + chicken.pretty-print + chicken.process + chicken.process-context + chicken.sort + chicken.string + chicken.time + chicken.module + + (prefix base64 base64:) + ;; (prefix dbi dbi:) + (prefix sqlite3 sqlite3:) + (srfi 18) + directory-utils + format + matchable + md5 + message-digest + regex + regex-case + sparse-vectors + srfi-1 + srfi-13 + srfi-69 + stack + typed-records + z3 + commonmod configfmod - dbmod - rmtmod) + ;; dbmod + debugprint + ;; rmtmod + + ) ) Index: commonmod.scm ================================================================== --- commonmod.scm +++ commonmod.scm @@ -1117,13 +1117,13 @@ res) #t)) ;;====================================================================== ;; '(print (string-intersperse (map cadr (hash-table-ref/default (configf:read-config "megatest.config" \#f \#t) "disks" '"'"'("none" ""))) "\n"))' -(define (common:get-disks #!key (configf #f)) +(define (common:get-disks configf) (hash-table-ref/default - (or configf (configf:read-config "megatest.config" #f #t)) + configf ;; (or configf (configf:read-config "megatest.config" #f #t)) "disks" '("none" ""))) ;;====================================================================== ;; return first command that exists, else #f ;; @@ -1227,16 +1227,17 @@ ;;====================================================================== ;;====================================================================== ;; (map print (map car (hash-table->alist (configf:read-config "runconfigs.config" #f #t)))) ;; -(define (common:get-runconfig-targets #!key (configf #f)) - (let ((targs (sort (map car (hash-table->alist - (or configf ;; NOTE: There is no value in using runconfig:read here. +(define (common:get-runconfig-targets configf) ;; #!key (configf #f)) + (let ((targs (sort (map car (hash-table->alist configf + #;(or configf ;; NOTE: There is no value in using runconfig:read here. (configf:read-config (conc *toppath* "/runconfigs.config") #f #t) - (make-hash-table)))) + (make-hash-table)) + )) string "launch:setup-body -- cond branch 2") - (let* ((first-pass (find-and-read-config ;; NB// sets MT_RUN_AREA_HOME as side effect + (let* ((bigmodenv (module-environment 'bigmod)) + (first-pass (configf:find-and-read-config ;; NB// sets MT_RUN_AREA_HOME as side effect mtconfig environ-patt: "env-override" given-toppath: toppath - pathenvvar: "MT_RUN_AREA_HOME")) + pathenvvar: "MT_RUN_AREA_HOME" + env-to-use: bigmodenv)) (first-rundat (let ((toppath (if toppath toppath (car first-pass)))) (configf:read-config ;; (conc toppath "/runconfigs.config") ;; this should be converted to runconfig:read but it is non-trivial, leaving it for now. (conc (if (string? toppath) toppath (get-environment-variable "MT_RUN_AREA_HOME")) "/runconfigs.config") *runconfigdat* #t - sections: sections)))) + sections: sections + env-to-use: bigmodenv)))) (set! *runconfigdat* first-rundat) (if first-pass ;; (begin ;;(BB> "launch:setup-body -- \"first-pass\"=first-pass") (set! *configdat* (car first-pass)) @@ -924,15 +930,16 @@ (key-vals (keys:target->keyval keys target)) (linktree (common:get-linktree)) ;; (or (getenv "MT_LINKTREE")(if *configdat* (configf:lookup *configdat* "setup" "linktree") #f))) ; (if *configdat* ; (configf:lookup *configdat* "setup" "linktree") ; (conc *toppath* "/lt")))) - (second-pass (find-and-read-config + (second-pass (configf:find-and-read-config mtconfig environ-patt: "env-override" given-toppath: toppath - pathenvvar: "MT_RUN_AREA_HOME")) + pathenvvar: "MT_RUN_AREA_HOME" + env-to-use: (module-environment 'bigmod))) (runconfigdat (begin ;; this read of the runconfigs will see any adjustments made by re-reading megatest.config (for-each (lambda (kt) (setenv (car kt) (cadr kt))) key-vals) (configf:read-config (conc toppath "/runconfigs.config") *runconfigdat* #t ;; consider using runconfig:read some day ... @@ -962,15 +969,16 @@ ;; else read what you can and set the flag accordingly ;; here we don't have either mtconfig or rccachef (else ;;(BB> "launch:setup-body -- cond branch 3 - else") - (let* ((cfgdat (find-and-read-config + (let* ((cfgdat (configf:find-and-read-config (or (args:get-arg "-config") "megatest.config") environ-patt: "env-override" given-toppath: (get-environment-variable "MT_RUN_AREA_HOME") - pathenvvar: "MT_RUN_AREA_HOME"))) + pathenvvar: "MT_RUN_AREA_HOME" + env-to-read: (module-environment 'bigmod)))) (if (and cfgdat (list? cfgdat) (> (length cfgdat) 0) (hash-table? (car cfgdat))) (let* ((toppath (or (get-environment-variable "MT_RUN_AREA_HOME")(cadr cfgdat))) (rdat (configf:read-config (conc toppath ;; convert this to use runconfig:read! "/runconfigs.config") *runconfigdat* #t sections: sections))) @@ -2245,11 +2253,12 @@ (if (and cfgf (common:file-exists? cfgf) (file-writable? cfgf) (common:use-cache?)) (configf:read-alist cfgf) - (let* ((keys (common:get-fields cfgf)) ;; (rmt:get-keys)) + (let* ((gotit (if cfgf #t (launch:setup))) ;; whatever + (keys (common:get-fields cfgf)) ;; (rmt:get-keys)) (target (common:args-get-target)) (key-vals (if target (keys:target->keyval keys target) #f)) (sections (if target (list "default" target) #f)) (data (begin (setenv "MT_RUN_AREA_HOME" *toppath*) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -25,14 +25,16 @@ (declare (uses adjutant)) (declare (uses archivemod)) (declare (uses apimod)) (declare (uses autoload)) +(declare (uses bigmod)) (declare (uses commonmod)) (declare (uses configfmod)) (declare (uses dbmod)) (declare (uses dbi)) +(declare (uses debugprint)) (declare (uses ducttape-lib)) (declare (uses ezstepsmod)) (declare (uses http-transportmod)) (declare (uses launchmod)) (declare (uses mtargs)) @@ -41,10 +43,20 @@ (declare (uses processmod)) (declare (uses rmtmod)) (declare (uses runsmod)) (declare (uses servermod)) (declare (uses testsmod)) + +;; needed for configf scripts, scheme etc. +(declare (uses apimod.import)) +(declare (uses debugprint.import)) +(declare (uses mtargs.import)) +(declare (uses commonmod.import)) +(declare (uses configfmod.import)) +(declare (uses bigmod.import)) +(declare (uses dbmod.import)) +(declare (uses rmtmod.import)) ;; (include "call-with-environment-variables/call-with-environment-variables.scm") (module megatest-main * @@ -51,10 +63,11 @@ (import scheme chicken.base chicken.bitwise chicken.condition + chicken.eval chicken.file chicken.file.posix chicken.format chicken.io chicken.irregex @@ -71,41 +84,41 @@ chicken.string chicken.tcp chicken.time chicken.time.posix - (prefix sqlite3 sqlite3:) (prefix base64 base64:) + (prefix sqlite3 sqlite3:) + (prefix sxml-modifications sxml-) address-info csv-abnf directory-utils fmt + http-client + intarweb json + linenoise matchable md5 message-digest queues regex regex-case - sql-de-lite - stack - typed-records s11n sparse-vectors - sxml-serializer + spiffy + spiffy-directory-listing + spiffy-request-vars + sql-de-lite + stack sxml-modifications - (prefix sxml-modifications sxml-) + sxml-serializer sxml-transforms system-information - z3 - spiffy + typed-records uri-common - intarweb - http-client - spiffy-request-vars - intarweb - spiffy-directory-listing + z3 srfi-1 srfi-4 srfi-18 srfi-13 @@ -126,12 +139,13 @@ (prefix mtargs args:) pkts stml2 (prefix dbi dbi:) - ;; apimod + apimod archivemod + bigmod commonmod configfmod dbmod debugprint ezstepsmod @@ -139,11 +153,11 @@ launchmod processmod rmtmod runsmod servermod - ;; tasksmod + tasksmod testsmod ) ;; fake out readline usage of toplevel-command @@ -2444,11 +2458,31 @@ (begin (set! *db* dbstruct) ;; (import extras) ;; might not be needed ;; (import csi) ;; (import readline) - (import apropos) + (import apropos + archivemod + commonmod + configfmod + dbmod + debugprint + ezstepsmod + http-transportmod + launchmod + processmod + rmtmod + runsmod + servermod + tasksmod + testsmod) + + (set-history-length! 300) + + (load-history-from-file ".megatest_history") + + (current-input-port (make-linenoise-port)) ;; (import (prefix sqlite3 sqlite3:)) ;; doesn't work ... ;; (if *use-new-readline* ;; (begin ;; (install-history-file (get-environment-variable "HOME") ".megatest_history") ;; [homedir] [filename] [nlines]) Index: runsmod.scm ================================================================== --- runsmod.scm +++ runsmod.scm @@ -44,10 +44,11 @@ (import scheme (prefix sqlite3 sqlite3:) chicken.base chicken.condition + chicken.eval chicken.file chicken.file.posix chicken.format chicken.io chicken.pathname @@ -2531,11 +2532,11 @@ (set! keys (keys:config-get-fields *configdat*)) ;; have enough to process -target or -reqtarg here (if (args:get-arg "-reqtarg") (let* ((runconfigf (conc *toppath* "/runconfigs.config")) ;; DO NOT EVALUATE ALL - (runconfig (configf:read-config runconfigf #f #t environ-patt: #f))) + (runconfig (configf:read-config runconfigf #f #t environ-patt: #f env-to-use: (module-environment 'bigmod)))) (if (hash-table-ref/default runconfig (args:get-arg "-reqtarg") #f) (keys:target-set-args keys (args:get-arg "-reqtarg") args:arg-hash) (begin (debug:print-error 0 *default-log-port* "[" (args:get-arg "-reqtarg") "] not found in " runconfigf) Index: testsmod.scm ================================================================== --- testsmod.scm +++ testsmod.scm @@ -38,10 +38,11 @@ chicken.base chicken.condition chicken.file chicken.io chicken.pathname + chicken.eval chicken.file.posix chicken.process-context.posix chicken.format chicken.port chicken.pretty-print @@ -1078,11 +1079,12 @@ #f)))) (tcfg (if testexists (configf:read-config test-configf #f system-allowed environ-patt: (if system-allowed "pre-launch-env-vars" - #f)) + #f) + env-to-use: (module-environment 'bigmod)) #f))) (if (and tcfg cache-file) (hash-table-set! tcfg "have fulldata" #t)) ;; mark this as fully read data (if tcfg (hash-table-set! *testconfigs* test-full-name tcfg)) (if (and testexists cache-file