source: project/release/5/tiger-hash/trunk/tests/run.scm @ 38447

Last change on this file since 38447 was 38447, checked in by Kon Lovett, 8 months ago

update runner, optimization

File size: 1.8 KB
RevLine 
[38447]1;;;; run.scm -*- Scheme -*-
[35880]2
[38447]3(import scheme)
4
5;;; Create Egg Const
6
[35880]7(define EGG-NAME "tiger-hash")
8
9;chicken-install invokes as "<csi> -s run.scm <eggnam> <eggdir>"
10
[38447]11(import (only (chicken pathname) make-pathname))
12(import (only (chicken process) system))
13(import (only (chicken process-context) argv))
14(import (only (chicken format) format))
[35880]15
[38447]16(define (test-filename test-name)
17  (string-append test-name "-test") )
[35880]18
[38447]19(define (egg-name args #!optional (def EGG-NAME))
[35880]20  (cond
21    ((<= 4 (length *args*))
22      (cadddr *args*) )
23    (def
24      def )
25    (else
26      (error 'test "cannot determine egg-name") ) ) )
27
[38447]28;;
[35880]29
[38447]30(define *args* (argv))
31(define *egg* (egg-name *args*))
32(define *tests* `(,*egg*))
[35880]33
[38447]34(define *current-directory* (cond-expand (unix "./") (else #f)))
[35880]35
[38447]36;no -disable-interrupts or -no-lambda-info
37(define *csc-options* "-inline-global -local -inline \
38  -specialize -optimize-leaf-routines -clustering -lfa2 \
39  -no-trace -unsafe")
[35880]40
[38447]41(define (run-test-evaluated test-name test-source)
42  (format #t "*** ~A - csi ***~%" test-name)
43  (system (string-append "csi -s " test-source)) )
44
45(define (run-test-compiled test-name test-source csc-options)
46  (format #t "*** ~A - csc ~A ***~%" test-name csc-options)
47  ;csc output is in current directory
48  (system (string-append "csc" " " csc-options " " test-source))
49  (system (make-pathname *current-directory* (test-filename test-name))) )
50
[35880]51;;;
52
[38447]53(define (run-test #!optional (test-name *egg*) (csc-options *csc-options*))
54  (let ((test-source (make-pathname #f (test-filename test-name) "scm")))
55    (run-test-evaluated test-name test-source)
56    (newline)
57    (run-test-compiled test-name test-source csc-options) ) )
58
59(define (run-tests #!optional (test-names *tests*) (csc-options *csc-options*))
60  (for-each (cut run-test <> csc-options) test-names) )
61
62;;; Do Test
63
64(run-tests)
Note: See TracBrowser for help on using the repository browser.