Changeset 38103 in project


Ignore:
Timestamp:
01/14/20 22:39:48 (8 days ago)
Author:
Kon Lovett
Message:

canon import style

Location:
release/5/fx-utils
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • release/5/fx-utils/branches/include/fx-inlines.scm

    r36642 r38103  
    33;;;; Kon Lovett, May '17
    44
    5 (import scheme
    6   (chicken fixnum)
    7   (chicken type))
     5(import scheme)
     6(import (chicken fixnum))
     7(import (chicken type))
    88
    99;;;
  • release/5/fx-utils/branches/include/fx-utils.egg

    r36642 r38103  
    99 (test-dependencies test)
    1010 (components
     11  ;FIXME this is going into /usr/local/chicken/5/share but (chicken-home) = ../chicken !
    1112  (scheme-include fx-inlines
    1213    (files "fx-inlines.scm"))
  • release/5/fx-utils/branches/include/fx-utils.scm

    r36642 r38103  
    6161  fxmax-and-min)
    6262
    63 (import scheme
    64   (chicken base)
    65   (chicken fixnum)
    66   (chicken foreign)
    67   (chicken type))
     63(import scheme)
     64(import (chicken base))
     65(import (chicken fixnum))
     66(import (chicken foreign))
     67(import (chicken type))
    6868
    6969;;;
  • release/5/fx-utils/branches/include/tests/fx-utils-test.scm

    r36642 r38103  
    88;;;
    99
    10 (import (chicken base) (chicken fixnum))
     10(import (chicken base))
     11(import (chicken fixnum))
    1112
    1213;;
  • release/5/fx-utils/branches/include/tests/run.scm

    r36642 r38103  
     1;;;; run.scm -*- Scheme -*-
     2
     3(import scheme)
     4
     5;;; Create Time Const
    16
    27(define EGG-NAME "fx-utils")
     
    1015  (only (chicken format) format))
    1116
    12 (define *args* (argv))
     17(define (test-filename test-name)
     18  (string-append test-name "-test") )
    1319
    14 ;no -disable-interrupts
    15 (define *csc-options* "-inline-global \
    16   -specialize -optimize-leaf-routines -clustering -lfa2 \
    17   -local -inline \
    18   -no-trace -no-lambda-info \
    19   -unsafe")
    20 
    21 (define (test-name #!optional (eggnam EGG-NAME))
    22   (string-append eggnam "-test") )
    23 
    24 (define (egg-name #!optional (def EGG-NAME))
     20(define (egg-name args #!optional (def EGG-NAME))
    2521  (cond
    2622    ((<= 4 (length *args*))
     
    3127      (error 'test "cannot determine egg-name") ) ) )
    3228
    33 ;;;
     29;;
    3430
    35 (set! EGG-NAME (egg-name))
     31(define *args* (argv))
     32(define *egg* (egg-name *args*))
     33(define *tests* `(,*egg*))
    3634
    37 (define (run-test #!optional (eggnam EGG-NAME) (cscopts *csc-options*))
    38   (let ((tstnam (test-name eggnam)))
    39     (format #t "*** csi ***~%")
    40     (system (string-append "csi -s " (make-pathname #f tstnam "scm")))
    41     (newline)
    42     (format #t "*** csc ~s ***~%" cscopts)
    43     (system (string-append "csc" " " cscopts " " (make-pathname #f tstnam "scm")))
    44     (system (make-pathname (cond-expand (unix "./") (else #f)) tstnam)) ) )
     35(define *current-directory* (cond-expand (unix "./") (else #f)))
    4536
    46 (define (run-tests eggnams #!optional (cscopts *csc-options*))
    47   (for-each (cut run-test <> cscopts) eggnams) )
     37;no -disable-interrupts or -no-lambda-info
     38(define *csc-options* "-inline-global -local -inline \
     39  -specialize -optimize-leaf-routines -clustering -lfa2 \
     40  -no-trace -unsafe")
     41
     42(define (run-test-evaluated test-name test-source)
     43  (format #t "*** ~A - csi ***~%" test-name)
     44  (system (string-append "csi -s " test-source)) )
     45
     46(define (run-test-compiled test-name test-source csc-options)
     47  (format #t "*** ~A - csc ~A ***~%" test-name csc-options)
     48  ;csc output is in current directory
     49  (system (string-append "csc" " " csc-options " " test-source))
     50  (system (make-pathname *current-directory* (test-filename test-name))) )
    4851
    4952;;;
    5053
    51 (run-test)
     54(define (run-test #!optional (test-name *egg*) (csc-options *csc-options*))
     55  (let ((test-source (make-pathname #f (test-filename test-name) "scm")))
     56    (run-test-evaluated test-name test-source)
     57    (newline)
     58    (run-test-compiled test-name test-source csc-options) ) )
     59
     60(define (run-tests #!optional (test-names *tests*) (csc-options *csc-options*))
     61  (for-each (cut run-test <> csc-options) test-names) )
     62
     63;;; Do Test
     64
     65(run-tests)
  • release/5/fx-utils/trunk/fx-inlines.scm

    r36642 r38103  
    1616  fxsqr fxcub)
    1717
    18 (import scheme
    19   (chicken base)
    20   (chicken fixnum)
    21   (chicken type))
     18(import scheme)
     19(import (chicken base))
     20(import (chicken fixnum))
     21(import (chicken type))
    2222
    2323;;;
     
    5959(define (fxclosed-left? l x h) (and (fx<= l x) (fx< x h)))
    6060
    61 ;
     61;inline, remember
    6262(define (fxclosedr? l x h) (fxclosed-right? l x h))
    6363(define (fxclosedl? l x h) (fxclosed-left? l x h))
  • release/5/fx-utils/trunk/fx-utils.scm

    r36642 r38103  
    6161  fxmax-and-min)
    6262
    63 (import scheme
    64   (chicken base)
    65   (chicken fixnum)
    66   (chicken foreign)
    67   (chicken type)
    68   fx-inlines)
     63(import scheme)
     64(import (chicken base))
     65(import (chicken fixnum))
     66(import (chicken foreign))
     67(import (chicken type))
     68(import fx-inlines)
    6969
    7070;;;
  • release/5/fx-utils/trunk/tests/fx-utils-test.scm

    r36960 r38103  
    88;;;
    99
    10 (import (chicken base) (chicken fixnum))
     10(import (chicken base))
     11(import (chicken fixnum))
    1112
    1213;;
  • release/5/fx-utils/trunk/tests/run.scm

    r36960 r38103  
     1;;;; run.scm -*- Scheme -*-
     2
     3(import scheme)
     4
     5;;; Create Time Const
    16
    27(define EGG-NAME "fx-utils")
     
    1015  (only (chicken format) format))
    1116
    12 (define *args* (argv))
     17(define (test-filename test-name)
     18  (string-append test-name "-test") )
    1319
    14 ;no -disable-interrupts
    15 (define *csc-options* "-inline-global \
    16   -specialize -optimize-leaf-routines -clustering -lfa2 \
    17   -local -inline \
    18   -no-trace -no-lambda-info \
    19   -unsafe")
    20 
    21 (define (test-name #!optional (eggnam EGG-NAME))
    22   (string-append eggnam "-test") )
    23 
    24 (define (egg-name #!optional (def EGG-NAME))
     20(define (egg-name args #!optional (def EGG-NAME))
    2521  (cond
    2622    ((<= 4 (length *args*))
     
    3127      (error 'test "cannot determine egg-name") ) ) )
    3228
    33 ;;;
     29;;
    3430
    35 (set! EGG-NAME (egg-name))
     31(define *args* (argv))
     32(define *egg* (egg-name *args*))
     33(define *tests* `(,*egg*))
    3634
    37 (define (run-test #!optional (eggnam EGG-NAME) (cscopts *csc-options*))
    38   (let ((tstnam (test-name eggnam)))
    39     (format #t "*** csi ***~%")
    40     (system (string-append "csi -s " (make-pathname #f tstnam "scm")))
    41     (newline)
    42     (format #t "*** csc ~s ***~%" cscopts)
    43     (system (string-append "csc" " " cscopts " " (make-pathname #f tstnam "scm")))
    44     (system (make-pathname (cond-expand (unix "./") (else #f)) tstnam)) ) )
     35(define *current-directory* (cond-expand (unix "./") (else #f)))
    4536
    46 (define (run-tests eggnams #!optional (cscopts *csc-options*))
    47   (for-each (cut run-test <> cscopts) eggnams) )
     37;no -disable-interrupts or -no-lambda-info
     38(define *csc-options* "-inline-global -local -inline \
     39  -specialize -optimize-leaf-routines -clustering -lfa2 \
     40  -no-trace -unsafe")
     41
     42(define (run-test-evaluated test-name test-source)
     43  (format #t "*** ~A - csi ***~%" test-name)
     44  (system (string-append "csi -s " test-source)) )
     45
     46(define (run-test-compiled test-name test-source csc-options)
     47  (format #t "*** ~A - csc ~A ***~%" test-name csc-options)
     48  ;csc output is in current directory
     49  (system (string-append "csc" " " csc-options " " test-source))
     50  (system (make-pathname *current-directory* (test-filename test-name))) )
    4851
    4952;;;
    5053
    51 (run-test)
     54(define (run-test #!optional (test-name *egg*) (csc-options *csc-options*))
     55  (let ((test-source (make-pathname #f (test-filename test-name) "scm")))
     56    (run-test-evaluated test-name test-source)
     57    (newline)
     58    (run-test-compiled test-name test-source csc-options) ) )
     59
     60(define (run-tests #!optional (test-names *tests*) (csc-options *csc-options*))
     61  (for-each (cut run-test <> csc-options) test-names) )
     62
     63;;; Do Test
     64
     65(run-tests)
Note: See TracChangeset for help on using the changeset viewer.