Changeset 34572 in project


Ignore:
Timestamp:
09/18/17 20:58:09 (3 months ago)
Author:
kon
Message:

add compiled test

Location:
release/4/thread-utils/trunk/tests
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/thread-utils/trunk/tests/run.scm

    r34568 r34572  
    1 (use test)
    2 (use thread-utils)
    3 (use srfi-18)
    41
    5 (test-group "thread-timeout"
    6   (test-assert "timeout? #f" (thread-timeout? #f))
    7   (test-assert "timeout? time" (thread-timeout? (current-time)))
    8   (test-assert "timeout? #" (thread-timeout? 5))
    9   (test-assert "timeout? X" (not (thread-timeout? 'X)))
    10   (test #f (make-thread-timeout #f))
    11   (let ((t (current-time)))
    12     (test "time (base ignored)" t (make-thread-timeout t 27)) )
    13   (let* ((b (current-time))
    14          (t (make-thread-timeout 5 b)) )
    15     (test "# w/ time base" (+ 5 (time->seconds b)) (time->seconds t)) )
    16   (let* ((b 5)
    17          (t (make-thread-timeout 5 b)) )
    18     (test "# w/ # base" (+ 5 b) (inexact->exact (time->seconds t))) )
    19   (test-error "bad offset" (make-thread-timeout ""))
    20   (test-error "bad base" (make-thread-timeout 5 ""))
    21 )
     2(print "*** csi ***")
     3(system "csi -s thread-utils-test.scm")
    224
    23 ;;
    24 
    25 (test-group "thread-... access"
    26   (let (
    27       (thgs (list
    28         thread-thunk
    29         thread-result-list
    30         thread-block-timeout
    31         thread-state-buffer
    32         ;thread-name
    33         ;thread-end-exception
    34         thread-owned-mutexes
    35         ;thread-quantum
    36         ;thread-specific
    37         thread-block-object
    38         thread-recipients
    39         thread-dynamic-winds
    40         thread-standard-input
    41         thread-standard-output
    42         thread-standard-error
    43         thread-default-exception-handler
    44         thread-current-parameter-vector
    45         thread-block-object-of-recipient?) )
    46       (th
    47         (make-thread (lambda () (void))) ) )
    48     (for-each
    49       (lambda (x)
    50         (test-assert (not (eq? (void) (x th)))) )
    51       thgs)
    52     (test-assert (thread-end-exception th))
    53   )
    54 )
    55 
    56 ;FIXME needs MORE tests
    57 
    58 (test-exit)
     5;no -disable-interrupts
     6(define *csc-options* "-inline-global -scrutinize -optimize-leaf-routines -local -inline -specialize -unsafe -no-trace -no-lambda-info -clustering -lfa2")
     7(print "*** csc (" *csc-options* ") ***")
     8(system (string-append "csc" " " *csc-options* " " "thread-utils-test.scm"))
     9(system "./thread-utils-test")
Note: See TracChangeset for help on using the changeset viewer.