Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -26,10 +26,11 @@ (define *configinfo* #f) (define *configdat* #f) (define *toppath* #f) (define *already-seen-runconfig-info* #f) (define *waiting-queue* (make-hash-table)) +(define *globalexitstatus* 0) ;; attempt to work around possible thread issues (define-inline (get-with-default val default) (let ((val (args:get-arg val))) (if val val default))) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -497,28 +497,32 @@ (sqlite3:finalize! db) ;; run the test step (print "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)) ;; 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")) " "))) (print "INFO: running \"" cmd "\"") (change-directory startingdir) (set! exitstat (system cmd)) + (set! *globalexitstatus* exitstat) ;; no necessary (change-directory testpath) (test-set-log! db run-id test-name itemdat htmllogfile))) - (test-set-status! db run-id test-name "end" exitstat itemdat (args:get-arg "-m")) + (teststep-set-status! db run-id test-name stepname "end" exitstat itemdat (args:get-arg "-m")) (sqlite3:finalize! db) - (exit exitstat) - ;; open the db - ;; mark the end of the test - ))) + (if (not (eq? exitstat 0)) + (exit 254)) ;; (exit exitstat) doesn't work?!? + ;; open the db + ;; mark the end of the test + ))) (sqlite3:finalize! db) (set! *didsomething* #t)))) (if (args:get-arg "-showkeys") (let ((db #f) @@ -539,5 +543,8 @@ ;; (megatest-gui) (set! *didsomething* #t))) (if (not *didsomething*) (print help)) + +(if (not (eq? *globalexitstatus* 0)) + (exit *globalexitstatus*))