;;;; run.scm -*- Scheme -*- (import scheme) ;;; Create Time Const (define EGG-NAME "timed-resource") ;chicken-install invokes as " -s run.scm " (import (only (chicken pathname) make-pathname) (only (chicken process) system) (only (chicken process-context) argv) (only (chicken format) format)) (define (test-filename test-name) (string-append test-name "-test") ) (define (egg-name args #!optional (def EGG-NAME)) (cond ((<= 4 (length *args*)) (cadddr *args*) ) (def def ) (else (error 'test "cannot determine egg-name") ) ) ) ;; (define *args* (argv)) (define *egg* (egg-name *args*)) (define *tests* `(,*egg*)) (define *current-directory* (cond-expand (unix "./") (else #f))) ;no -disable-interrupts or -no-lambda-info (define *csc-options* "-inline-global -local -inline \ -specialize -optimize-leaf-routines -clustering -lfa2 \ -no-trace -unsafe") (define (run-test-evaluated test-name test-source) (format #t "*** ~A - csi ***~%" test-name) (system (string-append "csi -s " test-source)) ) (define (run-test-compiled test-name test-source csc-options) (format #t "*** ~A - csc ~A ***~%" test-name csc-options) ;csc output is in current directory (system (string-append "csc" " " csc-options " " test-source)) (system (make-pathname *current-directory* (test-filename test-name))) ) ;;; (define (run-test #!optional (test-name *egg*) (csc-options *csc-options*)) (let ((test-source (make-pathname #f (test-filename test-name) "scm"))) (run-test-evaluated test-name test-source) (newline) (run-test-compiled test-name test-source csc-options) ) ) (define (run-tests #!optional (test-names *tests*) (csc-options *csc-options*)) (for-each (cut run-test <> csc-options) test-names) ) ;;; Do Test (run-tests)