@@ -28,10 +28,11 @@ \"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 + -set-toplog logfname : set the overall log for a suite of sub-tests -m comment : insert a comment for this test Run data :runname : required, name for this particular test run :state : required if updating step state; e.g. start, end, completed @@ -76,10 +77,11 @@ ":status" "-list-runs" "-testpatt" "-itempatt" "-setlog" + "-set-toplog" "-runstep" "-logpro" "-m" ) (list "-h" @@ -318,20 +320,23 @@ (runscript (assoc/default 'runscript cmdinfo)) (db-host (assoc/default 'db-host cmdinfo)) (run-id (assoc/default 'run-id cmdinfo)) (itemdat (assoc/default 'itemdat cmdinfo)) (runname (assoc/default 'runname cmdinfo)) + (megatest (assoc/default 'megatest cmdinfo)) (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) (fullrunscript (conc testpath "/" runscript)) (db #f)) (print "Exectuing " test-name " on " (get-host-name)) (change-directory testpath) (setenv "MT_TEST_RUN_DIR" work-area) (setenv "MT_TEST_NAME" test-name) (setenv "MT_ITEM_INFO" (conc itemdat)) (setenv "MT_RUNNAME" runname) + (setenv "MT_MEGATEST" megatest) (setenv "PATH" (conc (getenv "PATH") ":" mt-bindir-path)) + (if (not (setup-for-run)) (begin (print "Failed to setup, exiting") (exit 1))) ;; now can find our db @@ -445,10 +450,11 @@ (exit 6))) (sqlite3:finalize! db) (set! *didsomething* #t)))) (if (or (args:get-arg "-setlog") ;; since setting up is so costly lets piggyback on -test-status + (args:get-arg "-set-toplog") (args:get-arg "-test-status") (args:get-arg "-runstep")) (if (not (getenv "MT_CMDINFO")) (begin (print "ERROR: MT_CMDINFO env var not set, commands -test-status, -runstep and -setlog must be called *inside* a megatest environment!") @@ -470,10 +476,12 @@ (print "Failed to setup, exiting") (exit 1))) (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") (test-set-status! db run-id test-name state status itemdat (args:get-arg "-m")) (if (and state status) (if (not (args:get-arg "-setlog")) (begin