mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 22:59:16 +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)
|
(import (chibi) (chibi ast) (chibi match)
|
||||||
(chibi process) (chibi filesystem) (chibi test))
|
(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")
|
(test-begin "ffi")
|
||||||
|
|
||||||
(define-syntax test-ffi
|
(define-syntax test-ffi
|
||||||
|
@ -30,12 +39,12 @@
|
||||||
(load lib-file)
|
(load lib-file)
|
||||||
tests ...
|
tests ...
|
||||||
;; on any failure leave the stub and c file for reference
|
;; on any failure leave the stub and c file for reference
|
||||||
(protect (exn (else #f))
|
|
||||||
(cond
|
(cond
|
||||||
((= orig-failures (test-failure-count))
|
((= orig-failures (test-failure-count))
|
||||||
(delete-file stub-file)
|
(delete-file stub-file)
|
||||||
(delete-file c-file)))
|
(delete-file c-file)))
|
||||||
(delete-file lib-file))))
|
(delete-file lib-file)
|
||||||
|
(trash-shared-object! lib-file)))
|
||||||
(else
|
(else
|
||||||
(test-assert (string-append "couldn't compile " name)
|
(test-assert (string-append "couldn't compile " name)
|
||||||
#f))))))))
|
#f))))))))
|
||||||
|
@ -479,4 +488,5 @@ void complex_imag_set(struct VirtComplex* c, double y) {
|
||||||
|
|
||||||
;; TODO: virtual method accessors
|
;; TODO: virtual method accessors
|
||||||
|
|
||||||
|
(cleanup-shared-objects!)
|
||||||
(test-end)
|
(test-end)
|
||||||
|
|
Loading…
Add table
Reference in a new issue