Changeset 5095 in project


Ignore:
Timestamp:
07/15/07 22:55:21 (12 years ago)
Author:
kon
Message:

Changed to chicken-setup tests directory structure.

Location:
url
Files:
3 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • url/setup-header.scm

    r4212 r5095  
    88(define REPOSITORY-DIRECTORY (repository-path))
    99
     10(define *version* (if (file-exists? "version") (string-chomp (read-all "version") "\n") "trunk"))
     11
    1012;; These must be kept in synch w/ testbase-results.scm!
    1113
    1214(define TESTBASE-DIRECTORY (make-pathname REPOSITORY-DIRECTORY "testbase"))
    13 (define TESTBASE-TESTS-DIRECTORY (make-pathname TESTBASE-DIRECTORY "tests"))
    1415
    1516(define (->symbol obj)
     
    3031  (make-filename bn ##sys#load-dynamic-extension) )
    3132
     33(define (make-static-filename bn)
     34  (make-filename bn "o") )
     35
    3236(define (make-source-filename bn)
    3337  (make-filename bn "scm") )
     
    4751;;
    4852
     53#;
    4954(define (installed-program-exists? bn)
    5055  (or (file-exists? (make-program-pathname (program-path) bn))
     
    6469
    6570(define (copy-file-to-test-repository fn)
    66   (*file-copy (->string fn) TESTBASE-TESTS-DIRECTORY) )
    67 
    68 ;; Install & Run Test(s)
    69 
    70 (define-constant TESTBASE-TEST-DRIVER "chicken-testbase-driver")
    71 (define-constant TESTBASE-TEST-DRIVER-OPTIONS "--indent 2")
    72 
    73 (define test-driver-arguments
    74   (make-parameter
    75     (string-append TESTBASE-TEST-DRIVER-OPTIONS (if (setup-verbose-flag) " -v" ""))
    76     (lambda (x) (if (string? x) x (test-driver-arguments)))))
     71  (*file-copy (->string fn) TESTBASE-DIRECTORY) )
     72
     73(define (copy-testbase-file bn)
     74  (copy-file-to-test-repository (make-pathname "tests" (->string bn))) )
     75
     76;; Install TestBase related file(s)
    7777
    7878(define (install-test . flnms)
    7979  (newline)
    80   (print "* Installing test files in " TESTBASE-TESTS-DIRECTORY #\:)
    81   (unless (file-exists? TESTBASE-TESTS-DIRECTORY)
    82     (create-directory TESTBASE-TESTS-DIRECTORY) )
    83   (let ([tsts
    84           (map
    85             (lambda (x)
    86               (if (list? x)
    87                 ;then has extra files (probably test data)
    88                 (begin
    89                   (for-each (cut copy-file-to-test-repository <>) x)
    90                   (car x))
    91                 ;else test is self contained
    92                 (begin
    93                   (copy-file-to-test-repository x)
    94                   x)))
    95             flnms)])
    96   (if (string>? "2.610" (chicken-version))
    97     (begin
    98       (newline)
    99       (print "* Chicken 2.610+ needed to perform testing.") )
    100     (if (installed-program-exists? TESTBASE-TEST-DRIVER)
    101       (begin
    102         (when (setup-verbose-flag)
    103           (newline)
    104           (print "* Running test files" #\:) )
    105         ; Quote driver command for Windows.
    106         ; Test filenames CANNOT include whitespace.
    107         (for-each
    108           (cute system* "\"~A\" ~A ~A" TESTBASE-TEST-DRIVER (test-driver-arguments) <>)
    109           tsts) )
    110       (begin
    111         (newline)
    112         (print "* TestBase is not installed. Cannot perform testing.") ) ) ) ) )
     80  (print "* Installing TestBase Test-Files in " TESTBASE-DIRECTORY #\:)
     81  (for-each
     82    (lambda (x)
     83      (if (list? x)
     84        ; then has extra files (probably test data)
     85        (for-each copy-testbase-file x)
     86        ; else test is self contained
     87        (copy-testbase-file x) ) )
     88    flnms) )
    11389
    11490;; Options Parsing
     
    149125;;; Operation Macros
    150126
    151 ;; Note that these can accept quasi- stuff in OPT
     127;; Note that these can accept quasi-stuff in OPT
    152128
    153129(define-macro (compile-dynld DYNFIL . OPT)
     
    167143    -o ,(make-dynld-filename OUTDYNFIL)
    168144    -check-imports -emit-exports ,(make-exports-filename OUTDYNFIL)
     145    ,@OPT) )
     146
     147(define-macro (compile-static SRCSTAFIL . OPT)
     148  `(compile
     149    -c
     150    -O2 -d1
     151    ,(make-source-filename SRCSTAFIL)
     152    -unit ,SRCSTAFIL
     153    -o ,(make-static-filename SRCSTAFIL)
     154    -check-imports -emit-exports ,(make-exports-filename SRCSTAFIL)
     155    ,@OPT) )
     156
     157(define-macro (compile-static/rename SRCSTAFIL OUTSTAFIL . OPT)
     158  `(compile
     159    -c
     160    -O2 -d1
     161    ,(make-source-filename SRCSTAFIL)
     162    -unit ,OUTSTAFIL
     163    -o ,(make-static-filename OUTSTAFIL)
     164    -check-imports -emit-exports ,(make-exports-filename OUTSTAFIL)
    169165    ,@OPT) )
    170166
  • url/url.meta

    r4086 r5095  
    77 (author "felix winkelmann")
    88 (files
    9    "url.scm" "url.setup" "url.html" "url-test.scm"
    10    "setup-header.scm") )
     9  "tests"
     10  "url.scm" "url.setup" "url.html"
     11  "setup-header.scm") )
Note: See TracChangeset for help on using the changeset viewer.