git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] grep: Don't pass a TODO test if REG_STARTEND is supported
Date: Fri, 16 Jul 2010 14:33:55 +0000	[thread overview]
Message-ID: <AANLkTimZ3f550HQwx3OEpO6n1b037He6hJ6rAXP8vfIk@mail.gmail.com> (raw)
In-Reply-To: <AANLkTim-4I5Sdu653yJOmnVYDqI8bb71839Vqfd3FKCi@mail.gmail.com>

On Thu, Jul 15, 2010 at 18:44, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> On Thu, Jul 15, 2010 at 17:47, Junio C Hamano <gitster@pobox.com> wrote:
>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>>
>>> On Thu, Jul 8, 2010 at 19:40, Junio C Hamano <gitster@pobox.com> wrote:
>>>> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>>>>
>>>>> +if git grep ile a
>>>>> +then
>>>>> +     test_expect_success 'git grep ile a' 'git grep ile a'
>>>>> +else
>>>>> +     test_expect_failure 'git grep ile a' 'git grep ile a'
>>>>> +fi
>>>>
>>>> So if command "X" is known to succeed, we run it inside expect_success
>>>> and if not we run it inside expect_failure?
>>>>
>>>> What kind of idiocy is that, I have to wonder...
>>>
>>> Well, the point is to normalize the test suite so that we never have
>>> passing TODO tests if everything's OK.
>>
>> I do not consider a test that passes under some condition but doesn't
>> under some other condition "everything is OK".  Marking the test as
>> "expect failure" as René originally did makes a lot of sense to me.
>>
>> The quoted patch is even worse as it will _actively_ prevent you from
>> catching a new error you just introduced while futzing "git grep" on a
>> platform that used to work.  Your "if" statement will say "ah, grep is
>> broken", and you will use expect-failure, not because your platform does
>> not support REG_STARTEND, but because you broke "git grep".
>>
>> The point of having tests is to help you catch your bugs while you
>> develop.  A test that turns itself off when the feature it is testing is
>> broken helps nobody.
>>
>> So forget about "passing TODO tests", whatever a "TODO test" is.  The
>> change in question is actively _wrong_.
>
> I was under the impression that REG_STARTEND was considered purely
> icing on the cake, i.e. that the tests should be passing whether or
> not it was present.
>
> I guess my reasoning at the time was that if that wasn't the case,
> reporting an unexpected pass by default, as opposed to a failing TODO
> on platforms without REG_STARTEND. Since only TAP will report this, I
> thought that was just an omission.
>
> Anyway, since REG_STARTEND *isn't* obviously considered icing you're
> of course right, but the test is still broken as-is. Now it reports an
> abnormal condition if REG_STARTEND is present (passing TODO test), it
> should instead have a failing TODO test where REG_STARTEND isn't
> present. I'll come up with a patch to fix that.

Well to clarify: The TAP is arguably right, although semantically
these sort of tests should probably be a SKIP on unsupported
platforms, not a passing TODO.

prove(1) also features passing TODO tests a bit too prominently for my
tastes. I've filed a bug for that:
https://rt.cpan.org/Public/Bug/Display.html?id=59428

> We should also just upgrade the GNU regex library in compat/regex to
> the version that supports REG_STARTEND. Unfortunately that seems
> easier said than done, since the library is now part of glibc, and has
> aquired a lot of glibc specific macros and other constructs that would
> need to be #defined away or otherwise worked around.

This is what we should be focusing on, the patch by Jonathan Nieder is
a good start.

  parent reply	other threads:[~2010-07-16 14:34 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-08  0:42 [PATCH] grep: Don't pass a TODO test if REG_STARTEND is supported Ævar Arnfjörð Bjarmason
2010-07-08 19:40 ` Junio C Hamano
2010-07-08 20:09   ` Ævar Arnfjörð Bjarmason
2010-07-08 21:58     ` René Scharfe
2010-07-15 15:32       ` Ævar Arnfjörð Bjarmason
2010-07-15 17:47     ` Junio C Hamano
2010-07-15 18:44       ` Ævar Arnfjörð Bjarmason
     [not found]         ` <20100715220059.GA3312@burratino>
2010-07-16 13:58           ` [RFC/PATCH] Update compat/regex Ævar Arnfjörð Bjarmason
2010-07-16 14:17             ` Andreas Schwab
2010-08-15 11:08               ` Ævar Arnfjörð Bjarmason
2010-08-16 12:26                 ` Paolo Bonzini
2010-08-17  3:25                 ` [PATCH/RFC 0/3] " Ævar Arnfjörð Bjarmason
2010-08-17  3:25                 ` [PATCH/RFC 2/3] compat/regex: hacks to get the gawk regex engine to compile within git Ævar Arnfjörð Bjarmason
2010-08-17  3:35                   ` Jonathan Nieder
2010-08-17  3:25                 ` [PATCH/RFC 3/3] t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTEND Ævar Arnfjörð Bjarmason
     [not found]                 ` <1282015548-19074-2-git-send-email-avarab@gmail.com>
2010-08-17  3:37                   ` [PATCH/RFC 1/3] compat/regex: use the regex engine from gawk for compat Jonathan Nieder
2010-08-17  3:50                     ` Ævar Arnfjörð Bjarmason
2010-08-17  4:08                       ` Jonathan Nieder
2010-08-17  5:17                 ` [PATCH/RFC v2 0/3] Update compat/regex Ævar Arnfjörð Bjarmason
2010-08-17  8:03                   ` Jonathan Nieder
2010-08-17  9:24                     ` [PATCH 0/5] " Ævar Arnfjörð Bjarmason
2010-08-17 11:46                       ` Paolo Bonzini
2010-08-17 23:19                       ` Junio C Hamano
2010-08-17 23:50                         ` Jonathan Nieder
2010-08-18 10:41                           ` Ævar Arnfjörð Bjarmason
2010-08-17  9:24                     ` [PATCH 2/5] compat/regex: get the gawk regex engine to compile within git Ævar Arnfjörð Bjarmason
2010-08-17  9:24                     ` [PATCH 3/5] Change regerror() declaration from K&R style to ANSI C (C89) Ævar Arnfjörð Bjarmason
2010-08-17  9:24                     ` [PATCH 4/5] t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTEND Ævar Arnfjörð Bjarmason
2010-08-17  9:24                     ` [PATCH 5/5] autoconf: don't use platform regex if it lacks REG_STARTEND Ævar Arnfjörð Bjarmason
2010-08-17  5:17                 ` [PATCH/RFC v2 2/3] compat/regex: get the gawk regex engine to compile within git Ævar Arnfjörð Bjarmason
2010-08-17  5:17                 ` [PATCH/RFC v2 3/3] t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTEND Ævar Arnfjörð Bjarmason
2010-07-16 14:33         ` Ævar Arnfjörð Bjarmason [this message]
2010-07-16 19:50           ` [PATCH] grep: Don't pass a TODO test if REG_STARTEND is supported Jonathan Nieder
2010-07-16 20:51             ` Ævar Arnfjörð Bjarmason
2010-07-16 21:06               ` Jonathan Nieder
2010-07-16 21:19                 ` Æ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=AANLkTimZ3f550HQwx3OEpO6n1b037He6hJ6rAXP8vfIk@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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
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).