unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] test-suite: show backtrace when exception is thrown during test.
@ 2014-10-05 10:16 Jan Nieuwenhuizen
  0 siblings, 0 replies; only message in thread
From: Jan Nieuwenhuizen @ 2014-10-05 10:16 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

Hi,

I found that when code under test throws an exception, it is hidden from
the user.  The test suite niftily uses exceptions for message passing, I
wonder if this is wise (in-band signaling?).

Anyway, if an unexpected exception occurs I find it helpful to see the
backtrace.  See attached patch.

Greetings, Jan


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-test-suite-show-backtrace-when-exception-is-thrown-d.patch --]
[-- Type: text/x-diff, Size: 1132 bytes --]

From a11e28037d3d5d14d01df38f1dfae6e176bb3dd8 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 5 Oct 2014 11:42:09 +0200
Subject: [PATCH] test-suite: show backtrace when exception is thrown during
 test.

2014-10-05  Jan Nieuwenhuizen  <janneke@gnu.org>

	* test-suite/test-suite/lib.scm (run-test): Show backtrace for
	unexpected, i.e., non test-result carrying exceptions.
---
 test-suite/test-suite/lib.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test-suite/test-suite/lib.scm b/test-suite/test-suite/lib.scm
index 7bd3260..b17e910 100644
--- a/test-suite/test-suite/lib.scm
+++ b/test-suite/test-suite/lib.scm
@@ -345,7 +345,8 @@
                    (report 'unresolved test-name location)
                    (quit))
                   (else
-                   (report 'error test-name location (cons key args))))))
+                   (report 'error test-name location (cons key args))
+                   (backtrace)))))
             (set! test-running #f)))))
 
 ;;; A short form for tests that are expected to pass, taken from Greg.
-- 
/home/janneke/.signature


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-10-05 10:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-05 10:16 [PATCH] test-suite: show backtrace when exception is thrown during test Jan Nieuwenhuizen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).