(import (rnrs load) (nmosh process) (srfi :8) (srfi :19) (srfi :48) (except (mosh) time format) (yuni util files) (nmosh win32 util) (rnrs)) (define files (file->sexp-list "tests/testfiles.scm")) (define NMOSH (nmosh-executable-path)) (define something-wrong? #f) (define (run-nmosh file) (receive (s out err) (apply process->stdout+stderr (list NMOSH file)) (unless (string=? "" out) (display " -- stdout -- \n") (display out)(newline)) (unless (string=? "" err) (display " -- stderr -- \n") (display err)(newline)) (unless (= s 0) (set! something-wrong? #t)) s)) (define (time-report start end) (let ((dif (time-difference end start))) (let ((n (time-nanosecond dif)) (s (time-second dif))) (format "(~a msec)" (* 1000.0 (+ s (/ n 1000 1000 1000))))))) (define (testaudit file) (unless (file-exists? file) (format #t "file: ~a not found!!\n" file) (exit -1))) (define (runtest file) (define ret) (define start) (define end) (format #t "======= run ~a\n" (list NMOSH file)) (set! start (current-time)) (set! ret (run-nmosh file)) (set! end (current-time)) (format #t "======= done ~a(~a) ~a\n" file ret (time-report start end))) (for-each testaudit files) (for-each runtest files) (if something-wrong? (exit -1) (exit 0))