Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -32,18 +32,20 @@ server.scm configf.scm db.scm keys.scm \ process.scm runs.scm tasks.scm tests.scm genexample.scm \ tdb.scm mt.scm \ ezsteps.scm rmt.scm api.scm \ subrun.scm archive.scm env.scm \ - diff-report.scm cgisetup/models/pgdb.scm + diff-report.scm + +# cgisetup/models/pgdb.scm # module source files MSRCFILES = dbfile.scm debugprint.scm mtargs.scm commonmod.scm dbmod.scm \ tcp-transportmod.scm rmtmod.scm portlogger.scm apimod.scm \ configfmod.scm processmod.scm servermod.scm megatestmod.scm \ stml2.scm fsmod.scm cpumod.scm mtmod.scm odsmod.scm tasksmod.scm \ - pkts.scm testsmod.scm + pkts.scm testsmod.scm pgdb.scm transport-mode.scm : transport-mode.scm.template cp transport-mode.scm.template transport-mode.scm dashboard-transport-mode.scm : dashboard-transport-mode.scm.template @@ -74,11 +76,11 @@ mofiles/dbfile.o : mofiles/debugprint.o mofiles/rmtmod.o mofiles/dbmod.o : mofiles/dbfile.o mofiles/commonmod.o mofiles/debugprint.o db.o : mofiles/dbmod.o mofiles/dbfile.o mofiles/debugprint.o : mofiles/mtargs.o mofiles/tcp-transportmod.o : mofiles/portlogger.o -mofiles/tasksmod.o : mofiles/rmtmod.o +mofiles/tasksmod.o : mofiles/rmtmod.o mofiles/pgdb.o # ftail.scm rmtmod.scm commonmod.scm removed # MSRCFILES = ducttape-lib.scm pkts.scm stml2.scm cookie.scm mutils.scm \ # mtargs.scm commonmod.scm dbmod.scm adjutant.scm ulex.scm \ # rmtmod.scm apimod.scm Index: cgisetup/models/pgdb.scm ================================================================== --- cgisetup/models/pgdb.scm +++ cgisetup/models/pgdb.scm @@ -17,26 +17,32 @@ ;; along with Megatest. If not, see . ;;====================================================================== (declare (unit pgdb)) -(declare (uses configf)) +(declare (uses configfmod)) (declare (uses mtargs)) +(declare (uses debugprint)) ;; I don't know how to mix compilation units and modules, so no module here. ;; -;; (module pgdb -;; ( -;; open-pgdb -;; ) -;; -;; (import scheme) -;; (import data-structures) -;; (import chicken) - -(use typed-records (prefix dbi dbi:)) -(import (prefix mtargs args:)) +(module pgdb + * + +(import scheme) +(import data-structures) +(import chicken) + +(use typed-records + (prefix dbi dbi:) + srfi-69 + srfi-1 + ) +(import (prefix mtargs args:) + debugprint + configfmod + ) ;; given a configdat lookup the connection info and open the db ;; (define (pgdb:open configdat #!key (dbname #f)(dbispec #f)) (let ((pgconf (or dbispec @@ -654,5 +660,6 @@ ((> i tab2-pages ) lst) (else (loop (+ i 1) (append lst (list i))))))) +) Index: megatestmod.scm ================================================================== --- megatestmod.scm +++ megatestmod.scm @@ -33,11 +33,10 @@ (declare (uses configfmod)) (declare (uses processmod)) (declare (uses mtmod)) (declare (uses pkts)) (declare (uses servermod)) -(declare (uses dbi)) (use srfi-69) (module megatestmod * Index: odsmod.scm ================================================================== --- odsmod.scm +++ odsmod.scm @@ -15,18 +15,37 @@ ;; You should have received a copy of the GNU General Public License ;; along with Megatest. If not, see . ;; (use csv-xml regex) -(declare (unit ods)) +(declare (unit odsmod)) (declare (uses common)) (declare (uses commonmod)) -(import commonmod) +(declare (uses debugprint)) +(declare (uses dbfile)) +(declare (uses dbmod)) (module odsmod * +(import scheme + chicken + data-structures + extras + posix + ports + regex + srfi-1 + srfi-13 + (prefix sqlite3 sqlite3:) + + commonmod + debugprint + dbfile + dbmod + ) + (define ods:dirs '("Configurations2" "Configurations2/toolpanel" "Configurations2/menubar" "Configurations2/toolbar" ADDED pgdb.scm Index: pgdb.scm ================================================================== --- /dev/null +++ pgdb.scm @@ -0,0 +1,23 @@ +;;====================================================================== +;; Copyright 2019, Matthew Welland. +;; +;; This file is part of Megatest. +;; +;; Megatest is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; Megatest is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Megatest. If not, see . + +;;====================================================================== + +(declare (unit pgdb)) + +(include "cgisetup/models/pgdb.scm") Index: tasksmod.scm ================================================================== --- tasksmod.scm +++ tasksmod.scm @@ -30,10 +30,15 @@ (declare (uses commonmod)) (declare (uses configfmod)) (declare (uses dbfile)) (declare (uses dbmod)) (declare (uses rmtmod)) +(declare (uses servermod)) +(declare (uses processmod)) +(declare (uses pgdb)) +(declare (uses mtmod)) +(declare (uses megatestmod)) (use srfi-69) (module tasksmod * @@ -57,15 +62,10 @@ ) (use srfi-69)) (chicken-5 (import (prefix sqlite3 sqlite3:) - ;; data-structures - ;; extras - ;; files - ;; posix - ;; posix-extras chicken.base chicken.condition chicken.file chicken.file.posix chicken.io @@ -98,18 +98,24 @@ (prefix base64 base64:) (prefix sqlite3 sqlite3:) md5 message-digest z3 + directory-utils debugprint commonmod configfmod (prefix mtargs args:) dbmod dbfile rmtmod + servermod + processmod + pgdb + mtmod + megatestmod ) (include "task_records.scm") (include "db_records.scm") @@ -1416,10 +1422,27 @@ (loop (car tal)(cdr tal))) #f)))))) (pop-directory) result))))) + +(define (tests:get-test-path-from-environment) + (if (and (getenv "MT_LINKTREE") + (getenv "MT_TARGET") + (getenv "MT_RUNNAME") + (getenv "MT_TEST_NAME") + (getenv "MT_ITEMPATH")) + (conc (getenv "MT_LINKTREE") "/" + (getenv "MT_TARGET") "/" + (getenv "MT_RUNNAME") "/" + (getenv "MT_TEST_NAME") + (if (and (getenv "MT_ITEMPATH") + (not (string=? "" (getenv "MT_ITEMPATH")))) + (conc "/" (getenv "MT_ITEMPATH")) + "")) + #f)) + ;; if .testconfig exists in test directory read and return it ;; else if have cached copy in *testconfigs* return it IFF there is a section "have fulldata" ;; else read the testconfig file ;; if have path to test directory save the config as .testconfig and return it Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -1070,27 +1070,10 @@ ;; (filter (lambda (testname) ;; (tests:match test-patts testname #f)) ;; (map (lambda (testp) ;; (last (string-split testp "/"))) ;; tests))))) - -(define (tests:get-test-path-from-environment) - (if (and (getenv "MT_LINKTREE") - (getenv "MT_TARGET") - (getenv "MT_RUNNAME") - (getenv "MT_TEST_NAME") - (getenv "MT_ITEMPATH")) - (conc (getenv "MT_LINKTREE") "/" - (getenv "MT_TARGET") "/" - (getenv "MT_RUNNAME") "/" - (getenv "MT_TEST_NAME") - (if (and (getenv "MT_ITEMPATH") - (not (string=? "" (getenv "MT_ITEMPATH")))) - (conc "/" (getenv "MT_ITEMPATH")) - "")) - #f)) - ;; sort tests by priority and waiton ;; Move test specific stuff to a test unit FIXME one of these days (define (tests:sort-by-priority-and-waiton test-records) (if (eq? (hash-table-size test-records) 0) '()