Hi Tomas,

Tomas Volf <[email protected]> writes:

[...]

> From 8357a98e7c0c8690be7fe2903a310a3b93b2ab8f Mon Sep 17 00:00:00 2001
> From: Tomas Volf <[email protected]>
> Date: Sun, 14 Jul 2024 13:00:14 +0200
> Subject: [PATCH 2/5] build: test-driver.scm: Output singleton metadata just
>  once.
>
> Current implementation printed metadata supposed to be present just once per
> .trs file on the end of each test group.  According to the automake's manual
> that is undefined behavior.  This commit fixes it by printing that metadata
> just once, after all tests did run.

Can you show an example of a problematic file, and where in the
documentation it says the metadata should appear only once?  Ah,
actually, I think 'make check TESTS=tests/import/elm.scm ' produces a
good example of this:

--8<---------------cut here---------------start------------->8---
# file: tests/import/elm.trs
:test-result: PASS elm->package-name [0.000s]
:test-result: PASS infer-elm-package-name [0.000s]
:global-test-result: PASS
:recheck: no
:copy-in-global-log: no
:test-result: PASS elm->package-name [0.000s]
:test-result: PASS infer-elm-package-name [0.000s]
:global-test-result: PASS
:recheck: no
:copy-in-global-log: no
:test-result: PASS elm->package-name [0.000s]
:test-result: PASS infer-elm-package-name [0.000s]
:global-test-result: PASS
:recheck: no
:copy-in-global-log: no
:test-result: PASS elm->package-name [0.000s]
:test-result: PASS infer-elm-package-name [0.000s]
:global-test-result: PASS
:recheck: no
[...]
--8<---------------cut here---------------end--------------->8---

Also, could you please reference the section of the manual which you say
says it's undefined behavior? I couldn't find it; though it does seems
unsatisfactory/problematic!

> Since there is no built-in hook that could be used for
> that (test-runner-on-final runs on *each* outermost test-end), I introduced
> new `finalize' procedure that need to be called by the user.  Possibly not the
> most elegant solution, but since we are the only user, it works fine and
> produces actually valid .trs file.

What do you mean by "test-runner-on-final runs on *each* outermost
test-end"? I don't understand how there could be more than one outermost
test-end?

> * build-aux/test-driver.scm (test-runner-gnu): Define new procedure `finalize'
> and return it together with the runner.  Do not call
> test-runner-on-group-end!.
> (main): Call the `finalize' after all tests are done.

Applied, and tested with the same example above.  It seems to work
great, thank you.

By the way, I had to come up with a small workaround for your new SRFI
64 implementation that landed in Guile 3.0.11 (now available in Guix);
see commit 5fada9a751f as well as upstream issue
<https://codeberg.org/guile/guile/issues/133>.

I still need to look into patches 4 and 5 of this submission, so I'm
leaving this open.

-- 
Thanks,
Maxim



Reply via email to