gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 143/324: tests: Extract conservative-gc? in a library.


From: gnunet
Subject: [gnunet-scheme] 143/324: tests: Extract conservative-gc? in a library.
Date: Tue, 21 Sep 2021 13:23:03 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 4d53689bb6661162d4d6ab0cc44fdc7c400fd53c
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Thu Jun 17 22:25:40 2021 +0200

    tests: Extract conservative-gc? in a library.
    
    It will be used for testing the message queue code.
    
    * tests/envelope.scm (conservative-gc?): Move variable to ...
    * tests/utils.scm (conservative-gc?): ... here, and thunk it.
---
 tests/envelope.scm | 13 ++-----------
 tests/utils.scm    | 29 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/tests/envelope.scm b/tests/envelope.scm
index 3444df0..c49c691 100644
--- a/tests/envelope.scm
+++ b/tests/envelope.scm
@@ -20,6 +20,7 @@
             (srfi srfi-26)
             ((rnrs base) #:select (assert))
             ((rnrs conditions) #:select (&assertion))
+            (tests utils) ; for conservative-gc?
             (gnu gnunet mq envelope)
             (gnu gnunet mq prio-prefs)
             (gnu gnunet mq prio-prefs2))
@@ -247,16 +248,6 @@
 ;; to the notify-sent, cancel and message are dropped
 ;; when the message is marked as sent.
 
-;; Current versions of guile (at least 3.0.5) use a conservative
-;; garbage collector, so these tests might sometimes fail without
-;; indicating a bug. For reprodicible builds, allow skipping these
-;; tests.
-
-(define conservative-gc?
-  (if (equal? "yes" (getenv "TOLERATE_CONSERVATIVE_COLLECTORS"))
-      #t
-      #f))
-
 (test-begin "gc")
 
 ;; Compilation of the source code of this test file
@@ -267,7 +258,7 @@
 
 (define (do-nothing) 'nothing)
 
-(test-skip (if conservative-gc? 4 0))
+(test-skip (if (conservative-gc?) 4 0))
 
 (test-equal "references dropped after cancel"
   '(#t #t #t)
diff --git a/tests/utils.scm b/tests/utils.scm
new file mode 100644
index 0000000..e6ba993
--- /dev/null
+++ b/tests/utils.scm
@@ -0,0 +1,29 @@
+;; This file is part of scheme-GNUnet.
+;; Copyright (C) 2021 Maxime Devos
+;;
+;; scheme-GNUnet is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU Affero General Public License as published
+;; by the Free Software Foundation, either version 3 of the License,
+;; or (at your option) any later version.
+;;
+;; scheme-GNUnet is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; Affero General Public License for more details.
+;;
+;; You should have received a copy of the GNU Affero General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;
+;; SPDX-License-Identifier: AGPL3.0-or-later
+(define-module (tests utils)
+  #:export (conservative-gc?))
+
+;; Current versions of guile (at least 3.0.5) use a conservative
+;; garbage collector, so some tests concerning garbage collection
+;; might sometimes fail without indicating a bug. For reprodicible
+;; builds, allow skipping these tests.
+
+(define (conservative-gc?)
+  (if (equal? "yes" (getenv "TOLERATE_CONSERVATIVE_COLLECTORS"))
+      #t
+      #f))

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]