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

Re: [PATCH 4/5] test: improve rebase -q test

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2013, 17:05 UTC
Message-ID
<7vvc6311dr.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1369745671-22418-5-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 18 quoted lines
> Let's show the output so it's clear why it failed.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  t/t3400-rebase.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
> index b58fa1a..fb39531 100755
> --- a/t/t3400-rebase.sh
> +++ b/t/t3400-rebase.sh
> @@ -185,6 +185,7 @@ test_expect_success 'default to @{upstream} when upstream arg is missing' '
>  test_expect_success 'rebase -q is quiet' '
>  	git checkout -b quiet topic &&
>  	git rebase -q master >output.out 2>&1 &&
> +	cat output.out &&
>  	test ! -s output.out
>  '

It is one thing to avoid squelching output that naturally comes out of command being tested unnecessarily, so that "./txxxx-*.sh -v" output can be used for debugging. I however am not sure if adding "cat" to random places like this is a productive direction for us to go in.

A more preferrable alternative may be adding something like this to test-lib.sh and call it from here and elsewhere (there are about 50 places that do "test ! -s <filename>"), perhaps?

        test_must_be_an_empty_file () {
                if test -s "$1"
                then
                        cat "$1"
                        false
                fi
        }
Previous: Felipe ContrerasNext: Jonathan Nieder
Message 7 of 13 in “Trivial patches”
  1. 0/5 Trivial patchesFelipe Contreras, May 28, 2013
  2. 1/5 remote: trivial style cleanupFelipe Contreras, May 28, 2013
  3. Junio C HamanoMay 28, 2013
  4. 2/5 sequencer: trivial fixFelipe Contreras, May 28, 2013
  5. 3/5 test: trivial cleanupsFelipe Contreras, May 28, 2013
  6. 4/5 test: improve rebase -q testFelipe Contreras, May 28, 2013
  7. Junio C HamanoMay 28, 2013
  8. Jonathan NiederMay 28, 2013
  9. Junio C HamanoMay 28, 2013
  10. Felipe ContrerasMay 29, 2013
  11. Junio C HamanoMay 29, 2013
  12. Felipe ContrerasMay 29, 2013
  13. 5/5 test: rebase: fix --interactive testFelipe Contreras, May 28, 2013

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.