From: Per Cederqvist Subject: [GUILT v4 10/33] Run test_failed if the exit status of a test script is bad. Date: Sun, 18 May 2014 23:59:46 +0200 Message-ID: <1400450409-30998-11-git-send-email-cederp@opera.com> References: <1400450409-30998-1-git-send-email-cederp@opera.com> Cc: git@vger.kernel.org, Per Cederqvist To: Jeff Sipek X-From: git-owner@vger.kernel.org Mon May 19 00:06:05 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wm9DY-00030o-VC for gcvg-git-2@plane.gmane.org; Mon, 19 May 2014 00:06:05 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752409AbaERWGA (ORCPT ); Sun, 18 May 2014 18:06:00 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:34219 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752402AbaERWF7 (ORCPT ); Sun, 18 May 2014 18:05:59 -0400 Received: by mail-lb0-f182.google.com with SMTP id z11so3185792lbi.41 for ; Sun, 18 May 2014 15:05:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ndG5UYT4cBLqk69lTgHgwq6PghVtrtQ8fAcRW8TsN6A=; b=NeM2LMKjkd+7OI/ofh1dryt1RZBYoafpSobWqa02hcjKYeitO+/K7NPgfZgt8Z7km0 CwNJ/40k0TVuLiRAtJR1zNiKez6Bv5cu7S99V/Vq/Y57jiVwg/1u//o9G27DwRot/HtA kp/EzZtpPV3gspMdTVPGTAzcU1Hfh7URh2Wc5Y8yrK8pWhNQ192MzQJ0YPeKIguRYorP Ls/xcUiTv4sevnVUOs+WU31p2Er0S6/J975P3iHc0QXprAhbE/cDrn9Mid3PtqQ6EdgZ 92XjaDD6MxyJs02UVQyGU8ypOL2XXin9z240Ti1m2CaWkUfRGCuopYzk5CC0SFJMhlNW ykpw== X-Gm-Message-State: ALoCoQlSo5bNnBPSTRTM5AgH6eMQj+as7Pi+MEIjvN/E6pTY1svWNxma7gGUFqTqS9SGn5wr2qJ2 X-Received: by 10.112.41.101 with SMTP id e5mr12457576lbl.46.1400450758412; Sun, 18 May 2014 15:05:58 -0700 (PDT) Received: from dualla.linkoping.osa (ip-200.t2.se.opera.com. [212.247.211.200]) by mx.google.com with ESMTPSA id d8sm17593818lah.12.2014.05.18.15.05.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 May 2014 15:05:57 -0700 (PDT) X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1400450409-30998-1-git-send-email-cederp@opera.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: There were two problems with the old code: - Since "set -e" is in effect (that is set in scaffold) the run-test script exited immediately if a t-*.sh script failed. This is not nice, as we want the error report that test_failed prints. - The code ran "cd -" between running the t-*.sh script and checking the exit status, so the exit status was lost. (Actually, the exit status was saved in $ERR, but nothing ever looked at $ERR.) Signed-off-by: Per Cederqvist Signed-off-by: Josef 'Jeff' Sipek --- regression/run-tests | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/regression/run-tests b/regression/run-tests index a10e796..8e0af9f 100755 --- a/regression/run-tests +++ b/regression/run-tests @@ -55,11 +55,15 @@ function run_test # run the test cd "$REPODIR" > /dev/null - "$REG_DIR/t-$1.sh" 2>&1 > "$LOGFILE" - ERR=$? + if "$REG_DIR/t-$1.sh" 2>&1 > "$LOGFILE"; then + ERR=false + else + ERR=true + fi + cd - > /dev/null - [ $? -ne 0 ] && test_failed + $ERR && test_failed diff -u "t-$1.out" "$LOGFILE" || test_failed echo "done." -- 1.8.3.1