mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
leniency in the "unused modules are removed" gc.test
* libguile/foreign.h: Remove comment about the finalizer bit, as I don't think that is the case any more. * test-suite/tests/gc.test: Ignore flakiness in the gc-modules test.
This commit is contained in:
parent
7e9a301b7f
commit
52de2ab45a
2 changed files with 18 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
||||||
#ifndef SCM_FOREIGN_H
|
#ifndef SCM_FOREIGN_H
|
||||||
#define SCM_FOREIGN_H
|
#define SCM_FOREIGN_H
|
||||||
|
|
||||||
/* Copyright (C) 2010, 2011 Free Software Foundation, Inc.
|
/* Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
@ -23,8 +23,7 @@
|
||||||
|
|
||||||
/* A "foreign pointer" is a wrapped C pointer. It is represented by a
|
/* A "foreign pointer" is a wrapped C pointer. It is represented by a
|
||||||
cell whose second word is a pointer. The first word has the
|
cell whose second word is a pointer. The first word has the
|
||||||
`scm_tc7_pointer' type code and a bit saying whether it has an
|
`scm_tc7_pointer' type code.
|
||||||
associated finalizer or not.
|
|
||||||
|
|
||||||
The basic idea is that we can help the programmer to avoid cutting herself,
|
The basic idea is that we can help the programmer to avoid cutting herself,
|
||||||
but we won't take away her knives. */
|
but we won't take away her knives. */
|
||||||
|
|
|
@ -22,6 +22,16 @@
|
||||||
#:use-module ((system base compile) #:select (compile)))
|
#:use-module ((system base compile) #:select (compile)))
|
||||||
|
|
||||||
|
|
||||||
|
;; Some of these tests verify that things are collectable. As we use a
|
||||||
|
;; third-party conservative collector, we really can't guarantee that --
|
||||||
|
;; we can try, but on some platforms, on some versions (possibly), the
|
||||||
|
;; test might fail. But we don't want that to stop the build. So,
|
||||||
|
;; instead of failing, throw 'unresolved.
|
||||||
|
;;
|
||||||
|
(define (maybe-gc-flakiness result)
|
||||||
|
(or result
|
||||||
|
(throw 'unresolved)))
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; miscellaneous
|
;;; miscellaneous
|
||||||
;;;
|
;;;
|
||||||
|
@ -73,11 +83,12 @@
|
||||||
(gc) ;; thrice: because the test doesn't succeed with only
|
(gc) ;; thrice: because the test doesn't succeed with only
|
||||||
;; one gc round. not sure why.
|
;; one gc round. not sure why.
|
||||||
|
|
||||||
(= (let lp ((i 0))
|
(maybe-gc-flakiness
|
||||||
(if (guard)
|
(= (let lp ((i 0))
|
||||||
(lp (1+ i))
|
(if (guard)
|
||||||
i))
|
(lp (1+ i))
|
||||||
total)))
|
i))
|
||||||
|
total))))
|
||||||
|
|
||||||
(pass-if "Lexical vars are collectable"
|
(pass-if "Lexical vars are collectable"
|
||||||
(let ((l (compile
|
(let ((l (compile
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue