Megatest

Diff
Login

Differences From Artifact [41eb86f112]:

To Artifact [46ccba8588]:


390
391
392
393
394
395
396






397
398
399
400
401
402
403

(define (common:get-testsuite-name)
  (or (configf:lookup *configdat* "setup" "testsuite" )
      (if *toppath* 
          (pathname-file *toppath*)
          (pathname-file (current-directory)))))







;;======================================================================
;; E X I T   H A N D L I N G
;;======================================================================

(define (common:legacy-sync-recommended)
  (or (args:get-arg "-runtests")
      (args:get-arg "-run")







>
>
>
>
>
>







390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409

(define (common:get-testsuite-name)
  (or (configf:lookup *configdat* "setup" "testsuite" )
      (if *toppath* 
          (pathname-file *toppath*)
          (pathname-file (current-directory)))))

(define (common:get-db-tmp-area)
  (create-directory (conc "/tmp/" (current-user-name)
                          "/megatest/"
                          (common:get-testsuite-name) "/"
                          (string-translate *toppath* "/" "_")) #t))

;;======================================================================
;; E X I T   H A N D L I N G
;;======================================================================

(define (common:legacy-sync-recommended)
  (or (args:get-arg "-runtests")
      (args:get-arg "-run")
611
612
613
614
615
616
617





















618
619
620
621
622
623
624
	    tlist
	    target)
	(if target
	    (begin
	      (debug:print-error 0 *default-log-port* "Invalid target, spaces or blanks not allowed \"" target "\", target should be: " (string-intersperse keys "/") ", have " tlist " for elements")
	      #f)
	    #f))))






















;;======================================================================
;; M I S C   L I S T S
;;======================================================================

;; items in lista are matched value and position in listb
;; return the remaining items in listb or #f







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







617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
	    tlist
	    target)
	(if target
	    (begin
	      (debug:print-error 0 *default-log-port* "Invalid target, spaces or blanks not allowed \"" target "\", target should be: " (string-intersperse keys "/") ", have " tlist " for elements")
	      #f)
	    #f))))

;; logic for getting homehost. Returns (host . at-home)
;;
(define (common:get-homehost)
  (let* ((currhost (get-host-name))
	 (bestadrs (server:get-best-guess-address currhost))
	 ;; first look in config, then look in file .homehost, create it if not found
	 (homehost (or (configf:lookup *configdat* "server" "homehost" )
		       (let ((hhf (conc *toppath* "/.homehost")))
			 (if (file-exists? hhf)
			     (with-input-from-file hhf read-line)
			     (if (file-write-access? *toppath*)
				 (begin
				   (with-output-to-file hhf
				     (lambda ()
				       (print bestadrs)))
				   (common:get-homehost))
				 #f)))))
	 (at-home  (or (equal? homehost currhost)
		       (equal? homehost bestadrs))))
    (cons homehost at-home)))

;;======================================================================
;; M I S C   L I S T S
;;======================================================================

;; items in lista are matched value and position in listb
;; return the remaining items in listb or #f