Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -6,11 +6,11 @@ ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. (include "common.scm") -(define megatest-version 1.0.1) +(define megatest-version 1.01) (define help (conc " Megatest, documentation at http://www.kiatoa.com/fossils/opensrc version " megatest-version " license GPL, Copyright Matt Welland 2006-2011 @@ -17,24 +17,24 @@ Usage: megatest [options] -h : this help Process and test running - -runall : run all tests that are not state COMPLETED and status PASS + -runall : run all tests that are not state COMPLETED and status PASS, + CHECK or KILLED -runtests tst1,tst2 ... : run tests Run status updates (these require that you are in a test directory - and you have sourced the \"megatest.csh\" + and you have sourced the \"megatest.csh\" or \"megatest.sh\" file.) -step stepname -test-status : set the state and status of a test (use :state and :status) -setlog logfname : set the path/filename to the final log relative to the test directory. may be used with -test-status -m comment : insert a comment for this test -Run data: - +Run data :runname : required, name for this particular test run :state : required if updating step state; e.g. start, end, completed :status : required if updating step status; e.g. pass, fail, n/a Queries @@ -44,11 +44,10 @@ Misc -force : override some checks -xterm : start an xterm instead of launching the test Helpers - -runstep stepname ... : take leftover params as comand and execute as stepname log will be in stepname.log -logpro file : with -exec apply logpro file to stepname.log, creates stepname.html and sets log to same @@ -71,10 +70,11 @@ ":status" "-list-runs" "-setlog" "-runstep" "-logpro" + "-remove-run" ) (list "-h" "-force" "-xterm" "-showkeys" @@ -246,10 +246,40 @@ ;; put test parameters into convenient variables (let* ((test-names (string-split (args:get-arg "-runtests") ","))) (run-tests db test-names))) ;; run-waiting-tests db) (sqlite3:finalize! db) + (run-waiting-tests #f) + (set! *didsomething* #t)))) + +(if (args:get-arg "-runtests") + (runtests)) + +;;====================================================================== +;; Remove old run(s) +;;====================================================================== + +(define (remove-runs) + (if (not (args:get-arg ":runname")) + (begin + (print "ERROR: Missing required parameter for -remove-run, you must specify the run name with :runname runname") + (exit 2)) + (let ((db #f)) + (if (not (setup-for-run)) + (begin + (print "Failed to setup, exiting") + (exit 1))) + (set! db (open-db)) + (if (not (car *configinfo*)) + (begin + (print "ERROR: Attempted to remove a test but run area config file not found") + (exit 1)) + ;; put test parameters into convenient variables + (let* ((test-names (string-split (args:get-arg "-remove-tests") ","))) + (run-tests db test-names))) + ;; run-waiting-tests db) + (sqlite3:finalize! db) (run-waiting-tests #f) (set! *didsomething* #t)))) (if (args:get-arg "-runtests") (runtests))