Changeset 38537 in project


Ignore:
Timestamp:
04/03/20 20:56:06 (16 months ago)
Author:
Kon Lovett
Message:

*-test runner, appropriate optimization for rt type-checks, style, strict-types

Location:
release/5/srfi-29/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • release/5/srfi-29/trunk/srfi-29-install.scm

    r38183 r38537  
    1616  install-bundle)
    1717
    18 (import scheme
    19   (chicken base)
    20   (chicken type)
    21   (chicken syntax)
    22   (chicken platform)
    23   (chicken pathname)
    24   (chicken file)
    25   (srfi 1)
    26   utf8 utf8-srfi-13
    27   (only type-errors error-argument-type warning-argument-type))
     18(import scheme)
     19(import (chicken base))
     20(import (chicken type))
     21(import (chicken syntax))
     22(import (chicken platform))
     23(import (chicken pathname))
     24(import (chicken file))
     25(import (srfi 1))
     26(import utf8)
     27(import utf8-srfi-13)
     28(import (only type-errors error-argument-type warning-argument-type))
    2829
    2930;;; Dependency Neurosis
  • release/5/srfi-29/trunk/srfi-29-logic.scm

    r38182 r38537  
    1818  load-localized-compiled-code)
    1919
    20 (import scheme
    21   (chicken base)
    22   (only (chicken load) load-library load-relative load-noisily)
    23   (only (chicken platform) register-feature!)
    24   utf8
    25   (only (srfi 1) first second every)
    26   (only type-checks check-symbol check-list define-check+error-type)
    27   (only type-errors-basic error-bound-value)
    28   (srfi 29))
     20(import scheme)
     21(import (chicken base))
     22(import (only (chicken load) load-library load-relative load-noisily))
     23(import  (only (chicken platform) register-feature!))
     24(import utf8)
     25(import (only (srfi 1) first second every))
     26(import (only type-checks check-symbol check-list define-check+error-type))
     27(import (only type-errors-basic error-bound-value))
     28(import (srfi 29))
    2929
    3030;;NOTE Symbol table access (unsupported)
  • release/5/srfi-29/trunk/srfi-29.egg

    r38154 r38537  
    22
    33((synopsis "Localization")
    4  (version "3.0.1")
     4 (version "3.0.2")
    55 (category misc)
    66 (author "Scott G. Miller (for CHICKEN [[/users/kon-lovett]])")
     
    2222    (files "srfi-29-bundles/srfi-29"))
    2323  (extension srfi-29-install
    24     #;(inline-file)
    2524    (types-file)
    2625    ;BUG data do not have build commands
    2726    ;(component-dependencies srfi-29-bundles)
    28     (csc-options "-O3" "-d1" "-local" "-no-procedure-checks-for-toplevel-bindings") )
     27    (csc-options "-O3" "-d1" "-local" "-strict-types" "-no-procedure-checks-for-toplevel-bindings"))
    2928  (extension srfi-29
    30     #;(inline-file)
    3129    (types-file)
    3230    (component-dependencies srfi-29-install)
    33     (csc-options "-O3" "-d1" "-local" "-no-procedure-checks-for-toplevel-bindings") )
     31    (csc-options "-O3" "-d1" "-local" "-strict-types" "-no-procedure-checks" "-no-bound-checks"))
    3432  (extension srfi-29-logic
    35     #;(inline-file)
    3633    (types-file)
    3734    (component-dependencies srfi-29)
    38     (csc-options "-O3" "-d1" "-local" "-no-procedure-checks-for-toplevel-bindings") ) ) )
     35    (csc-options "-O3" "-d1" "-local" "-strict-types" "-no-procedure-checks" "-no-bound-checks")) ) )
  • release/5/srfi-29/trunk/srfi-29.scm

    r38454 r38537  
    5454(import (chicken base))
    5555(import (chicken module))
    56 (import utf8)
    57 (import (only utf8-srfi-13 string-downcase))
    58 (import (only (srfi 1)
    59   first second third
    60   reverse! every drop-right!
    61   remove remove! list-copy))
    62 (import srfi-69)
    63 (import (only (srfi 69)
    64   make-hash-table
    65   hash-table-ref/default
    66   hash-table-set! hash-table-delete!
    67   hash-table->alist alist->hash-table
    68   hash-table-keys))
    6956(import (only (chicken condition) abort make-property-condition))
    7057(import (only (chicken string) conc ->string))
     
    7461(import (only (chicken file) delete-file* create-directory delete-directory directory file-exists?))
    7562(import (only (chicken file posix) directory?))
     63(import utf8)
     64(import (only utf8-srfi-13 string-downcase))
     65(import (only (srfi 1)
     66  first second third
     67  reverse! every drop-right!
     68  remove remove! list-copy))
     69(import (only (srfi 69)
     70  make-hash-table hash-table?
     71  hash-table-ref/default
     72  hash-table-set! hash-table-delete!
     73  hash-table->alist alist->hash-table
     74  hash-table-keys))
    7675(import (only miscmacros define-parameter select))
    7776(import (only moremacros define-warning-parameter warning-guard))
  • release/5/srfi-29/trunk/tests/run.scm

    r38454 r38537  
    1 ;;;; run.scm -*- Scheme -*-
    2 
    3 (import scheme)
    41;;;; run.scm -*- Scheme -*-
    52
     
    129;chicken-install invokes as "<csi> -s run.scm <eggnam> <eggdir>"
    1310
    14 (import (only (chicken pathname) make-pathname))
     11(import (only (chicken pathname)
     12  make-pathname pathname-file pathname-replace-directory pathname-strip-extension))
    1513(import (only (chicken process) system))
    1614(import (only (chicken process-context) argv))
    1715(import (only (chicken format) format))
     16(import (only (chicken file) file-exists? find-files))
     17(import (only (chicken irregex) irregex irregex-match?))
    1818
    19 (define (test-filename test-name)
    20   (string-append test-name "-test") )
     19(define *args* (argv))
    2120
    2221(define (egg-name args #!optional (def EGG-NAME))
    2322  (cond
    24     ((<= 4 (length *args*))
    25       (cadddr *args*) )
    26     (def
    27       def )
     23    ((<= 4 (length *args*)) (cadddr *args*) )
     24    (def                    def )
    2825    (else
    29       (error 'test "cannot determine egg-name") ) ) )
    30 
    31 ;;
    32 
    33 (define *args* (argv))
    34 (define *egg* (egg-name *args*))
    35 (define *tests* `(,*egg*))
     26      (error 'run "cannot determine egg-name") ) ) )
    3627
    3728(define *current-directory* (cond-expand (unix "./") (else #f)))
     29(define *egg* (egg-name *args*))
    3830
    3931;no -disable-interrupts or -no-lambda-info
    4032(define *csc-options* "-inline-global -local -inline \
    4133  -specialize -optimize-leaf-routines -clustering -lfa2 \
    42   -no-trace -unsafe")
     34  -no-trace -unsafe \
     35  -strict-types")
    4336
    44 (define (run-test-evaluated test-name test-source)
    45   (format #t "*** ~A - csi ***~%" test-name)
    46   (system (string-append "csi -s " test-source)) )
     37(define *test-files-rx* (irregex '(: (+ graph) #\- "test" #\. "scm")))
     38(define (test-filename name) (string-append name "-test"))
     39(define (test-files) (find-files "." #:test *test-files-rx* #:limit 1))
    4740
    48 (define (run-test-compiled test-name test-source csc-options)
    49   (format #t "*** ~A - csc ~A ***~%" test-name csc-options)
     41(define (ensure-test-source-name name)
     42  (if (irregex-match? *test-files-rx* name)
     43    name
     44    (make-pathname *current-directory* (test-filename name) "scm") ) )
     45
     46(define (run-test-evaluated source)
     47  (format #t "*** ~A - csi ***~%" (pathname-file source))
     48  (system (string-append "csi -s " source)) )
     49
     50(define (run-test-compiled source csc-options)
     51  (format #t "*** ~A - csc ~A ***~%" (pathname-file source) csc-options)
    5052  ;csc output is in current directory
    51   (system (string-append "csc" " " csc-options " " test-source))
    52   (system (make-pathname *current-directory* (test-filename test-name))) )
     53  (system (string-append "csc" " " csc-options " " source))
     54  (system (pathname-replace-directory (pathname-strip-extension source) *current-directory*)) )
    5355
    5456;;;
    5557
    56 (define (run-test #!optional (test-name *egg*) (csc-options *csc-options*))
    57   (let ((test-source (make-pathname #f (test-filename test-name) "scm")))
    58     (run-test-evaluated test-name test-source)
     58(define (run-test #!optional (name *egg*) (csc-options *csc-options*))
     59  (let (
     60    (source (ensure-test-source-name name)) )
     61    (unless (file-exists? source)
     62      (error 'run "no such file" source) )
     63    (run-test-evaluated source)
    5964    (newline)
    60     (run-test-compiled test-name test-source csc-options) ) )
     65    (run-test-compiled source csc-options) ) )
    6166
    62 (define (run-tests #!optional (test-names *tests*) (csc-options *csc-options*))
    63   (for-each (cut run-test <> csc-options) test-names) )
     67(define (run-tests #!optional (tests (test-files)) (csc-options *csc-options*))
     68  (for-each (cut run-test <> csc-options) tests) )
    6469
    6570;;; Do Test
Note: See TracChangeset for help on using the changeset viewer.