From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: Trigger action at exit? Date: Wed, 05 Mar 2008 21:14:49 +0000 Message-ID: <87hcfkan5i.fsf@ossau.uklinux.net> References: <68dbb6fe0802291430g42240937u1241348a85021e73@mail.gmail.com> <87ve459gxb.fsf@gnu.org> <87hcfna66r.fsf@ossau.uklinux.net> <87ve434gqj.fsf@gnu.org> <87d4qba1vs.fsf@ossau.uklinux.net> <874pbm3hw1.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1204751728 31208 80.91.229.12 (5 Mar 2008 21:15:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Mar 2008 21:15:28 +0000 (UTC) Cc: guile-user@gnu.org To: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Mar 05 22:15:54 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JX0xb-0006BX-Ll for guile-user@m.gmane.org; Wed, 05 Mar 2008 22:15:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JX0x4-0002W3-60 for guile-user@m.gmane.org; Wed, 05 Mar 2008 16:15:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JX0wz-0002Rq-IH for guile-user@gnu.org; Wed, 05 Mar 2008 16:14:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JX0wy-0002O4-0d for guile-user@gnu.org; Wed, 05 Mar 2008 16:14:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JX0wx-0002Nh-TF for guile-user@gnu.org; Wed, 05 Mar 2008 16:14:55 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JX0wu-0007S2-7p; Wed, 05 Mar 2008 16:14:52 -0500 Original-Received: from arudy (host86-145-183-175.range86-145.btcentralplus.com [86.145.183.175]) by mail3.uklinux.net (Postfix) with ESMTP id 3CF6C1F6B8E; Wed, 5 Mar 2008 21:14:51 +0000 (GMT) Original-Received: from laruns (laruns [192.168.0.10]) by arudy (Postfix) with ESMTP id 1A2643800A; Wed, 5 Mar 2008 21:14:50 +0000 (GMT) In-Reply-To: <874pbm3hw1.fsf@gnu.org> (Ludovic =?iso-8859-1?Q?Court=E8s's?= message of "Tue, 04 Mar 2008 11:25:50 +0100") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6443 Archived-At: ludo@gnu.org (Ludovic Court=E8s) writes: > At the same time, registering an `atexit' function from within the TAP > module seems inelegant: it assumes that the TAP module is used by > standalone programs only, and that exactly one Guile process is used for > each test that uses the module. If you decide to use a single process > to evaluate all the tests, the `atexit' trick no longer works. Thanks for explaining. I see what you mean now. > To me, it would look better if each test case had to insert, say, a > `(finish-test)' call at its end, even if it adds more lines. That's > roughly what happens with SRFI-64: `test-end' must be invoked and in > addition, you may want to finish your standalone scripts with something > like `(exit (=3D (test-runner-fail-count (test-runner-current)) 0))'. I have another suggestion along these lines, but I'll make that in response to the relevant email from John. > More generally, `atexit' hooks are used only for their side effects, so > the order in which they are invoked is crucial. However, it may often > be hard to know exactly in what order or when a given hook will be > called, because you don't necessarily know what hooks have been > registered. Agreed - although if a library is dealing only with its own resources, it may not matter how its atexit is ordered with those of other libraries. Regards, Neil