git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: SZEDER Gábor <szeder.dev@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH 1/2] t9400-git-cvsserver-server: don't rely on the output of 'test_cmp'
Date: Thu, 8 Mar 2018 17:01:34 -0500
Message-ID: <CAPig+cRSDbFZ_C9opu3pr=m7HwFkeuoxUD_8Yqbd4XxX-W0cHg@mail.gmail.com> (raw)
In-Reply-To: <CAM0VKjmKcFVOLA-fFnSm=tVapa5qgUoU3Sa7RjSrqoHp5qXZiw@mail.gmail.com>

On Thu, Mar 8, 2018 at 4:49 PM, SZEDER Gábor <szeder.dev@gmail.com> wrote:
> On Thu, Mar 8, 2018 at 7:51 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> An alternative approach used elsewhere in the test suite[1] would be
>> simply to 'exit' if test_cmp fails:
>>
>>     for i in merge no-lf empty really-empty; do
>>         GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out
>>         test_cmp $i.out ../$i || exit 1
>>     done &&
>
> And it's right: 'exit' terminates the shell process it's invoked in,
> i.e. the whole test script (well, unless it's invoked in a subshell)
> without executing the remaining tests and the usual housekeeping and
> reporting.
>
> Consider the following test script:
>
>   $ ./t9999-exit.sh
>   FATAL: Unexpected exit with code 1

Sorry for the confusion. I meant "return 1" as used elsewhere in the
test suite[1].

--- >8 ---
#!/bin/sh
test_description='return 1?'
. ./test-lib.sh

test_expect_success 'return 1' '
        return 1
'

test_expect_success 'second test' '
        true
'

test_done
--- >8 ---

$ ./t9977.sh
not ok 1 - return 1
#
#         return 1
#
ok 2 - second test
# failed 1 among 2 test(s)
1..2
$

[1]: For example, the "setup" test of t4151-am-abort.sh.

  reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 12:38 [PATCH 0/2] Make cvs tests pass with '-x' tracing and /bin/sh SZEDER Gábor
2018-03-08 12:38 ` [PATCH 1/2] t9400-git-cvsserver-server: don't rely on the output of 'test_cmp' SZEDER Gábor
2018-03-08 18:51   ` Eric Sunshine
2018-03-08 21:49     ` SZEDER Gábor
2018-03-08 22:01       ` Eric Sunshine [this message]
2018-03-08 22:07         ` Eric Sunshine
2018-03-08 22:38         ` SZEDER Gábor
2018-03-08 22:44         ` [PATCH v1.1 " SZEDER Gábor
2018-03-08 23:33           ` Junio C Hamano
2018-03-08 23:41             ` SZEDER Gábor
2018-03-08 23:44               ` Junio C Hamano
2018-03-09 11:20                 ` SZEDER Gábor
2018-03-08 12:38 ` [PATCH 2/2] t9402-git-cvsserver-refs: don't check the stderr of a subshell SZEDER Gábor
2018-03-13  0:05 ` [PATCH 0/2] Make cvs tests pass with '-x' tracing and /bin/sh Jeff King

Reply instructions:

You may reply publically 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAPig+cRSDbFZ_C9opu3pr=m7HwFkeuoxUD_8Yqbd4XxX-W0cHg@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.com \
    /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

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox