Initial commit
This commit is contained in:
commit
2f39c58d6c
27 changed files with 2969 additions and 0 deletions
28
tests.scm
Normal file
28
tests.scm
Normal file
|
@ -0,0 +1,28 @@
|
|||
(define-module (tests)
|
||||
#:use-module (ice-9 exceptions)
|
||||
#:use-module (fibers)
|
||||
#:export (run-fibers-for-tests
|
||||
assert-no-heap-growth))
|
||||
|
||||
(define (run-fibers-for-tests thunk)
|
||||
(let ((result
|
||||
(run-fibers
|
||||
(lambda ()
|
||||
(with-exception-handler
|
||||
(lambda (exn)
|
||||
exn)
|
||||
(lambda ()
|
||||
(with-throw-handler #t
|
||||
thunk
|
||||
(lambda _
|
||||
(backtrace)))
|
||||
#t)
|
||||
#:unwind? #t))
|
||||
#:hz 0
|
||||
#:parallelism 1)))
|
||||
(if (exception? result)
|
||||
(raise-exception result)
|
||||
result)))
|
||||
|
||||
(define (assert-no-heap-growth thunk)
|
||||
(thunk))
|
Loading…
Add table
Add a link
Reference in a new issue