Subject: Re: [PATCH v3 3/3] test-lib: make BAIL_OUT() work in tests and prereq

From: Junio C Hamano <[email-masked]>
Date: Fri, 26 Nov 2021 13:02:35 -0800

Fabian Stelzer <[email-masked]> writes:

>>In any case, the comment in front of the block of exec wants to
>>become a bit more detailed than just "# Set up additional fds", with
>>an explanation about which FD is used for what.
>>
>
> How about:
>
> # Set up additional fds to allow i/o with the surrounding test
> # harness when redirecting individual test i/o in test_eval_

This does not quite say how "setting up additional fds" helpss the
test harness, though.  And this ...

> # fd 5 -> stdout
> # fd 6 <- stdin
> # fd 7 -> stderr

... is literal translation of what is written below, without adding
any new information.

> exec 5>&1
> exec 6<&0
> exec 7>&2

I was expecting something along the lines of ...

# What is written by tests to their FD #1 and #2 are sent to
# different places depending on the test mode (e.g. /dev/null in
# non-verbose mode, piped to tee with --tee option, etc.)  Original
# FD #1 and #2 are saved away to #5 and #7, so that test framework
# can use them to send the output to these low FDs before the
# mode-specific redirection.

... but this only talks about the output side.  The final version
needs to mention the input side, too.

Thanks.