guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-4-82-g440


From: Neil Jerram
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-4-82-g440ae51
Date: Wed, 04 Nov 2009 00:01:03 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=440ae5103545726b31985b9a7d0d7dc3931c240d

The branch, master has been updated
       via  440ae5103545726b31985b9a7d0d7dc3931c240d (commit)
      from  9084db993e36b0e97e1669c030d42bf25b68c2a7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 440ae5103545726b31985b9a7d0d7dc3931c240d
Author: Neil Jerram <address@hidden>
Date:   Tue Nov 3 21:51:28 2009 +0000

    Fill code coverage holes in continuations.c and keywords.c
    
    * test-suite/Makefile.am (SCM_TESTS): Add tests/keywords.test.
    
    * test-suite/standalone/Makefile.am (test-loose-ends): New test.
    
    * test-suite/standalone/test-loose-ends.c: New file.
    
    * test-suite/tests/continuations.test: Three new tests.
    
    * test-suite/tests/keywords.test: New file.

-----------------------------------------------------------------------

Summary of changes:
 test-suite/Makefile.am                             |    1 +
 test-suite/standalone/Makefile.am                  |    7 ++++
 .../standalone/{test-list.c => test-loose-ends.c}  |   37 +++++++------------
 test-suite/tests/continuations.test                |   28 +++++++++++++++
 test-suite/tests/{receive.test => keywords.test}   |   25 ++++++-------
 5 files changed, 62 insertions(+), 36 deletions(-)
 copy test-suite/standalone/{test-list.c => test-loose-ends.c} (61%)
 copy test-suite/tests/{receive.test => keywords.test} (67%)

diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
index 145975c..d08aab7 100644
--- a/test-suite/Makefile.am
+++ b/test-suite/Makefile.am
@@ -48,6 +48,7 @@ SCM_TESTS = tests/alist.test                  \
            tests/i18n.test                     \
            tests/import.test                   \
            tests/interp.test                   \
+           tests/keywords.test                 \
            tests/list.test                     \
            tests/load.test                     \
            tests/modules.test                  \
diff --git a/test-suite/standalone/Makefile.am 
b/test-suite/standalone/Makefile.am
index 1b0d9d6..17ac1e7 100644
--- a/test-suite/standalone/Makefile.am
+++ b/test-suite/standalone/Makefile.am
@@ -107,6 +107,13 @@ test_conversion_LDADD = 
${top_builddir}/libguile/libguile.la
 check_PROGRAMS += test-conversion
 TESTS += test-conversion
 
+# test-loose-ends
+test_loose_ends_SOURCES = test-loose-ends.c
+test_loose_ends_CFLAGS = ${test_cflags}
+test_loose_ends_LDADD = ${top_builddir}/libguile/libguile.la
+check_PROGRAMS += test-loose-ends
+TESTS += test-loose-ends
+
 # test-fast-slot-ref
 check_SCRIPTS += test-fast-slot-ref
 TESTS += test-fast-slot-ref
diff --git a/test-suite/standalone/test-list.c 
b/test-suite/standalone/test-loose-ends.c
similarity index 61%
copy from test-suite/standalone/test-list.c
copy to test-suite/standalone/test-loose-ends.c
index 8244634..2fdbe7d 100644
--- a/test-suite/standalone/test-list.c
+++ b/test-suite/standalone/test-loose-ends.c
@@ -1,6 +1,9 @@
-/* test-list.c - exercise libguile/list.c functions */
+/* test-loose-ends.c
+ *
+ * Test items of the Guile C API that aren't covered by any other tests.
+ */
 
-/* Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2009 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -18,7 +21,7 @@
  * 02110-1301 USA
  */
 
-#ifndef HAVE_CONFIG_H
+#if HAVE_CONFIG_H
 # include <config.h>
 #endif
 
@@ -28,33 +31,21 @@
 #include <assert.h>
 #include <string.h>
 
-/* pretty trivial, but ensure this entrypoint exists, since it was
-   documented in Guile 1.6 and earlier */
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+
 static void
-test_scm_list (void)
+test_scm_from_locale_keywordn ()
 {
-  {
-    if (! scm_is_eq (SCM_EOL, scm_list (SCM_EOL)))
-      {
-        fprintf (stderr, "fail: scm_list SCM_EOL\n");
-        exit (1);
-      }
-  }
-
-  {
-    SCM lst = scm_list_2 (scm_from_int (1), scm_from_int (2));
-    if (! scm_is_true (scm_equal_p (lst, scm_list (lst))))
-      {
-        fprintf (stderr, "fail: scm_list '(1 2)\n");
-        exit (1);
-      }
-  }
+  SCM kw = scm_from_locale_keywordn ("thusly", 4);
+  assert (scm_is_true (scm_keyword_p (kw)));
 }
 
 static void
 tests (void *data, int argc, char **argv)
 {
-  test_scm_list ();
+  test_scm_from_locale_keywordn ();
 }
 
 int
diff --git a/test-suite/tests/continuations.test 
b/test-suite/tests/continuations.test
index 20a7a5a..d96274e 100644
--- a/test-suite/tests/continuations.test
+++ b/test-suite/tests/continuations.test
@@ -52,6 +52,34 @@
   (pass-if "throwing to a rewound catch context"
     (eq? (dont-crash-please) 'no-reentry))
 
+  (pass-if "can print a continuation"
+    (let ((s (with-output-to-string
+              (lambda ()
+                (call-with-current-continuation write)))))
+      (string=? "#<continuation " (substring s 0 15))))
+
+  (pass-if "blocked attempt to cross a continuation barrier"
+    (call-with-current-continuation
+     (lambda (k)
+       (with-continuation-barrier
+       (lambda ()
+         (catch 'misc-error
+                (lambda ()
+                  (k 1)
+                  #f)
+                (lambda _
+                  #t)))))))
+
+  (pass-if "uncaught exception is handled by continuation barrier"
+    (let* ((handled #f)
+          (s (with-error-to-string
+              (lambda ()
+                (set! handled
+                      (not (with-continuation-barrier
+                            (lambda ()
+                              (error "Catch me if you can!")))))))))
+      handled))
+
   (with-debugging-evaluator
 
     (pass-if "make a stack from a continuation"
diff --git a/test-suite/tests/receive.test b/test-suite/tests/keywords.test
similarity index 67%
copy from test-suite/tests/receive.test
copy to test-suite/tests/keywords.test
index 3fb4abe..78053ad 100644
--- a/test-suite/tests/receive.test
+++ b/test-suite/tests/keywords.test
@@ -1,6 +1,6 @@
-;;;; receive.test --- Test suite for Guile receive module. -*- scheme -*-
+;;;; keywords.test --- Keywords                  -*- Scheme -*-
 ;;;;
-;;;; Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2009 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -16,16 +16,15 @@
 ;;;; License along with this library; if not, write to the Free Software
 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA
 
-(define-module (test-suite test-receive)
-  #:use-module (test-suite lib)
-  #:use-module (ice-9 receive))
+(define-module (test-keywords)
+  :use-module (test-suite lib))
 
-;;;
-;;; receive
-;;;
+
+(with-test-prefix "keywords"
+  (pass-if "printing"
+    (string=? (with-output-to-string (lambda () (write #:this)))
+             "#:this")))
 
-(with-test-prefix "receive"
-
-  (pass-if "cond-expand srfi-8"
-    (cond-expand (srfi-8 #t)
-                (else   #f))))
+;;; Local Variables:
+;;; coding: latin-1
+;;; End:


hooks/post-receive
-- 
GNU Guile




reply via email to

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