Index: configf.scm ================================================================== --- configf.scm +++ configf.scm @@ -91,12 +91,12 @@ (string-intersperse res " ")))))) (hash-table-set! res curr-section-name (config:assoc-safe-add alist key (if (eq? allow-system 'return-procs) - val - (val)))) + val-proc + (val-proc)))) (loop (read-line inp) curr-section-name #f #f)) (loop (read-line inp) curr-section-name #f #f))) (key-val-pr ( x key val ) (let* ((alist (hash-table-ref/default res curr-section-name '())) (envar (and environ-patt (string-match (regexp environ-patt) curr-section-name))) (realval (if envar Index: items.scm ================================================================== --- items.scm +++ items.scm @@ -127,17 +127,20 @@ item #f) item))) (define (items:get-items-from-config tconfig) (let* (;; db is always at *toppath*/db/megatest.db - (items (hash-table-ref/default test-conf "items" '())) - (itemstable (hash-table-ref/default test-conf "itemstable" '())) - (allitems (if (or (not (null? items))(not (null? itemstable))) - (append (item-assoc->item-list items) - (item-table->item-list itemstable)) - '(())))) - allitems)) + (items (hash-table-ref/default tconfig "items" '())) + (itemstable (hash-table-ref/default tconfig "itemstable" '()))) + (if (procedure? items) + (set! items (items))) + (if (procedure? itemstable) + (set! itemstable (itemstable))) + (if (or (not (null? items))(not (null? itemstable))) + (append (item-assoc->item-list items) + (item-table->item-list itemstable)) + '(())))) ;; (pp (item-assoc->item-list itemdat)) ADDED monitor.scm Index: monitor.scm ================================================================== --- /dev/null +++ monitor.scm @@ -0,0 +1,25 @@ +;; Copyright 2006-2011, Matthew Welland. +;; +;; This program is made available under the GNU GPL version 2.0 or +;; greater. See the accompanying file COPYING for details. +;; +;; This program is distributed WITHOUT ANY WARRANTY; without even the +;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. + +;; strftime('%m/%d/%Y %H:%M:%S','now','localtime') + +(use sqlite3 srfi-1 posix regex regex-case srfi-69 dot-locking) +(import (prefix sqlite3 sqlite3:)) + +(declare (unit runs)) +(declare (uses db)) +(declare (uses common)) +(declare (uses items)) +(declare (uses runconfig)) + +(include "common_records.scm") +(include "key_records.scm") +(include "db_records.scm") +(include "run_records.scm") + Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -199,12 +199,11 @@ (debug:print 0 "INFO: test names " test-names) ;; on the first pass or call to run-tests set FAILS to NOT_STARTED if ;; -keepgoing is specified - (if (and (eq? *passnum* 0) - keepgoing) + (if (eq? *passnum* 0) (begin ;; have to delete test records where NOT_STARTED since they can cause -keepgoing to ;; get stuck due to becoming inaccessible from a failed test. I.e. if test B depends ;; on test A but test B reached the point on being registered as NOT_STARTED and test ;; A failed for some reason then on re-run using -keepgoing the run can never complete. @@ -215,14 +214,14 @@ (if (not (null? test-names)) (let loop ((hed (car test-names)) (tal (cdr test-names))) ;; 'return-procs tells the config reader to prep running system but return a proc (let* ((config (test:get-testconfig hed 'return-procs)) (waitons (string-split (let ((w (config-lookup config "requirements" "waiton"))) - (if w w "")))) - (items (items:get-items-from-config config))) + (if w w ""))))) +;; (items (items:get-items-from-config config))) (if (not (hash-table-ref/default test-records hed #f)) - (hash-table-set! test-records hed (vector hed config waitons (config-lookup "requirements" "priority") #f))) + (hash-table-set! test-records hed (vector hed config waitons (config-lookup config "requirements" "priority") #f))) (for-each (lambda (waiton) (if (and waiton (not (member waiton test-names))) (begin (set! required-tests (cons waiton required-tests)) @@ -233,20 +232,20 @@ (loop (car remtests)(cdr remtests))))))) (if (not (null? required-tests)) (debug:print 1 "INFO: Adding " required-tests " to the run queue")) ;; NOTE: these are all parent tests, items are not expanded yet. - (runs:run-tests-queue test-records))) + (runs:run-tests-queue test-records keyvallist))) (define (runs:run-tests-queue test-records keyvallist) ;; At this point the list of parent tests is expanded ;; NB// Should expand items here and then insert into the run queue. (let ((sorted-testnames (tests:sort-by-priority-and-waiton test-records))) (let loop (; (numtimes 0) ;; shouldn't need this (hed (car sorted-test-names)) (tal (cdr sorted-test-names))) - (let* ((test-record (hash-table-ref test-records hed)) + (let* ((test-record (hash-table-ref test-records hed)) WHERE TO DO: (items:get-items-from-config config) (tconfig (tests:testqueue-get-testconfig test-record)) (waitons (tests:testqueue-get-waitons test-record)) (priority (tests:testqueue-get-priority test-record)) (itemdat (tests:testqueue-get-itemdat test-record)) (items (tests:testqueue-get-items test-record)) @@ -299,10 +298,11 @@ ;; if items is a proc then need to evaluate, get the list and loop - but only do that if ;; resources exist to kick off the job ((procedure? items) (if (runs:can-run-more-tests db test-record) (let ((items-list (items))) + (if (list? items-list) (begin (tests:testqueue-set-items test-record items-list) (loop hed tal)) (begin