Megatest

Check-in [9b00b2ed30]
Login
Overview
Comment:Cherry pick from 67f07adab1: Use env var to trigger loading scripts
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rebase-envprocessing
Files: files | file ages | folders
SHA1: 9b00b2ed30792eab436c2f8215e75855b75fb51d
User & Date: mrwellan on 2016-04-28 08:41:45
Other Links: branch diff | manifest | tags
Context
2016-04-28
08:43
Cherry pick from 7254840ac9: Better way of handling scripts. Still needs improvement. check-in: ca141ede8f user: mrwellan tags: rebase-envprocessing
08:41
Cherry pick from 67f07adab1: Use env var to trigger loading scripts check-in: 9b00b2ed30 user: mrwellan tags: rebase-envprocessing
08:41
Cherry pick from de6124e350: Manual tweaks to display of tests check-in: c0455cef0a user: mrwellan tags: rebase-envprocessing
Changes

Modified common.scm from [0e936fa8d8] to [7f5eb88a88].

462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
  (let ((res (or (args:get-arg "-runname")
		 (args:get-arg ":runname")
		 (getenv "MT_RUNNAME"))))
    ;; (if res (set-environment-variable "MT_RUNNAME" res)) ;; not sure if this is a good idea. side effect and all ...
    res))

(define (common:args-get-target #!key (split #f))
  (let* ((keys    (if *configdat* (keys:config-get-fields *configdat*) '()))
	 (numkeys (length keys))
	 (target  (or (args:get-arg "-reqtarg")
		      (args:get-arg "-target")
		      (getenv "MT_TARGET")))
	 (tlist   (if target (string-split target "/" #t) '()))
	 (valid   (if target
		      (or (null? keys) ;; probably don't know our keys yet







|







462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
  (let ((res (or (args:get-arg "-runname")
		 (args:get-arg ":runname")
		 (getenv "MT_RUNNAME"))))
    ;; (if res (set-environment-variable "MT_RUNNAME" res)) ;; not sure if this is a good idea. side effect and all ...
    res))

(define (common:args-get-target #!key (split #f))
  (let* ((keys    (if (hash-table? *configdat*) (keys:config-get-fields *configdat*) '()))
	 (numkeys (length keys))
	 (target  (or (args:get-arg "-reqtarg")
		      (args:get-arg "-target")
		      (getenv "MT_TARGET")))
	 (tlist   (if target (string-split target "/" #t) '()))
	 (valid   (if target
		      (or (null? keys) ;; probably don't know our keys yet

Modified megatest.scm from [72e501d00e] to [139111b800].

1860
1861
1862
1863
1864
1865
1866

1867
1868
1869
1870
1871






1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897

;;======================================================================
;; Start a repl
;;======================================================================

;; fakeout readline


(if (or (args:get-arg "-repl")
	(args:get-arg "-load"))
    (let* ((toppath (launch:setup))
	   (dbstruct (if toppath (make-dbr:dbstruct path: toppath local: (args:get-arg "-local")) #f)))
      (if dbstruct






	  (begin
	    (set! *db* dbstruct)
	    (set! *client-non-blocking-mode* #t)
	    (import extras) ;; might not be needed
	    ;; (import csi)
	    (import readline)
	    (import apropos)
	    ;; (import (prefix sqlite3 sqlite3:)) ;; doesn't work ...
	    (include "readline-fix.scm")
	    (gnu-history-install-file-manager
	     (string-append
	      (or (get-environment-variable "HOME") ".") "/.megatest_history"))
	    (current-input-port (make-gnu-readline-port "megatest> "))
	    (if (args:get-arg "-repl")
		(repl)
		(load (args:get-arg "-load")))
	    (db:close-all dbstruct))
	  (exit))
      (set! *didsomething* #t)))

;;======================================================================
;; Wait on a run to complete
;;======================================================================

(if (and (args:get-arg "-run-wait")
	 (not (or (args:get-arg "-run")







>
|




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







1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904

;;======================================================================
;; Start a repl
;;======================================================================

;; fakeout readline

(if (or (getenv "MT_RUNSCRIPT")
	(args:get-arg "-repl")
	(args:get-arg "-load"))
    (let* ((toppath (launch:setup))
	   (dbstruct (if toppath (make-dbr:dbstruct path: toppath local: (args:get-arg "-local")) #f)))
      (if dbstruct
	  (cond
	   ((getenv "MT_RUNSCRIPT") ;; special way to run megatest scripts #!/usr/bin/env MT_RUNSCRIPT=yes megatest
	    (let ((fname (cadr (argv))))
	      (print "fname=" fname)
	      (load fname)))
	   (else
	    (begin
	      (set! *db* dbstruct)
	      (set! *client-non-blocking-mode* #t)
	      (import extras) ;; might not be needed
	      ;; (import csi)
	      (import readline)
	      (import apropos)
	      ;; (import (prefix sqlite3 sqlite3:)) ;; doesn't work ...
	      (include "readline-fix.scm")
	      (gnu-history-install-file-manager
	       (string-append
		(or (get-environment-variable "HOME") ".") "/.megatest_history"))
	      (current-input-port (make-gnu-readline-port "megatest> "))
	      (if (args:get-arg "-repl")
		  (repl)
		  (load (args:get-arg "-load")))
	      (db:close-all dbstruct))
	    (exit)))
	  (set! *didsomething* #t))))

;;======================================================================
;; Wait on a run to complete
;;======================================================================

(if (and (args:get-arg "-run-wait")
	 (not (or (args:get-arg "-run")