;;;; run.scm (use utils) (define-constant TEST-SOURCE-FILE "test-impl.scm") (cond-expand (unix (define (csi-n-csc fil #!optional (csi "csi") (csc-opt (compile-file-options))) (let ((rc (begin (print) (print "*** Interpreted ***") (print) (system (string-append csi " -s " fil))) ) ) (receive (normal? code) (process-status rc) (if (not normal?) (exit (fxneg code)) (if (not (zero? code)) (exit code) (begin (print) (print "*** Compiled ***") (print) (parameterize ((compile-file-options csc-opt)) ;NOTE this exits due to 'test-exit'! (compile-file fil)) ) ) ) ) ) ) ;from manual: library # system ;; Returns two values: #t if the process exited normally or #f otherwise; ;; and either the exit status, or the signal number if terminated via signal. (define (process-status rc) (define (wait-signaled? x) (not (= 0 (bitwise-and x 127)))) (define (wait-signal x) (bitwise-and x 127)) (define (wait-exit-status x) (arithmetic-shift x -8)) (if (wait-signaled? rc) (values #f (wait-signal rc)) (values #t (wait-exit-status rc)) ) ) (let* ((args (argv) ) (csi (car args) ) ) (csi-n-csc TEST-SOURCE-FILE csi '("-O3" "-d2")) ) ) (else ;(windows ...) (include TEST-SOURCE-FILE) ) )