Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -340,14 +340,14 @@ (args:get-arg "-runtests")))) (let* ((toppath (setup-for-run)) (db (if toppath (open-db) #f))) (debug:print 0 "INFO: Starting the standalone server") (if db - (let* ((host:port (db:get-var "SERVER")) ;; this doen't support multiple servers BUG!!!! + (let* ((host:port (db:get-var db "SERVER")) ;; this doen't support multiple servers BUG!!!! (th2 (server:start db (args:get-arg "-server"))) - (th3 (lambda () - (server:keep-going db)))) + (th3 (make-thread (lambda () + (server:keep-running db))))) (thread-start! th3) (thread-join! th3)) (debug:print 0 "ERROR: Failed to setup for megatest")))) ;;====================================================================== @@ -646,28 +646,29 @@ (params (if cmd (cdr remargs) '())) (exitstat #f) (shell (last (string-split (get-environment-variable "SHELL") "/"))) (redir (case (string->symbol shell) ((tcsh csh ksh) ">&") - ((zsh bash sh ash) "2>&1 >"))) + ((zsh bash sh ash) "2>&1 >") + (else ">&"))) (fullcmd (conc "(" (string-intersperse (cons cmd params) " ") ") " redir " " logfile))) ;; mark the start of the test (rdb:teststep-set-status! db test-id stepname "start" "n/a" itemdat (args:get-arg "-m") logfile) ;; close the db - (sqlite3:finalize! db) + ;; (sqlite3:finalize! db) ;; run the test step (debug:print 2 "INFO: Running \"" fullcmd "\"") (change-directory startingdir) (set! exitstat (system fullcmd)) ;; cmd params)) (set! *globalexitstatus* exitstat) (change-directory testpath) ;; re-open the db - (set! db (open-db)) - (if (not (args:get-arg "-server")) - (server:client-setup db)) + ;; (set! db (open-db)) + ;; (if (not (args:get-arg "-server")) + ;; (server:client-setup db)) ;; run logpro if applicable ;; (process-run "ls" (list "/foo" "2>&1" "blah.log")) (if logprofile (let* ((htmllogfile (conc stepname ".html")) (oldexitstat exitstat) (cmd (string-intersperse (list "logpro" logprofile htmllogfile "<" logfile ">" (conc stepname "_logpro.log")) " "))) @@ -675,14 +676,15 @@ (change-directory startingdir) (set! exitstat (system cmd)) (set! *globalexitstatus* exitstat) ;; no necessary (change-directory testpath) (rdb:test-set-log! db test-id htmllogfile))) - (rdb:teststep-set-status! db test-id stepname "end" exitstat itemdat (args:get-arg "-m") logfile) - (sqlite3:finalize! db) - (if (not (eq? exitstat 0)) - (exit 254)) ;; (exit exitstat) doesn't work?!? + (let ((msg (args:get-arg "-m"))) + (rdb:teststep-set-status! db test-id stepname "end" exitstat itemdat msg logfile)) + ;; (sqlite3:finalize! db) + ;;(if (not (eq? exitstat 0)) + ;; (exit 254)) ;; (exit exitstat) doesn't work?!? ;; open the db ;; mark the end of the test ))) (if (or (args:get-arg "-test-status") (args:get-arg "-set-values")) Index: server.scm ================================================================== --- server.scm +++ server.scm @@ -103,11 +103,11 @@ (set! *last-db-access* (current-seconds)) (db:test-set-comment db run-id test-name item-path comment))) (rpc:publish-procedure! 'rdb:test-set-log! - (lambda (run-id test-name item-path logf) + (lambda (test-id logf) (set! *last-db-access* (current-seconds)) (db:test-set-log! db test-id logf))) (rpc:publish-procedure! 'rdb:get-test-data-by-id