Megatest

Check-in [290c7d7cc8]
Login
Overview
Comment:Exit status handling has to be hard coded to a number, can't seem to get a variable to work
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 290c7d7cc89ffa7c16ffb3ceeb0f28ac711f4990
User & Date: mrwellan on 2011-05-09 18:06:25
Other Links: manifest | tags
Context
2011-05-11
01:21
Implemented fine grained deletion of runs and tests check-in: 09102f8425 user: matt tags: trunk
2011-05-09
18:06
Exit status handling has to be hard coded to a number, can't seem to get a variable to work check-in: 290c7d7cc8 user: mrwellan tags: trunk
15:21
Fixed typo on work area environment setting check-in: c5d5ee467e user: mrwellan tags: trunk
Changes

Modified common.scm from [9278a87851] to [64281b3aad].

24
25
26
27
28
29
30

31
32
33
34
35
36
37
(define user (getenv "USER"))

(define *configinfo* #f)
(define *configdat*  #f)
(define *toppath*    #f)
(define *already-seen-runconfig-info* #f)
(define *waiting-queue* (make-hash-table))


(define-inline (get-with-default val default)
  (let ((val (args:get-arg val)))
    (if val val default)))

(define-inline (assoc/default key lst . default)
  (let ((res (assoc key lst)))







>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(define user (getenv "USER"))

(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)))

(define-inline (assoc/default key lst . default)
  (let ((res (assoc key lst)))

Modified megatest.scm from [e3ee7a0cc4] to [3711174da5].

495
496
497
498
499
500
501

502
503
504
505
506
507

508
509
510
511

512
513
514
515

516
517
518
519
520
521
522
523
524
525
526
		    (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
		    (print "INFO: Running \"" fullcmd "\"")
		    (change-directory startingdir)
		    (set! exitstat (system fullcmd)) ;; cmd params))

		    (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"))

			       (cmd         (string-intersperse (list "logpro" logprofile htmllogfile "<" logfile ">" (conc stepname "_logpro.log")) " ")))
			  (print "INFO: running \"" cmd "\"")
			  (change-directory startingdir)
			  (set! exitstat (system cmd))

			  (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"))
		    (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))







>






>




>


|

>
|
|
|
|







495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
		    (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
		    (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)))
		    (teststep-set-status! db run-id test-name stepname "end" exitstat itemdat (args:get-arg "-m"))
		    (sqlite3:finalize! db)
		    (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)
	  (keys #f))
      (if (not (setup-for-run))
537
538
539
540
541
542
543



    (begin
      (print "Look at the dashboard for now")
      ;; (megatest-gui)
      (set! *didsomething* #t)))

(if (not *didsomething*)
    (print help))










>
>
>
541
542
543
544
545
546
547
548
549
550
    (begin
      (print "Look at the dashboard for now")
      ;; (megatest-gui)
      (set! *didsomething* #t)))

(if (not *didsomething*)
    (print help))

(if (not (eq? *globalexitstatus* 0))
    (exit *globalexitstatus*))