Thread (18 messages) flat view 18 messages, 3 authors, 2018-03-05

Re: [PATCH 01/11] t: prevent '-x' tracing from interfering with test helpers' stderr

From: SZEDER Gábor <hidden>
Date: 2018-02-24 12:19:15

On Sat, Feb 24, 2018 at 12:39 AM, SZEDER Gábor [off-list ref] wrote:
  - Duplicate stderr of the tested command executed in the test helper
    function from the function's fd 7 (see next point), to ensure that
    the tested command's error messages go to a different fd than the
    '-x' trace of the commands executed in the function.

  - Duplicate the test helper function's fd 7 from the function's
    original stderr, meaning that, after taking a detour through fd 7,
    the error messages of the tested command do end up on the
    function's original stderr.
quoted hunk ↗ jump to hunk
diff --git a/t/lib-terminal.sh b/t/lib-terminal.sh
index cd220e378e..b3acb4c6f8 100644
--- a/t/lib-terminal.sh
+++ b/t/lib-terminal.sh
@@ -9,8 +9,8 @@ test_terminal () {
                echo >&4 "test_terminal: need to declare TTY prerequisite"
                return 127
        fi
-       perl "$TEST_DIRECTORY"/test-terminal.perl "$@"
-}
+       perl "$TEST_DIRECTORY"/test-terminal.perl "$@" 2>&9
+} 9>&2 2>&4
Oops, these should duplicate from/to fd 7, not fd 9.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help