Megatest

Diff
Login

Differences From Artifact [dfc3e5bd3f]:

To Artifact [171edecc6b]:


47
48
49
50
51
52
53

54
55
56
57
58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
  version " megatest-version "
  license GPL, Copyright (C) Matt Welland 2012-2016

Usage: dashboard [options]
  -h                   : this help
  -server host:port    : connect to host:port instead of db access
  -test run-id,test-id : control test identified by testid

  -guimonitor          : control panel for runs

Misc
  -rows N         : set number of rows
"))

;; process args
(define remargs (args:get-args 
		 (argv)
		 (list  "-rows"
			"-run"
			"-test"

			"-debug"
			"-host" 
			"-transport"
			) 
		 (list  "-h"
			"-use-server"
			"-guimonitor"







>












>







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  version " megatest-version "
  license GPL, Copyright (C) Matt Welland 2012-2016

Usage: dashboard [options]
  -h                   : this help
  -server host:port    : connect to host:port instead of db access
  -test run-id,test-id : control test identified by testid
  -xterm run-id,test-id : Start a new xterm with specified run-id and test-id
  -guimonitor          : control panel for runs

Misc
  -rows N         : set number of rows
"))

;; process args
(define remargs (args:get-args 
		 (argv)
		 (list  "-rows"
			"-run"
			"-test"
                        "-xterm"
			"-debug"
			"-host" 
			"-transport"
			) 
		 (list  "-h"
			"-use-server"
			"-guimonitor"
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764





















1765
























1766
1767
1768
1769
1770
1771
1772
1773
	(set! bdylst (cons (apply iup:vbox (reverse res)) bdylst))
	(loop (+ runnum 1) 0 (make-vector ntests) '()))
       (else
	(let* ((button-key (mkstr runnum testnum))
	       (butn       (iup:button "" ;; button-key 
				       #:size "60x15" 
				       #:expand "HORIZONTAL"
				       #:fontsize "10" 
				       #:action (lambda (x)
						  (let* ((toolpath (car (argv)))
							 (buttndat (hash-table-ref (d:alldat-buttondat *alldat*) button-key))
							 (test-id  (db:test-get-id (vector-ref buttndat 3)))
							 (run-id   (db:test-get-run_id (vector-ref buttndat 3)))
							 (cmd  (conc toolpath " -test " run-id "," test-id "&")))
					;(print "Launching " cmd)





















						    (system cmd))))))
























	  (hash-table-set! (d:alldat-buttondat *alldat*) button-key (vector 0 "100 100 100" button-key #f #f)) 
	  (vector-set! testvec testnum butn)
	  (loop runnum (+ testnum 1) testvec (cons butn res))))))
    ;; now assemble the hdrlst and bdylst and kick off the dialog
    (iup:show
     (iup:dialog 
      #:title (conc "Megatest dashboard " (current-user-name) ":" *toppath*)
      #:menu (dcommon:main-menu)







|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
	(set! bdylst (cons (apply iup:vbox (reverse res)) bdylst))
	(loop (+ runnum 1) 0 (make-vector ntests) '()))
       (else
	(let* ((button-key (mkstr runnum testnum))
	       (butn       (iup:button "" ;; button-key 
				       #:size "60x15" 
				       #:expand "HORIZONTAL"
				       #:fontsize "10"
				       ;; :action (lambda (x)
				       ;; 	  (let* ((toolpath (car (argv)))
				       ;; 		 (buttndat (hash-table-ref (d:alldat-buttondat *alldat*) button-key))
				       ;; 		 (test-id  (db:test-get-id (vector-ref buttndat 3)))
				       ;; 		 (run-id   (db:test-get-run_id (vector-ref buttndat 3)))
				       ;; 		 (cmd  (conc toolpath " -test " run-id "," test-id "&")))
				       ;; ;(print "Launching " cmd)
				       ;; 	    (system cmd)))
                                       #:button-cb (lambda (obj a pressed x y btn . rem)
                                                     (print "pressed= " pressed " x= " x " y= " y " rem=" rem " btn=" btn " string? " (string? btn))
                                                     (if  (substring-index "3" btn)
                                                         (if (eq? pressed 0)
                                                             (let ((popup-menu (iup:menu 
                                                                                (iup:menu-item
                                                                                 "Run"
                                                                                 (iup:menu              
                                                                                  (iup:menu-item
                                                                                   "Rerun"
                                                                                   #:action
                                                                                   (lambda (obj)(print "Rerun")))
                                                                                  (iup:menu-item
                                                                                   "Start xterm"
                                                                                   #:action
                                                                                   (let* ((toolpath (car (argv)))
                                                                                          (buttndat (hash-table-ref (d:alldat-buttondat *alldat*) button-key))
                                                                                          (test-id  (db:test-get-id (vector-ref buttndat 3)))
                                                                                          (run-id   (db:test-get-run_id (vector-ref buttndat 3)))
                                                                                          (cmd  (conc toolpath " -xterm " run-id "," test-id "&")))
                                                                                     (system cmd))
                                                                                   ;; (lambda (x)
                                                                                   ;;            (if (directory-exists? rundir)
                                                                                   ;;                (let ((shell (if (get-environment-variable "SHELL") 
                                                                                   ;;                                 (conc "-e " (get-environment-variable "SHELL"))
                                                                                   ;;                                 "")))
                                                                                   ;;                  (common:without-vars
                                                                                   ;;                   (conc "cd " rundir 
                                                                                   ;;                         ";mt_xterm -T \"" (string-translate testfullname "()" "  ") "\" " shell "&")
                                                                                   ;;                   "MT_.*"))
                                                                                   ;;                (message-window  (conc "Directory " rundir " not found"))))
                                                                                   ))))))
                                                               (iup:show popup-menu
                                                                         #:x 'mouse
                                                                         #:y 'mouse
                                                                         #:modal? "NO")
                                                               (print "got here")))
                                                         (if (eq? pressed 0)
                                                             (let* ((toolpath (car (argv)))
                                                                    (buttndat (hash-table-ref (d:alldat-buttondat *alldat*) button-key))
                                                                    (test-id  (db:test-get-id (vector-ref buttndat 3)))
                                                                    (run-id   (db:test-get-run_id (vector-ref buttndat 3)))
                                                                    (cmd  (conc toolpath " -test " run-id "," test-id "&")))
                                                               (system cmd)))
                                                         )))))
          (hash-table-set! (d:alldat-buttondat *alldat*) button-key (vector 0 "100 100 100" button-key #f #f)) 
	  (vector-set! testvec testnum butn)
	  (loop runnum (+ testnum 1) testvec (cons butn res))))))
    ;; now assemble the hdrlst and bdylst and kick off the dialog
    (iup:show
     (iup:dialog 
      #:title (conc "Megatest dashboard " (current-user-name) ":" *toppath*)
      #:menu (dcommon:main-menu)
1930
1931
1932
1933
1934
1935
1936














1937
1938
1939
1940
1941
1942
1943
	(if (and (number? run-id)
		 (number? test-id)
		 (>= test-id 0))
	    (examine-test run-id test-id)
	    (begin
	      (debug:print 3 "INFO: tried to open test with invalid run-id,test-id. " (args:get-arg "-test"))
	      (exit 1)))))














     ((args:get-arg "-guimonitor")
      (gui-monitor (d:alldat-dblocal data)))
     (else
      (set! uidat (make-dashboard-buttons data ;; (d:alldat-dblocal data)
					  (d:alldat-numruns data)
					  (d:alldat-num-tests data)
					  (d:alldat-dbkeys data)







>
>
>
>
>
>
>
>
>
>
>
>
>
>







1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
	(if (and (number? run-id)
		 (number? test-id)
		 (>= test-id 0))
	    (examine-test run-id test-id)
	    (begin
	      (debug:print 3 "INFO: tried to open test with invalid run-id,test-id. " (args:get-arg "-test"))
	      (exit 1)))))
     ((args:get-arg "-xterm") ;; run-id,test-id
      (let* ((dat     (let ((d (map string->number (string-split (args:get-arg "-xterm") ","))))
			(if (> (length d) 1)
			    d
			    (list #f #f))))
	     (run-id  (car dat))
	     (test-id (cadr dat)))
	(if (and (number? run-id)
		 (number? test-id)
		 (>= test-id 0))
	    (dcommon:examine-xterm run-id test-id)
	    (begin
	      (debug:print 3 "INFO: tried to open xterm with invalid run-id,test-id. " (args:get-arg "-xterm"))
	      (exit 1)))))
     ((args:get-arg "-guimonitor")
      (gui-monitor (d:alldat-dblocal data)))
     (else
      (set! uidat (make-dashboard-buttons data ;; (d:alldat-dblocal data)
					  (d:alldat-numruns data)
					  (d:alldat-num-tests data)
					  (d:alldat-dbkeys data)