Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -11,21 +11,22 @@ OFILES = $(SRCFILES:%.scm=%.o) GOFILES = $(GUISRCF:%.scm=%.o) HELPERS=$(addprefix $(PREFIX)/bin/,mt_laststep mt_runstep) -all : megatest dashboard +all : megatest dboard megatest: $(OFILES) megatest.o csc $(OFILES) megatest.o -o megatest -dashboard: $(OFILES) $(GOFILES) - csc $(OFILES) $(GOFILES) -o dashboard +dboard : $(OFILES) $(GOFILES) + csc $(OFILES) $(GOFILES) -o dboard -db.o launch.o runs.o : db_records.scm - -keys.o db.o runs.o launch.o : key_records.scm +# Special dependencies for the includes +db.o launch.o runs.o dashboard-tests.o dashboard.o megatest.o : db_records.scm +runs.o dashboard.o dashboard-tests.o : run_records.scm +keys.o db.o runs.o launch.o megatest.o : key_records.scm $(OFILES) $(GOFILES) : common_records.scm %.o : %.scm csc -c $< @@ -38,17 +39,22 @@ $(HELPERS) : utils/mt_* cp $< $@ chmod a+x $@ # install dashboard as dboard so wrapper script can be called dashboard -$(PREFIX)/bin/dboard : dashboard $(FILES) +$(PREFIX)/bin/dboard : dboard $(FILES) cp dboard $(PREFIX)/bin/dboard utils/mk_dashboard_wrapper $(PREFIX) > $(PREFIX)/bin/dashboard chmod a+x $(PREFIX)/bin/dashboard utils/mk_dashboard_wrapper $(PREFIX) > $(PREFIX)/bin/dashboard chmod a+x $(PREFIX)/bin/dashboard -install : $(PREFIX)/bin/megatest $(PREFIX)/bin/dboard $(PREFIX)/bin/dashboard $(HELPERS) +install : bin $(PREFIX)/bin/megatest $(PREFIX)/bin/dboard $(PREFIX)/bin/dashboard $(HELPERS) + +bin : + mkdir $(PREFIX)/bin test: tests/tests.scm cd tests;csi -I .. -b -n tests.scm +clean : + rm -f $(OFILES) $(GOFILES) megatest dboard dboard.o megatest.o Index: dashboard-tests.scm ================================================================== --- dashboard-tests.scm +++ dashboard-tests.scm @@ -11,16 +11,26 @@ ;;====================================================================== ;; Test info panel ;;====================================================================== +(use format) +(require-library iup) +(import (prefix iup iup:)) + +(use canvas-draw) + +(use sqlite3 srfi-1 posix regex regex-case srfi-69) +(import (prefix sqlite3 sqlite3:)) + (declare (unit dashboard-tests)) (declare (uses common)) (declare (uses db)) -(declare (uses dboard)) (include "common_records.scm") +(include "db_records.scm") +(include "run_records.scm") (define (test-info-panel testdat store-label widgets) (iup:frame #:title "Test Info" ; #:expand "YES" (iup:hbox ; #:expand "YES" Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -25,15 +25,16 @@ (declare (uses db)) (declare (uses configf)) (declare (uses process)) (declare (uses launch)) (declare (uses runs)) -(declare (uses dboard)) (declare (uses dashboard-tests)) (declare (uses megatest-version)) (include "common_records.scm") +(include "db_records.scm") +(include "run_records.scm") (define help (conc "Megatest Dashboard, documentation at http://www.kiatoa.com/fossils/megatest version " megatest-version " license GPL, Copyright (C) Matt Welland 2011 Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -11,11 +11,11 @@ ;;====================================================================== ;; Database access ;;====================================================================== -(use sqlite3 srfi-1 posix regex regex-case srfi-69) +(use sqlite3 srfi-1 posix regex regex-case srfi-69 csv-xml) (import (prefix sqlite3 sqlite3:)) (declare (unit db)) (declare (uses common)) (declare (uses keys)) Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -11,12 +11,13 @@ ;;====================================================================== ;; launch a task - this runs on the originating host, tests themselves ;; ;;====================================================================== -(use regex regex-case base64) +(use regex regex-case base64 sqlite3) (import (prefix base64 base64:)) +(import (prefix sqlite3 sqlite3:)) (declare (unit launch)) (declare (uses common)) (declare (uses configf)) (declare (uses db)) @@ -160,10 +161,11 @@ (if (args:get-arg "-xterm")(set! fullcmd (append fullcmd (list "-xterm")))) (debug:print 1 "Launching megatest for test " test-name " in " work-area" ...") (test-set-status! db run-id test-name "LAUNCHED" "n/a" itemdat #f #f) ;; (if launch-results launch-results "FAILED")) ;; set ;; set pre-launch-env-vars before launching, keep the vars in prevvals and put the envionment back when done + (debug:print 4 "fullcmd: " fullcmd) (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" Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -8,17 +8,23 @@ ;; PURPOSE. ;; (include "common.scm") ;; (include "megatest-version.scm") +(use sqlite3 srfi-1 posix regex regex-case srfi-69 base64) +(import (prefix sqlite3 sqlite3:)) +(import (prefix base64 base64:)) + (declare (uses common)) (declare (uses megatest-version)) (declare (uses margs)) (declare (uses runs)) (declare (uses launch)) (include "common_records.scm") +(include "key_records.scm") +(include "db_records.scm") (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 @@ -8,11 +8,11 @@ ;; 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) +(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)) @@ -20,10 +20,11 @@ (declare (uses runconfig)) (include "common_records.scm") (include "key_records.scm") (include "db_records.scm") +(include "run_records.scm") ;; register a test run with the db (define (register-run db keys) ;; test-name) (let* ((keystr (keys->keystr keys)) (comma (if (> (length keys) 0) "," "")) @@ -384,28 +385,15 @@ ;; (set! res (vector id run-id test-name state status item-path))) ;; db "SELECT id,run_id,testname,state,status FROM tests WHERE run_id=? AND testname=? AND item_path=?;" ;; run-id test-name item-path) ;; res)) -(define-inline (test:get-id vec) (vector-ref vec 0)) -(define-inline (test:get-run_id vec) (vector-ref vec 1)) -(define-inline (test:get-test-name vec)(vector-ref vec 2)) -(define-inline (test:get-state vec) (vector-ref vec 3)) -(define-inline (test:get-status vec) (vector-ref vec 4)) -(define-inline (test:get-item-path vec)(vector-ref vec 5)) - (define (runs:test-get-full-path test) (let* ((testname (db:test-get-testname test)) (itempath (db:test-get-item-path test))) (conc testname (if (equal? itempath "") "" (conc "(" itempath ")"))))) -(define-inline (test:test-get-fullname test) - (conc (db:test-get-testname test) - (if (equal? (db:test-get-item-path test) "") - "" - (conc "(" (db:test-get-item-path test) ")")))) - (define (check-valid-items class item) (let ((valid-values (let ((s (config-lookup *configdat* "validvalues" class))) (if s (string-split s) #f)))) (if valid-values (if (member item valid-values) Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -10,12 +10,12 @@ csi -b -I .. ../megatest.scm -- -runall :sysname ubuntu :fsname afs :datapath tmp :runname blah cd ../;make test make runall dashboard : - cd ../;make dashboard - ../dashboard & + cd ../;make dboard + ../dboard & remove : (cd ../;make);../megatest -remove-runs :runname $(RUN) -testpatt % -itempatt % :sysname % :fsname % :datapath % runforever : Index: utils/mk_dashboard_wrapper ================================================================== --- utils/mk_dashboard_wrapper +++ utils/mk_dashboard_wrapper @@ -1,10 +1,10 @@ #!/bin/bash prefix=$1 echo "#!/bin/bash" -if [ $LD_LIBRARY_PATH != "" ];then +if [ "$LD_LIBRARY_PATH" != "" ];then echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" fi dboard=`realpath $prefix/bin/dboard`