Skip to content

Optionally reduce test transcript verbosity with {include:silent} - #29

Open
stormi wants to merge 3 commits into
erkyrath:masterfrom
stormi:silent-includes
Open

Optionally reduce test transcript verbosity with {include:silent}#29
stormi wants to merge 3 commits into
erkyrath:masterfrom
stormi:silent-includes

Conversation

@stormi

@stormi stormi commented Aug 2, 2026

Copy link
Copy Markdown

This PR is stacked on top of #27 to avoid merge conflicts. Thus, ignore the first commit during the review.

Almost all my tests begin with >{include} (directly or via a precommand), which comes with an enormous amount of setup commands and output in verbose mode, drowning the useful test output under tons of repeated output.

To solve this, I have added support for adding :silent to the {include} command. This replaces the output (commands + game output) with just one line such as: [silently included: _to_chambre]. The full output is however displayed with -vv. The checks in silenced tests are still executed.

This is what the second commit is about.

After this change, I also noticed that I still had the initial output of the game in the test output. So, assuming that someone using silent include would want this, when the first command in a test is a silenced command, the game startup is also automatically silenced (third commit).

I've been using this for a few days and this is really useful to me in my workflow, where I review and store transcripts resulting from the execution of the tests, so that we may detect any unexpected changes in them, even for strings that are not directly tested with regtest's checks.

stormi added 3 commits July 26, 2026 10:33
Add support for including another test file at a point in the current
test file with ** include: file.t

The included file is parsed recursively — its tests, directives, and
nested includes take effect as if pasted inline at the ** include:
line. Paths are resolved relative to the including file's directory.

Multiple ** include: lines are needed to include several files; each
line includes exactly one file.

- Circular include chains are detected and raise an error with the
  full cycle path (e.g. A -> B -> C -> A)
- Duplicate test names across files raise an error showing both
  source files
- All directives follow the same rules: ** game: overrides,
  ** precommand: appends, etc.
>{include:silent} TESTNAME runs the included test's commands as usual but
keeps their output out of the verbose transcript, in order to avoid repetition
in the test transcripts.
The included test's checks still run, and their failures are still reported.
Pass -vv to see everything anyway.

In -v mode a marker line, [silently included: TESTNAME], is printed in
place of the hidden block, so the transcript still shows where the
included test ran.

Signed-off-by: Samuel Verschelde <stormi-git@ylix.fr>
When the first thing a test does is silenced, whatever runs before it is
setup you have already seen too: the game's initial output, and any
precommands ahead of it. Those are now hidden as well, so the transcript
of each test begins where the test itself does.

A test starts silently when its first command is >{include:silent}, when
it plainly includes a wrapper test which itself starts silently, or when
the silent include is a precommand, in which case it is the first thing
every test in the file does.
@stormi stormi changed the title Reduce test transcript verbosity with {include:silent} Optionally reduce test transcript verbosity with {include:silent} Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant