mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
patch from okuoku fixing ffi tests on cygwin
This commit is contained in:
parent
9a9202716c
commit
c6ffc27959
1 changed files with 16 additions and 6 deletions
|
@ -2,6 +2,15 @@
|
|||
(import (chibi) (chibi ast) (chibi match)
|
||||
(chibi process) (chibi filesystem) (chibi test))
|
||||
|
||||
(define generated-shared-objects '())
|
||||
|
||||
(define (trash-shared-object! file)
|
||||
(set! generated-shared-objects (cons file generated-shared-objects)))
|
||||
|
||||
(define (cleanup-shared-objects!)
|
||||
(for-each (lambda (file) (protect (exn (else #f)) (delete-file file)))
|
||||
generated-shared-objects))
|
||||
|
||||
(test-begin "ffi")
|
||||
|
||||
(define-syntax test-ffi
|
||||
|
@ -30,12 +39,12 @@
|
|||
(load lib-file)
|
||||
tests ...
|
||||
;; on any failure leave the stub and c file for reference
|
||||
(protect (exn (else #f))
|
||||
(cond
|
||||
((= orig-failures (test-failure-count))
|
||||
(delete-file stub-file)
|
||||
(delete-file c-file)))
|
||||
(delete-file lib-file))))
|
||||
(cond
|
||||
((= orig-failures (test-failure-count))
|
||||
(delete-file stub-file)
|
||||
(delete-file c-file)))
|
||||
(delete-file lib-file)
|
||||
(trash-shared-object! lib-file)))
|
||||
(else
|
||||
(test-assert (string-append "couldn't compile " name)
|
||||
#f))))))))
|
||||
|
@ -479,4 +488,5 @@ void complex_imag_set(struct VirtComplex* c, double y) {
|
|||
|
||||
;; TODO: virtual method accessors
|
||||
|
||||
(cleanup-shared-objects!)
|
||||
(test-end)
|
||||
|
|
Loading…
Add table
Reference in a new issue