2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
|
(args:get-arg "-diff-email"))
(set! *didsomething* #t)
(exit 0)))
(if (or (getenv "MT_RUNSCRIPT")
(args:get-arg "-repl")
(args:get-arg "-load"))
(let* ((toppath (launch:setup))
(dbstruct (if (and toppath
#;(common:on-homehost?))
(db:setup #f)
#f))) ;; make-dbr:dbstruct path: toppath local: (args:get-arg "-local")) #f)))
(if *toppath*
(cond
((getenv "MT_RUNSCRIPT")
;; How to run megatest scripts
;;
;; #!/bin/bash
;;
;; export MT_RUNSCRIPT=yes
;; megatest << EOF
;; (print "Hello world")
;; (exit)
;; EOF
(repl))
(else
(begin
(set! *db* dbstruct)
;; (import extras) ;; might not be needed
;; (import csi)
;; (import readline)
(import apropos
archivemod
commonmod
configfmod
dbmod
debugprint
ezstepsmod
http-transportmod
launchmod
processmod
rmtmod
runsmod
servermod
tasksmod
testsmod)
(set-history-length! 300)
(load-history-from-file ".megatest_history")
(current-input-port (make-linenoise-port))
;; (import (prefix sqlite3 sqlite3:)) ;; doesn't work ...
;; (if *use-new-readline*
;; (begin
;; (install-history-file (get-environment-variable "HOME") ".megatest_history") ;; [homedir] [filename] [nlines])
;; (current-input-port (make-readline-port "megatest> ")))
;; (begin
;; (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) <= taken care of by on-exit call
)
(exit)))
(set! *didsomething* #t))))
;;======================================================================
;; Wait on a run to complete
;;======================================================================
(if (and (args:get-arg "-run-wait")
(not (or (args:get-arg "-run")
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
|
(args:get-arg "-diff-email"))
(set! *didsomething* #t)
(exit 0)))
(if (or (getenv "MT_RUNSCRIPT")
(args:get-arg "-repl")
(args:get-arg "-load"))
(let* ((toppath (launch:setup)))
;; (dbstruct (if (and toppath
;; #;(common:on-homehost?))
;; (db:setup #f) ;; sets up main.db
;; #f))) ;; make-dbr:dbstruct path: toppath local: (args:get-arg "-local")) #f)))
(if *toppath*
(cond
((getenv "MT_RUNSCRIPT")
;; How to run megatest scripts
;;
;; #!/bin/bash
;;
;; export MT_RUNSCRIPT=yes
;; megatest << EOF
;; (print "Hello world")
;; (exit)
;; EOF
(repl))
(else
(begin
;; (set! *db* dbstruct)
;; (import extras) ;; might not be needed
;; (import csi)
;; (import readline)
(import apropos
archivemod
commonmod
configfmod
dbmod
debugprint
ezstepsmod
http-transportmod
launchmod
processmod
rmtmod
runsmod
servermod
tasksmod
testsmod)
(set-history-length! 300)
(load-history-from-file ".megatest_history")
(current-input-port (make-linenoise-port))
;; (import (prefix sqlite3 sqlite3:)) ;; doesn't work ...
;; (if *use-new-readline*
;; (begin
;; (install-history-file (get-environment-variable "HOME") ".megatest_history") ;; [homedir] [filename] [nlines])
;; (current-input-port (make-readline-port "megatest> ")))
;; (begin
;; (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) <= taken care of by on-exit call
)
(exit)))
(set! *didsomething* #t))))
;;======================================================================
;; Wait on a run to complete
;;======================================================================
(if (and (args:get-arg "-run-wait")
(not (or (args:get-arg "-run")
|