From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 89078429E21 for ; Sun, 11 Sep 2011 16:30:54 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F5OkBHHLR-GL for ; Sun, 11 Sep 2011 16:30:54 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id AF461431FB6 for ; Sun, 11 Sep 2011 16:30:53 -0700 (PDT) Received: by bkbzt12 with SMTP id zt12so1058939bkb.26 for ; Sun, 11 Sep 2011 16:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=Ckyu3lZmhtzm28pQPbhtrw8I9rbXf/w6+Wfjp96fj08=; b=lwUMe+dHG6d7BEB1HanR/TdifgvOWpKx9py3KT/9hIVgVMVE9uz5NxIJAix8gwdr04 Jile8zvsTuPwo2jp19OG+tjR/zK3JuRmXrRP1k+v9qVd+jDOX6j0F0qNtMQshknciejS zzy802WbVyDTiJtupwTsrLA1m8QNa4ktcE85Y= Received: by 10.204.135.6 with SMTP id l6mr2582381bkt.284.1315783850827; Sun, 11 Sep 2011 16:30:50 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id l11sm4989720bkb.1.2011.09.11.16.30.47 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 11 Sep 2011 16:30:48 -0700 (PDT) From: Dmitry Kurochkin To: david@tethera.net, notmuch@notmuchmail.org Subject: Re: [PATCH] test: reset known_broken status in test_expect_equal and test_expect_equal_file In-Reply-To: <1315782714-32287-1-git-send-email-david@tethera.net> References: <1309752441-10651-3-git-send-email-dmitry.kurochkin@gmail.com> <1315782714-32287-1-git-send-email-david@tethera.net> User-Agent: Notmuch/0.8-19-g1ca96a5 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Mon, 12 Sep 2011 03:30:54 +0400 Message-ID: <87r53mveq9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Bremner X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2011 23:30:54 -0000 Hi David. On Sun, 11 Sep 2011 20:11:54 -0300, david@tethera.net wrote: > From: David Bremner > > 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