git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"Alex Henrie" <alexhenrie24@gmail.com>,
	"Felipe Contreras" <felipe.contreras@gmail.com>,
	"Fabian Stelzer" <fabian.stelzer@campoint.net>,
	"Jeff King" <peff@peff.net>,
	"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
Subject: Re: [PATCH v2 2/3] test-lib-functions.sh: add a test_with_columns function
Date: Mon, 2 Aug 2021 19:14:29 +0200	[thread overview]
Message-ID: <20210802171429.GC23408@szeder.dev> (raw)
In-Reply-To: <patch-v2-2.3-36c57178c55-20210802T134610Z-avarab@gmail.com>

On Mon, Aug 02, 2021 at 03:46:27PM +0200, Ævar Arnfjörð Bjarmason wrote:
> Add a helper function to wrap patterns of "COLUMNS=N <command>" as
> "test_with_columns N <command>". This will be used and extended in the
> next commit.


> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
> index 37da7d9a99a..536339faaa2 100644
> --- a/t/test-lib-functions.sh
> +++ b/t/test-lib-functions.sh
> @@ -1718,3 +1718,11 @@ test_region () {
>  test_readlink () {
>  	perl -le 'print readlink($_) for @ARGV' "$@"
>  }
> +
> +# Test a with a given number of COLUMNS in the environment.
> +test_with_columns () {
> +	local columns=$1
> +	shift
> +
> +	COLUMNS=$columns "$@"
> +}

This function needs some redirections to separate the tested command's
standard error from the function's '-x' trace, see a5bf824f3b (t:
prevent '-x' tracing from interfering with test helpers' stderr,
2018-02-25).


  reply	other threads:[~2021-08-02 17:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14 12:39 progress test failure on fedora34 Fabian Stelzer
2021-07-14 15:35 ` Ævar Arnfjörð Bjarmason
2021-07-14 16:35   ` Alex Henrie
2021-07-18  8:05     ` Ævar Arnfjörð Bjarmason
2021-07-19  9:00       ` Jeff King
2021-07-19 17:18       ` Alex Henrie
2021-07-19 18:21         ` Alex Henrie
2021-07-19 18:43       ` Felipe Contreras
2021-07-19 19:34         ` Felipe Contreras
2021-07-19 20:42           ` Alex Henrie
2021-07-20  0:40             ` Felipe Contreras
2021-07-21  0:45               ` ZheNing Hu
2021-07-21  2:50                 ` Felipe Contreras
2021-07-26 23:57             ` [PATCH] test-lib.sh: use GIT_TEST_COLUMNS over COLUMNS Ævar Arnfjörð Bjarmason
2021-07-27 17:38               ` Jeff King
2021-07-28  0:53                 ` Junio C Hamano
2021-08-02 13:46               ` [PATCH v2 0/3] " Ævar Arnfjörð Bjarmason
2021-08-02 13:46                 ` [PATCH v2 1/3] test-lib-functions.sh: rename test_must_fail_acceptable() Ævar Arnfjörð Bjarmason
2021-08-02 13:46                 ` [PATCH v2 2/3] test-lib-functions.sh: add a test_with_columns function Ævar Arnfjörð Bjarmason
2021-08-02 17:14                   ` SZEDER Gábor [this message]
2021-08-02 17:24                     ` Eric Sunshine
2021-08-02 13:46                 ` [PATCH v2 3/3] test-lib.sh: use GIT_TEST_COLUMNS over COLUMNS Ævar Arnfjörð Bjarmason
2021-08-04 23:05                 ` [PATCH v3 0/3] " Ævar Arnfjörð Bjarmason
2021-08-04 23:05                   ` [PATCH v3 1/3] test-lib-functions.sh: rename test_must_fail_acceptable() Ævar Arnfjörð Bjarmason
2021-08-04 23:05                   ` [PATCH v3 2/3] test-lib-functions.sh: add a test_with_columns function Ævar Arnfjörð Bjarmason
2021-08-04 23:05                   ` [PATCH v3 3/3] test-lib.sh: use GIT_TEST_COLUMNS over COLUMNS Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210802171429.GC23408@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=alexhenrie24@gmail.com \
    --cc=avarab@gmail.com \
    --cc=fabian.stelzer@campoint.net \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=zbyszek@in.waw.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).