unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: david@tethera.net, notmuch@notmuchmail.org
Cc: David Bremner <bremner@debian.org>
Subject: Re: [PATCH] test: reset known_broken status in test_expect_equal and test_expect_equal_file
Date: Mon, 12 Sep 2011 03:30:54 +0400	[thread overview]
Message-ID: <87r53mveq9.fsf@gmail.com> (raw)
In-Reply-To: <1315782714-32287-1-git-send-email-david@tethera.net>

Hi David.

On Sun, 11 Sep 2011 20:11:54 -0300, david@tethera.net wrote:
> From: David Bremner <bremner@debian.org>
> 
> Commit 4cc6727 introduced the library function
> test_subtest_known_broken which sets a variable
> test_subtest_known_broken_ . Unfortunately this variable is not reset
> if test_begin_subtest is not called before the next
> test_expect_success or test_expect_failure.
> 
> This commit remedies that, under the assumption that exactly one
> test_expect_equal or test_expect_equal_file will follow a
> test_begin_subtest
> ---
> 
> Any comments on this? I didn't follow a lot of the original
> discussions on the test API very closely. Mainly I want to know if the 
> assumption at the end of the commit message seems reasonable.
> 

IMHO this is not a good idea, because:

1. It introduces multiple places where the flag is reset.  If new
   test_expect_* functions are added in the future, there would be more
   of these.  So it brings us more complex code, code duplication, more
   chances for bugs, etc.

   This may be solved by code refactoring, but I am not sure.

2. No support for tests with multiple test_expect_* calls.  I do not
   know if it is used or works now, but the patch certainly does not
   help in this respect.

3. I thought that every test must start with a test_begin_subtest call.
   So it is the right place to put all subtest initialization code to.
   Is this not correct?  If it is correct, then I do not understand why
   we should support buggy tests by hiding (some of) their bugs.  Why do
   we need it?

Regards,
  Dmitry

>  test/test-lib.sh |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index 196ef49..3c2768c 100755
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -460,6 +460,7 @@ test_expect_equal ()
>  			test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"
>  		fi
>      fi
> +       test_subtest_known_broken_=
>  }
>  
>  test_expect_equal_file ()
> @@ -483,6 +484,7 @@ test_expect_equal_file ()
>  			test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"
>  		fi
>      fi
> +	test_subtest_known_broken_=
>  }
>  
>  NOTMUCH_NEW ()
> -- 
> 1.7.5.4
> 
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

  reply	other threads:[~2011-09-11 23:30 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04  1:59 [PATCH 1/3] test: update documentation for test_emacs in test/README Dmitry Kurochkin
2011-07-04  1:59 ` [PATCH 2/3] test: improve known broken tests support Dmitry Kurochkin
2011-07-04  3:42   ` Austin Clements
2011-07-04  3:46     ` Dmitry Kurochkin
2011-07-04  1:59 ` [PATCH 3/3] test: add emacs test for hiding a message following an HTML part Dmitry Kurochkin
2011-09-26 11:01   ` David Bremner
2011-09-26 17:25     ` Dmitry Kurochkin
2011-10-01 11:51       ` David Bremner
2011-10-02  1:45         ` Dmitry Kurochkin
2011-10-03 12:39           ` Thomas Jost
2011-10-03 13:38             ` Dmitry Kurochkin
2011-10-03 14:27             ` David Bremner
2011-10-03 16:47               ` [PATCH 00/13] Test prereqs and screen-based Emacs tests Thomas Jost
2011-11-01 19:54                 ` Pieter Praet
2011-11-13 17:46                   ` David Bremner
2011-11-16 13:03                     ` Pieter Praet
2011-10-03 16:47               ` [PATCH 01/13] test: define a helper function for defining prereqs on executables Thomas Jost
2011-10-03 16:47               ` [PATCH 02/13] test: add 'GnuPG' prereq to dependent 'crypto' tests Thomas Jost
2011-10-03 16:47               ` [PATCH 03/13] test: add 'Emacs' " Thomas Jost
2011-11-01 19:56                 ` Pieter Praet
2011-11-01 20:15                   ` Pieter Praet
2011-10-03 16:47               ` [PATCH 04/13] test: add 'Emacs' prereq to dependent 'emacs' tests Thomas Jost
2011-11-01 19:57                 ` Pieter Praet
2011-11-01 20:08                   ` Pieter Praet
2011-10-03 16:47               ` [PATCH 05/13] test: add 'Emacs' prereq to dependent 'emacs-large-search-buffer' tests Thomas Jost
2011-10-03 16:47               ` [PATCH 06/13] test: run emacs inside screen Thomas Jost
2011-11-10  7:36                 ` Jameson Graef Rollins
2011-11-10  8:10                   ` Thomas Jost
2011-10-03 16:47               ` [PATCH 07/13] test: avoid using screen(1) configuration files Thomas Jost
2011-10-03 16:47               ` [PATCH 08/13] test: do not set frame width in emacs Thomas Jost
2011-10-03 16:47               ` [PATCH 09/13] test: `notmuch-show-advance-and-archive' with invisible signature Thomas Jost
2011-10-03 16:47               ` [PATCH 10/13] emacs: improve hidden signatures handling in notmuch-show-advance-and-archive Thomas Jost
2011-10-03 16:47               ` [PATCH 11/13] emacs: remove no longer used functions from notmuch-show.el Thomas Jost
2011-10-03 16:47               ` [PATCH 12/13] emacs: remove unused `point-invisible-p' function Thomas Jost
2011-10-03 16:47               ` [PATCH 13/13] test: make smtp-dummy work with Emacs 24 Thomas Jost
2011-11-13 19:09                 ` David Bremner
2011-12-15 12:14   ` [PATCH 3/3] test: add emacs test for hiding a message following an HTML part David Bremner
2011-12-15 17:27     ` Tom Prince
2011-12-16 18:51       ` Dmitry Kurochkin
2011-07-04  4:07 ` [PATCH v2 0/3] improved broken tests support and test for a bug Dmitry Kurochkin
2011-07-04  4:07   ` [PATCH v2 1/3] test: update documentation for test_emacs in test/README Dmitry Kurochkin
2011-07-04  4:07   ` [PATCH v2 2/3] test: improve known broken tests support Dmitry Kurochkin
2011-09-11 23:11     ` [PATCH] test: reset known_broken status in test_expect_equal and test_expect_equal_file david
2011-09-11 23:30       ` Dmitry Kurochkin [this message]
2011-09-11 23:51         ` David Bremner
2011-09-12  0:26           ` Dmitry Kurochkin
2011-09-13  2:41             ` [PATCH] test: reset test_subtest_known_broken_ after each success/failure david
2011-09-13 10:19               ` Dmitry Kurochkin
2011-09-13 11:39                 ` David Bremner
2011-07-04  4:07   ` [PATCH v2 3/3] test: add emacs test for hiding a message following an HTML part Dmitry Kurochkin
2011-09-10 18:08   ` [PATCH v2 0/3] improved broken tests support and test for a bug David Bremner

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=87r53mveq9.fsf@gmail.com \
    --to=dmitry.kurochkin@gmail.com \
    --cc=bremner@debian.org \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).