git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/3] test-lib-functions.sh: add a test_with_columns function

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Aug 2, 2021, 17:14 UTC
Message-ID
<20210802171429.GC23408@szeder.dev>
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.
Show 16 quoted lines
> 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).

Previous: Ævar Arnfjörð BjarmasonNext: Eric Sunshine
Message 21 of 26 in “progress test failure on fedora34”
  1. Fabian StelzerJul 14, 2021
  2. Ævar Arnfjörð BjarmasonJul 14, 2021
  3. Alex HenrieJul 14, 2021
  4. Ævar Arnfjörð BjarmasonJul 18, 2021
  5. Jeff KingJul 19, 2021
  6. Alex HenrieJul 19, 2021
  7. Alex HenrieJul 19, 2021
  8. Felipe ContrerasJul 19, 2021
  9. Felipe ContrerasJul 19, 2021
  10. Alex HenrieJul 19, 2021
  11. Felipe ContrerasJul 20, 2021
  12. ZheNing HuJul 21, 2021
  13. Felipe ContrerasJul 21, 2021
  14. test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Jul 26, 2021
  15. Jeff KingJul 27, 2021
  16. Junio C HamanoJul 28, 2021
  17. 0/3 test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Aug 2, 2021
  18. 1/3 test-lib-functions.sh: rename test_must_fail_acceptable()Ævar Arnfjörð Bjarmason, Aug 2, 2021
  19. 3/3 test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Aug 2, 2021
  20. 2/3 test-lib-functions.sh: add a test_with_columns functionÆvar Arnfjörð Bjarmason, Aug 2, 2021
  21. SZEDER GáborAug 2, 2021
  22. Eric SunshineAug 2, 2021
  23. 0/3 test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Aug 4, 2021
  24. 1/3 test-lib-functions.sh: rename test_must_fail_acceptable()Ævar Arnfjörð Bjarmason, Aug 4, 2021
  25. 3/3 test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Aug 4, 2021
  26. 2/3 test-lib-functions.sh: add a test_with_columns functionÆvar Arnfjörð Bjarmason, Aug 4, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.