Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -481,22 +481,10 @@ (set! db (open-db)) (if (args:get-arg "-setlog") (test-set-log! db run-id test-name itemdat (args:get-arg "-setlog"))) (if (args:get-arg "-set-toplog") (test-set-toplog! db run-id test-name (args:get-arg "-set-toplog"))) - (if (args:get-arg "-test-status") - (let ((newstatus (cond - ((number? status) (if (equal? status 0) "PASS" "FAIL")) - ((string->number status)(if (equal? (string->number status) 0) "PASS" "FAIL")) - (else status)))) - (test-set-status! db run-id test-name state newstatus itemdat (args:get-arg "-m"))) - (if (and state status) - (if (not (args:get-arg "-setlog")) - (begin - (print "ERROR: You must specify :state and :status with every call to -test-status\n" help) - (sqlite3:finalize! db) - (exit 6))))) (if (args:get-arg "-runstep") (if (null? remargs) (begin (print "ERROR: nothing specified to run!") (sqlite3:finalize! db) @@ -542,10 +530,22 @@ (if (not (eq? exitstat 0)) (exit 254)) ;; (exit exitstat) doesn't work?!? ;; open the db ;; mark the end of the test ))) + (if (args:get-arg "-test-status") + (let ((newstatus (cond + ((number? status) (if (equal? status 0) "PASS" "FAIL")) + ((string->number status)(if (equal? (string->number status) 0) "PASS" "FAIL")) + (else status)))) + (test-set-status! db run-id test-name state newstatus itemdat (args:get-arg "-m"))) + (if (and state status) + (if (not (args:get-arg "-setlog")) + (begin + (print "ERROR: You must specify :state and :status with every call to -test-status\n" help) + (sqlite3:finalize! db) + (exit 6))))) (sqlite3:finalize! db) (set! *didsomething* #t)))) (if (args:get-arg "-showkeys") (let ((db #f) ADDED utils/mtutils.csh Index: utils/mtutils.csh ================================================================== --- /dev/null +++ utils/mtutils.csh @@ -0,0 +1,13 @@ +alias mt_runstep 'set argv=(\!*); \ + set stepname = $1;shift; \ + megatest -runstep $stepname -logpro ${stepname}.logpro "$*" || exit $?' + +alias mt_laststep 'set argv=(\!*);set stepname = $1;shift; \ + megatest -runstep $stepname -logpro ${stepname}.logpro "$*" ; \ + set exitstatus = $? ; \ + if ( $exitstatus == 0) megatest -test-status :state COMPLETED :status PASS ; \ + if ( $exitstatus != 0) megatest -test-status :state COMPLETED :status FAIL ; \ + if ( $exitstatus != 0) exit $exitstatus' + + +