[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trigger action at exit?
From: |
Neil Jerram |
Subject: |
Re: Trigger action at exit? |
Date: |
Wed, 05 Mar 2008 21:14:49 +0000 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
address@hidden (Ludovic Courtès) 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 (= (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
Re: Trigger action at exit?, John Trammell, 2008/03/03