19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
-h : this help
Process and test running
-runall : run all tests that are not state COMPLETED and status PASS
-runtests tst1,tst2 ... : run tests
Run status updates (these require that you are in a test directory
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:
: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
-list-runs patt : list runs matching pattern \"patt\", % is the wildcard
-showkeys : show the keys used in this megatest setup
Misc (note: there is a bug in argument processing, put these at the beginning
of the command line or it may fail)
-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
|
|
|
<
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
-h : this help
Process and test running
-runall : run all tests that are not state COMPLETED and status PASS
-runtests tst1,tst2 ... : run tests
Run status updates (these require that you are in a test directory
and you have sourced the \"megatest.csh\"
\"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:
: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
-list-runs patt : list runs matching pattern \"patt\", % is the wildcard
-showkeys : show the keys used in this megatest setup
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
|
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
(let* ((testpath (assoc/default 'testpath cmdinfo))
(work-area (assoc/default 'work-area cmdinfo))
(test-name (assoc/default 'test-name cmdinfo))
(runscript (assoc/default 'runscript cmdinfo))
(db-host (assoc/default 'db-host cmdinfo))
(run-id (assoc/default 'run-id cmdinfo))
(itemdat (assoc/default 'itemdat cmdinfo))
(fullrunscript (conc testpath "/" runscript))
(db #f))
(print "Exectuing " test-name " on " (get-host-name))
(change-directory testpath)
(if (not (setup-for-run))
(begin
(print "Failed to setup, exiting")
(exit 1)))
;; now can find our db
(set! db (open-db))
(change-directory work-area)
|
>
>
>
|
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
|
(let* ((testpath (assoc/default 'testpath cmdinfo))
(work-area (assoc/default 'work-area cmdinfo))
(test-name (assoc/default 'test-name cmdinfo))
(runscript (assoc/default 'runscript cmdinfo))
(db-host (assoc/default 'db-host cmdinfo))
(run-id (assoc/default 'run-id cmdinfo))
(itemdat (assoc/default 'itemdat 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" testpath)
(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
(set! db (open-db))
(change-directory work-area)
|
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
|
(exitstat #f))
;; mark the start of the test
(test-set-status! db run-id test-name "start" "n/a" itemdat (args:get-arg "-m"))
;; close the db
(sqlite3:finalize! db)
;; run the test step
(set! exitstat (process-run cmd params))
;; run logpro if applicable
(if logpro
(set! exitstat (process-run "logpro" logpro (conc test-name ".html"))))
(test-set-status! db run-id test-name "end" FINISH MEEEEE!!!!!!
;; open the db
;; mark the end of the test
))
(sqlite3:finalize! db)
(set! *didsomething* #t))))
(if (args:get-arg "-showkeys")
(let ((db #f)
(keys #f))
(if (not (setup-for-run))
|
>
>
>
|
>
|
>
>
|
|
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
|
(exitstat #f))
;; mark the start of the test
(test-set-status! db run-id test-name "start" "n/a" itemdat (args:get-arg "-m"))
;; close the db
(sqlite3:finalize! db)
;; run the test step
(set! exitstat (process-run cmd params))
;; re-open the db
(set! db (open-db))
;; run logpro if applicable
(if logpro
(let ((logfile (conc test-name ".html")))
(set! exitstat (process-run "logpro" logpro logfile))
(test-set-log! db run-id test-name itemdat logfile)))
(test-set-status! db run-id test-name "end" exitstat itemdat (args:get-arg "-m"))
(sqlite3:finalize! db)
(exit exitstat)
;; open the db
;; mark the end of the test
)))
(sqlite3:finalize! db)
(set! *didsomething* #t))))
(if (args:get-arg "-showkeys")
(let ((db #f)
(keys #f))
(if (not (setup-for-run))
|