Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -20,11 +20,11 @@ SHELL=/bin/bash PREFIX=$(PWD) CSCOPTS= INSTALL=install SRCFILES = common.scm items.scm launch.scm runconfig.scm \ - server.scm configf.scm db.scm keys.scm margs.scm \ + server.scm configf.scm db.scm margs.scm \ process.scm runs.scm tasks.scm tests.scm genexample.scm \ http-transport.scm filedb.scm tdb.scm client.scm mt.scm \ ezsteps.scm lock-queue.scm sdb.scm rmt.scm api.scm \ subrun.scm portlogger.scm archive.scm env.scm \ diff-report.scm cgisetup/models/pgdb.scm @@ -111,11 +111,10 @@ configf.o \ db.o \ env.o \ http-transport.o \ items.o \ - keys.o \ launch.o \ lock-queue.o \ margs.o \ mt.o \ portlogger.o \ @@ -183,11 +182,11 @@ # dashboard.o : mofiles/apimod.o tests.o runs.o dashboard.o dashboard-tests.o dashboard-context-menu.o dashboard-main.o : run_records.scm -db.o ezsteps.o keys.o launch.o megatest.o monitor.o runs-for-ref.o runs.o tests.o : key_records.scm +db.o ezsteps.o launch.o megatest.o monitor.o runs-for-ref.o runs.o tests.o : key_records.scm tests.o tasks.o dashboard-tasks.o : task_records.scm runs.o : test_records.scm # api.o rmt.o db.o : mofiles/apimod.o mofiles/dbmod.o mofiles/rmtmod.o mofiles/ods.o @@ -205,12 +204,12 @@ dcommon.o : run_records.scm # mofiles/dcommonmod.o mofiles/stml2.o : mofiles/cookie.o -mofiles/dbmod.o : mofiles/ods.o -mofiles/rmtmod.o : mofiles/dbmod.o +# mofiles/dbmod.o : mofiles/ods.o +# mofiles/rmtmod.o : mofiles/dbmod.o # # special include based modules # mofiles/pkts.o : pkts/pkts.scm # mofiles/stml2.o : cookie.o # # mofiles/mtargs.o : mtargs/mtargs.scm @@ -480,12 +479,12 @@ fi if csi -ne '(use postgresql)';then \ echo "(use postgresql)(hash-table-set! *available-db* 'postgresql #t)" >> altdb.scm;\ fi -portlogger-example : portlogger-example.scm api.o archive.o client.o common.o configf.o dashboard-tests.o dashboard-context-menu.o db.o dcommon.o ezsteps.o filedb.o genexample.o gutils.o http-transport.o items.o keys.o launch.o lock-queue.o margs.o mt.o portlogger.o process.o rmt.o runconfig.o runs.o sdb.o server.o synchash.o tasks.o tdb.o tests.o tree.o - csc $(CSCOPTS) portlogger-example.scm api.o archive.o client.o common.o configf.o dashboard-tests.o dashboard-context-menu.o db.o dcommon.o ezsteps.o filedb.o genexample.o gutils.o http-transport.o items.o keys.o launch.o lock-queue.o margs.o mt.o portlogger.o process.o rmt.o runconfig.o runs.o sdb.o server.o synchash.o tasks.o tdb.o tests.o tree.o +portlogger-example : portlogger-example.scm api.o archive.o client.o common.o configf.o dashboard-tests.o dashboard-context-menu.o db.o dcommon.o ezsteps.o filedb.o genexample.o gutils.o http-transport.o items.o launch.o lock-queue.o margs.o mt.o portlogger.o process.o rmt.o runconfig.o runs.o sdb.o server.o synchash.o tasks.o tdb.o tests.o tree.o + csc $(CSCOPTS) portlogger-example.scm api.o archive.o client.o common.o configf.o dashboard-tests.o dashboard-context-menu.o db.o dcommon.o ezsteps.o filedb.o genexample.o gutils.o http-transport.o items.o launch.o lock-queue.o margs.o mt.o portlogger.o process.o rmt.o runconfig.o runs.o sdb.o server.o synchash.o tasks.o tdb.o tests.o tree.o # create a pdf dot graphviz diagram from notations in rmt.scm rmt.pdf : rmt.scm grep ';;DOT' rmt.scm | sed -e 's/.*;;DOT //' > rmt.dot;dot -Tpdf rmt.dot -o rmt.pdf Index: build.inc ================================================================== --- build.inc +++ build.inc @@ -25,11 +25,10 @@ common.o : mofiles/dbmod.o common.o : mofiles/configfmod.o common.o : mofiles/servermod.o configf.o : process.o configf.o : env.o -configf.o : keys.o configf.o : mofiles/commonmod.o configf.o : mofiles/configfmod.o mofiles/configfmod.o : mofiles/commonmod.o dashboard-context-menu.o : common.o dashboard-context-menu.o : db.o @@ -39,11 +38,10 @@ dashboard-context-menu.o : subrun.o dashboard-context-menu.o : mofiles/commonmod.o dashboard-context-menu.o : mofiles/configfmod.o dashboard-context-menu.o : mofiles/dbmod.o dashboard-guimonitor.o : common.o -dashboard-guimonitor.o : keys.o dashboard-guimonitor.o : db.o dashboard-guimonitor.o : tasks.o dashboard-guimonitor.o : mofiles/commonmod.o dashboard-guimonitor.o : mofiles/dbmod.o dashboard-tests.o : common.o @@ -55,11 +53,10 @@ dashboard-tests.o : mofiles/commonmod.o dashboard-tests.o : mofiles/configfmod.o dashboard-tests.o : mofiles/dbmod.o dashboard.o : common.o dashboard.o : margs.o -dashboard.o : keys.o dashboard.o : items.o dashboard.o : db.o dashboard.o : configf.o dashboard.o : process.o dashboard.o : launch.o @@ -80,11 +77,10 @@ # dashboard.o : dcommonmod.import.o dashboard.o : mofiles/apimod.o dashboard.o : mofiles/dbmod.o dashboard.o : mofiles/servermod.o db.o : common.o -db.o : keys.o db.o : client.o db.o : mt.o db.o : mofiles/commonmod.o db.o : mofiles/configfmod.o db.o : mofiles/dbmod.o @@ -110,15 +106,10 @@ ezsteps.o : items.o ezsteps.o : runconfig.o ezsteps.o : mofiles/commonmod.o ezsteps.o : mofiles/configfmod.o ezsteps.o : mofiles/dbmod.o -fs-transport.o : common.o -fs-transport.o : db.o -fs-transport.o : tests.o -fs-transport.o : mofiles/commonmod.o -fs-transport.o : mofiles/dbmod.o genexample.o : mofiles/commonmod.o http-transport.o : common.o http-transport.o : db.o http-transport.o : tests.o http-transport.o : server.o @@ -135,12 +126,10 @@ index-tree.o : runconfig.o index-tree.o : mofiles/commonmod.o items.o : common.o items.o : mofiles/commonmod.o items.o : mofiles/configfmod.o -keys.o : common.o -keys.o : mofiles/commonmod.o launch.o : subrun.o launch.o : common.o launch.o : configf.o launch.o : db.o launch.o : ezsteps.o @@ -275,11 +264,10 @@ tcmt.o : margs.o tcmt.o : rmt.o tcmt.o : common.o tcmt.o : mofiles/commonmod.o tdb.o : common.o -tdb.o : keys.o tdb.o : client.o tdb.o : mt.o tdb.o : db.o tdb.o : mofiles/commonmod.o tdb.o : mofiles/dbmod.o Index: commonmod.scm ================================================================== --- commonmod.scm +++ commonmod.scm @@ -1579,10 +1579,12 @@ (or ovrd '())))) (define (common:get-fields cfgdat) (let ((fields (hash-table-ref/default cfgdat "fields" '()))) (map car fields))) + +(define keys:config-get-fields common:get-fields) ;;====================================================================== ;; looking only (at least for now) at the MT_ variables craft the full testname ;; (define (common:get-full-test-name) Index: configf.scm ================================================================== --- configf.scm +++ configf.scm @@ -24,11 +24,10 @@ (use regex regex-case matchable) ;; directory-utils) (declare (unit configf)) (declare (uses process)) (declare (uses env)) -(declare (uses keys)) (declare (uses commonmod)) (import commonmod) (declare (uses configfmod)) Index: dashboard-guimonitor.scm ================================================================== --- dashboard-guimonitor.scm +++ dashboard-guimonitor.scm @@ -31,11 +31,10 @@ (use sqlite3 srfi-1 posix regex regex-case srfi-69) (import (prefix sqlite3 sqlite3:)) (declare (unit dashboard-guimonitor)) (declare (uses common)) -(declare (uses keys)) (declare (uses db)) (declare (uses tasks)) (declare (uses commonmod)) (import commonmod) Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -31,11 +31,10 @@ (import (prefix sqlite3 sqlite3:)) (declare (uses common)) (declare (uses margs)) -(declare (uses keys)) (declare (uses items)) (declare (uses db)) (declare (uses configf)) (declare (uses process)) (declare (uses launch)) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -30,12 +30,10 @@ (import (prefix sqlite3 sqlite3:)) (import (prefix base64 base64:)) (declare (unit db)) (declare (uses common)) -(declare (uses keys)) -;; (declare (uses ods)) (declare (uses client)) (declare (uses mt)) (declare (uses commonmod)) (import commonmod) Index: db_records.scm ================================================================== --- db_records.scm +++ db_records.scm @@ -201,50 +201,10 @@ (define-inline (db:test-data-set-units! vec val)(vector-set! vec 7 val)) (define-inline (db:test-data-set-comment! vec val)(vector-set! vec 8 val)) (define-inline (db:test-data-set-status! vec val)(vector-set! vec 9 val)) (define-inline (db:test-data-set-type! vec val)(vector-set! vec 10 val)) -;;====================================================================== -;; S T E P S -;;====================================================================== -;; Run steps -;; make-vector-record "Run steps" db step id test_id stepname step_complete step_pass event_time -(define (make-db:step)(make-vector 9)) -(define-inline (tdb:step-get-id vec) (vector-ref vec 0)) -(define-inline (tdb:step-get-test_id vec) (vector-ref vec 1)) -(define-inline (tdb:step-get-stepname vec) (vector-ref vec 2)) -(define-inline (tdb:step-get-state vec) (vector-ref vec 3)) -(define-inline (tdb:step-get-status vec) (vector-ref vec 4)) -(define-inline (tdb:step-get-event_time vec) (vector-ref vec 5)) -(define-inline (tdb:step-get-logfile vec) (vector-ref vec 6)) -(define-inline (tdb:step-get-comment vec) (vector-ref vec 7)) -(define-inline (tdb:step-get-last_update vec) (vector-ref vec 8)) -(define-inline (tdb:step-set-id! vec val)(vector-set! vec 0 val)) -(define-inline (tdb:step-set-test_id! vec val)(vector-set! vec 1 val)) -(define-inline (tdb:step-set-stepname! vec val)(vector-set! vec 2 val)) -(define-inline (tdb:step-set-state! vec val)(vector-set! vec 3 val)) -(define-inline (tdb:step-set-status! vec val)(vector-set! vec 4 val)) -(define-inline (tdb:step-set-event_time! vec val)(vector-set! vec 5 val)) -(define-inline (tdb:step-set-logfile! vec val)(vector-set! vec 6 val)) -(define-inline (tdb:step-set-comment! vec val)(vector-set! vec 7 val)) - - -;; The steps table -(define (make-db:steps-table)(make-vector 5)) -(define-inline (tdb:steps-table-get-stepname vec) (vector-ref vec 0)) -(define-inline (tdb:steps-table-get-start vec) (vector-ref vec 1)) -(define-inline (tdb:steps-table-get-end vec) (vector-ref vec 2)) -(define-inline (tdb:steps-table-get-status vec) (vector-ref vec 3)) -(define-inline (tdb:steps-table-get-runtime vec) (vector-ref vec 4)) -(define-inline (tdb:steps-table-get-log-file vec) (vector-ref vec 5)) - -(define-inline (tdb:step-stable-set-stepname! vec val)(vector-set! vec 0 val)) -(define-inline (tdb:step-stable-set-start! vec val)(vector-set! vec 1 val)) -(define-inline (tdb:step-stable-set-end! vec val)(vector-set! vec 2 val)) -(define-inline (tdb:step-stable-set-status! vec val)(vector-set! vec 3 val)) -(define-inline (tdb:step-stable-set-runtime! vec val)(vector-set! vec 4 val)) - ;; The data structure for handing off requests via wire (define (make-cdb:packet)(make-vector 6)) (define-inline (cdb:packet-get-client-sig vec) (vector-ref vec 0)) (define-inline (cdb:packet-get-qtype vec) (vector-ref vec 1)) (define-inline (cdb:packet-get-immediate vec) (vector-ref vec 2)) DELETED keys.scm Index: keys.scm ================================================================== --- keys.scm +++ /dev/null @@ -1,40 +0,0 @@ - -;; Copyright 2006-2012, 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 . -;; - -;;====================================================================== -;; Run keys, these are used to hierarchially organise tests and run areas -;;====================================================================== - -(use sqlite3 srfi-1 posix regex regex-case srfi-69) -(import (prefix sqlite3 sqlite3:)) - -(declare (unit keys)) -(declare (uses common)) - -(declare (uses commonmod)) -(import commonmod) - -(include "key_records.scm") -(include "common_records.scm") - -;;====================================================================== -;; config file related routines -;;====================================================================== - -(define keys:config-get-fields common:get-fields) Index: ods.scm ================================================================== --- ods.scm +++ ods.scm @@ -17,11 +17,10 @@ ;; (use csv-xml regex) (declare (unit ods)) (declare (uses commonmod)) -;; (declare (uses common)) (module ods * (import scheme chicken data-structures extras files ports) Index: tdb.scm ================================================================== --- tdb.scm +++ tdb.scm @@ -27,11 +27,10 @@ (import (prefix sqlite3 sqlite3:)) (import (prefix base64 base64:)) (declare (unit tdb)) (declare (uses common)) -(declare (uses keys)) (declare (uses client)) (declare (uses mt)) (declare (uses db)) (declare (uses commonmod)) @@ -51,10 +50,51 @@ ;;====================================================================== ;; ;; T E S T D A T A B A S E S ;; ;;====================================================================== +;;====================================================================== +;; S T E P S +;;====================================================================== + +;; Run steps +;; make-vector-record "Run steps" db step id test_id stepname step_complete step_pass event_time +(define (make-db:step)(make-vector 9)) +(define (tdb:step-get-id vec) (vector-ref vec 0)) +(define (tdb:step-get-test_id vec) (vector-ref vec 1)) +(define (tdb:step-get-stepname vec) (vector-ref vec 2)) +(define (tdb:step-get-state vec) (vector-ref vec 3)) +(define (tdb:step-get-status vec) (vector-ref vec 4)) +(define (tdb:step-get-event_time vec) (vector-ref vec 5)) +(define (tdb:step-get-logfile vec) (vector-ref vec 6)) +(define (tdb:step-get-comment vec) (vector-ref vec 7)) +(define (tdb:step-get-last_update vec) (vector-ref vec 8)) +(define (tdb:step-set-id! vec val)(vector-set! vec 0 val)) +(define (tdb:step-set-test_id! vec val)(vector-set! vec 1 val)) +(define (tdb:step-set-stepname! vec val)(vector-set! vec 2 val)) +(define (tdb:step-set-state! vec val)(vector-set! vec 3 val)) +(define (tdb:step-set-status! vec val)(vector-set! vec 4 val)) +(define (tdb:step-set-event_time! vec val)(vector-set! vec 5 val)) +(define (tdb:step-set-logfile! vec val)(vector-set! vec 6 val)) +(define (tdb:step-set-comment! vec val)(vector-set! vec 7 val)) + + +;; The steps table +(define (make-db:steps-table)(make-vector 5)) +(define (tdb:steps-table-get-stepname vec) (vector-ref vec 0)) +(define (tdb:steps-table-get-start vec) (vector-ref vec 1)) +(define (tdb:steps-table-get-end vec) (vector-ref vec 2)) +(define (tdb:steps-table-get-status vec) (vector-ref vec 3)) +(define (tdb:steps-table-get-runtime vec) (vector-ref vec 4)) +(define (tdb:steps-table-get-log-file vec) (vector-ref vec 5)) + +(define (tdb:step-stable-set-stepname! vec val)(vector-set! vec 0 val)) +(define (tdb:step-stable-set-start! vec val)(vector-set! vec 1 val)) +(define (tdb:step-stable-set-end! vec val)(vector-set! vec 2 val)) +(define (tdb:step-stable-set-status! vec val)(vector-set! vec 3 val)) +(define (tdb:step-stable-set-runtime! vec val)(vector-set! vec 4 val)) + ;;====================================================================== ;; T E S T S P E C I F I C D B ;;======================================================================