From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14617 invoked from network); 7 Apr 2022 12:33:54 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Apr 2022 12:33:54 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1649334834; b=MbmdVa6Pw1vLIoADoN0nbRZErpqvsTnLVv4nZplEGSTQVM4tXAtUp4tFquJB/XAg5bpU8al65z qw7+cuU5NAFxkU9esWgzlzgwI0iaQmcpgCAxGQAL6vF16MgkF39lycqEZE6avruoHF66KMmL24 z10/Qhz3LVRniltGIBrtshw8h88RirLTdk5OpcklXRz2+Wn+20hshZeTT/dkBMqViIm+AUxCst WlYNLGNceDfcr8kFCVCefBNUHRr1nPAqgIAIh8wsxvOaKICTyWt5FK5YRrWNTDM8/ZguUZ4n38 snJP3P7KHanA/Jb1iRUbZ5LtXt0rwBF7ipdZuBno6iGQDQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd00006-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.6; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1649334834; bh=bzKSvn9bOX0P51a4Ew3PioyOAyLFIUr+UnhCMjju6lg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:References:Message-ID:Content-Transfer-Encoding:Date: In-Reply-To:From:Subject:MIME-Version:Content-Type:DKIM-Signature; b=WKv3xR1FerBujRJym0affl0DdoH5lRYXJ0DM1otyKJ2qk/Uboru240zDhZ0ekAQbr6thlD0gEa VkQCgCjyFQ9Akt2fa0t0+JrT7b0WW5ALQYTT8rR/p04WHG5LMg6HUJaRokMT8KvZ+8Aop+iVZr TSGirKo9nebwU7DKUlv+kRiaCQMBILEgtTRg9Uue243LlUSrL+1innMW6B0B6wIp4Ct0gdzPor oCAdBGqmgxZSvhDXWmKiyuvj5CLCC/QyVxaXcVYc5gNmIQw46hKj9TjJ1A1R8BtpRPeCSxY9wt P5Zu3hdmrPYIEXBP3uWsRz3pP2sr/80hRfVYxSSxlFIM0g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:To:References:Message-Id: Content-Transfer-Encoding:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=omU5SXnhQtmjEFFNHSj/P4x2FmBfywBpJD+uP5j6cAY=; b=KvjL/4Hpds08tDHlkooez0/ezw Q0+nJnCoPfFfy26BQCgWP5NuFtrpKkJD4QccsIo1xF1pMk4hEf+7uv19pz9cxkvCpKD0ow9zFKgRs pBtnrxyf77klcOBeJPpzL3/cL7DFpdME/E2Bj1bD973W+zxbQZbZBLPgkTe2mBw2ANwY9a26AIvnj RqK8CYVT/3MNqUCZU9nUbfDdezSunCnkMxqEBDZ//vBiCFt/UeMLsJGiRGpyxa/ORk6kkRnV9S0F3 Eve5n1ea79deYunwc2q7RrRiuKuVLv02XC9FpOS2a784f9yxuCoBQOblOlYhow0RP9inawOtLisbr cpL4itkw==; Received: from authenticated user by zero.zsh.org with local id 1ncRKh-000Ib1-Su; Thu, 07 Apr 2022 12:33:51 +0000 Authentication-Results: zsh.org; iprev=pass (snd00006-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.6; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd00006-bg.im.kddi.ne.jp ([27.86.113.6]:60769 helo=dfmta0011.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ncRK8-000IHY-Ms; Thu, 07 Apr 2022 12:33:18 +0000 Received: from mail.biglobe.ne.jp by omta0011.biglobe.ne.jp with ESMTP id <20220407123310573.IGHC.126261.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Thu, 7 Apr 2022 21:33:10 +0900 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: ZTST_continue (was Re: Lots of test failures when --disable-multibyte) From: Jun T X-Priority: 3 In-Reply-To: <728406102.562615.1649252226266@mail2.virginmedia.com> Date: Thu, 7 Apr 2022 21:33:10 +0900 Content-Transfer-Encoding: 7bit Message-Id: <944AAFF0-9153-4D67-9D6A-A80FCCCD32C0@kba.biglobe.ne.jp> References: <1174195730.504727.1649083398497@mail2.virginmedia.com> <42130AB1-3B57-4127-9550-1CF2FF0D5857@kba.biglobe.ne.jp> <728406102.562615.1649252226266@mail2.virginmedia.com> To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 50012 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: I will split the patch into two parts; one for ZTST_continue and another for handling the return status of ZTST_prepclean. Here is the patch for ZTST_continue (Almost identical with Peter's). ZTST_failuers is incremented also in ZTST_testxpassed. (patch for Test/README is identical with Peter's and not included here) diff --git a/Test/ztst.zsh b/Test/ztst.zsh index 89fe69b5b..cdc84b160 100755 --- a/Test/ztst.zsh +++ b/Test/ztst.zsh @@ -17,6 +17,9 @@ # Defined in such a way that any value from the environment is used. : ${ZTST_verbose:=0} +# If non-zero, continue the tests even after a test fails. +: ${ZTST_continue:=0} + # We require all options to be reset, not just emulation options. # Unfortunately, due to the crud which may be in /etc/zshenv this might # still not be good enough. Maybe we should trick it somehow. @@ -143,6 +146,10 @@ ZTST_testfailed() { $ZTST_failmsg" fi ZTST_testfailed=1 + # if called from within ZTST_Test() this will increment ZTST_Test's local + # ZTST_failures. Otherwise global ZTST_failures will be incremented + # (but currently its value is not used). + (( ++ZTST_failures )) return 1 } ZTST_testxpassed() { @@ -156,6 +163,7 @@ ZTST_testxpassed() { $ZTST_failmsg" fi ZTST_testfailed=1 + (( ++ZTST_failures )) return 1 } @@ -373,12 +381,12 @@ ZTST_diff() { return "$diff_ret" } - + ZTST_test() { local last match mbegin mend found substlines local diff_out diff_err local ZTST_skip - integer expected_to_fail + integer expected_to_fail ZTST_failures while true; do rm -f $ZTST_in $ZTST_out $ZTST_err @@ -492,7 +500,7 @@ $ZTST_curline" $ZTST_code${$(<$ZTST_terr):+ Error output: $(<$ZTST_terr)}" - return 1 + if (( ZTST_continue ));then continue; else return 1; fi fi ZTST_verbose 2 "ZTST_test: test produced standard output: @@ -515,7 +523,7 @@ $(<$ZTST_terr)" $ZTST_code${$(<$ZTST_terr):+ Error output: $(<$ZTST_terr)}" - return 1 + if (( ZTST_continue ));then continue; else return 1; fi fi if [[ $ZTST_flags = *q* && -s $ZTST_err ]]; then substlines="$(<$ZTST_err)" @@ -529,21 +537,27 @@ $(<$ZTST_terr)}" fi ZTST_testfailed "error output differs from expected as shown above for: $ZTST_code" - return 1 + if (( ZTST_continue ));then continue; else return 1; fi fi if (( expected_to_fail )); then ZTST_testxpassed - return 1 + if (( ZTST_continue ));then continue; else return 1; fi fi fi ZTST_verbose 1 "Test successful." [[ -n $last ]] && break done - ZTST_verbose 2 "ZTST_test: all tests successful" + if (( ZTST_failures )); then + ZTST_verbose 1 "ZTST_test: $ZTST_failures test(s) failed" + else + ZTST_verbose 2 "ZTST_test: all tests successful" + fi # reset message to keep ZTST_testfailed output correct ZTST_message='' + + return ZTST_failures }