From patchwork Fri Jul 5 16:04:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 168563 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3765392ilk; Fri, 5 Jul 2019 09:16:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzL6lRHwoJRiAumIeBlx2XQvb2K15TXtLEkOErxhMPYgqIP2ihUjcLRE4+2YA8B78nrUhdO X-Received: by 2002:a17:906:1e85:: with SMTP id e5mr4291986ejj.200.1562343362487; Fri, 05 Jul 2019 09:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562343362; cv=none; d=google.com; s=arc-20160816; b=tDRwalD4aylyeS3brQ8BioSXBtD1IwQ0R/e7lFrB0yJRA/lH7+L+ljJIS0KKpyg8DZ VB6BYPRlujBTW2N/NgY9Q+5ad4n6pXdh7Wz/6FjBhujge7QDQ9CQ1Rd6z3fwLpkdK0B5 vMbDlZaWC3d7fb6BageHjLCz6Sn/4okB3TvgXAbhqm0EgBjDtJHw2dttyehoWDTGoGz7 rh1POo+JPp5QFJJ5GSxYeNVRiwwiHnXgqltKL212c7NrB4WqSqvFN1CL/f5pTZJTijDb jjjiTFlRt9gpN2nhEixd4PqPCuqXecBPKzs53Wqe9mchbDDZuBcPhkk/PrH8XfGuavLH VdWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=rcuPIsMvIORKeTdOPCcArgmZ5EQEGenIxSqtwUik0XE=; b=nTQP27scvNFknr0Nd572J184ofs5+WqL8rZ0UFejDmBVIHkW0zp+qKrBuAzT0Sg6gI 1gfguIotWjlTcBQK/9LMBy19rPiPQ6vVNs6LSLK1EBwi5zOCg0IxtxRvocdIIYoqedap giswOgi1/gBEhFjWPrOSmP1zRS3vNlpQsxMyeu0vFAlec/1BNQ5HD3AyDdYNfZEUb+Oy 1uwjGmeHcbjI6cndg7025ujfEJbr4QTt09UOCfP74pg0t4GsBSrgYbkPeJoVVRG3VtSP i7jCUaJWWClwyGG6t+54OBIr5Vg7MWS9xVVEtd4WRNAmcylQdOcaJCCu/uzgkHCL5nG7 KsmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jW3QtI5c; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e54si6848482eda.324.2019.07.05.09.16.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jul 2019 09:16:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jW3QtI5c; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjQsT-00079V-Eq for patch@linaro.org; Fri, 05 Jul 2019 12:16:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40286) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjQhc-0002v9-J4 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 12:04:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjQha-0001op-9K for qemu-devel@nongnu.org; Fri, 05 Jul 2019 12:04:48 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:33405) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjQhX-0000Ue-Eh for qemu-devel@nongnu.org; Fri, 05 Jul 2019 12:04:44 -0400 Received: by mail-wr1-x444.google.com with SMTP id n9so10475431wru.0 for ; Fri, 05 Jul 2019 09:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rcuPIsMvIORKeTdOPCcArgmZ5EQEGenIxSqtwUik0XE=; b=jW3QtI5c8Zulhdo28F5UE+/Zatu6U5f4ri7hwx76IrIzPTUZjqR+pGLiUWBWeVNJuy x++NA1t0ukYLSNmQzgy+9MX7rpOleDxIzEOul2339Hu++lMumqcagWJDJ5YHmgfVGNl3 /KrpLHG8ywA3HJvQE2R5NjpS2W+Z916vi6J5IQRVbdwjKYXVhHHJIgNJFsEYHRVdgf5L ceD1awHUq47TKANxJQW05wlaL1lQnNCO98CZ0g/NoSHPpeHHYcpqoHUB830ehs17H855 hRpW0dsCgsMrwCoTlvWcFZUvJWo6xn94651YCGA4hvEktiA0F4EGLIUYaRR+jL6JeBd6 yelQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rcuPIsMvIORKeTdOPCcArgmZ5EQEGenIxSqtwUik0XE=; b=snthMem2eCMYeP7Y0c7Z6TLb6rgAcpmhAGNRjN6aropo5ijasvccxZvkTDxDghWDpI TKBbk2grlbQjsO7JsxRS3BBsrebYJjGL1v1ayIBtv75SG7trfzFd4dQRm8fwM/1aLutB 7VK+tFmxM6SNLpGoP7vGehdEht2c6771MUYGnXRWl2i9oUSb8/QlwZqXHD9Ukn7gzh7A IICi6VIeQ362/r5lPzqZf0o6kwLLP6TB/+GP6Cchnl881CWfJnfsxSMdhClAzvZz6rOD o9R1Bm1xCLLt2mDfF0ReAcG4VPY2A2J8JEVz9OGgl6doPKtRkqL5Lj7/aUETeWNKvKpZ Rc3w== X-Gm-Message-State: APjAAAXqcD6wRu/bLECdhb0KFKH7oMtZhf5KjzlbFr4+m+k9jVWOIj07 W9M4CYJlpt6+0LAIyiZkIOmulw== X-Received: by 2002:adf:d4cc:: with SMTP id w12mr4835967wrk.121.1562342664880; Fri, 05 Jul 2019 09:04:24 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 91sm1900253wrp.3.2019.07.05.09.04.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 05 Jul 2019 09:04:22 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B65081FF90; Fri, 5 Jul 2019 17:04:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 17:04:19 +0100 Message-Id: <20190705160421.19015-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705160421.19015-1-alex.bennee@linaro.org> References: <20190705160421.19015-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH v1 3/5] tests/tcg: fix diff-out pass to properly report failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" A side effect of piping the output to head is squash the exit status of the diff command. Fix this by only doing the pipe if the diff failed and then ensuring the status is non-zero. Signed-off-by: Alex Bennée --- tests/tcg/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 6fa63cc8d5..7973cd1ba2 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -45,7 +45,11 @@ run-test = $(call quiet-command, timeout $(TIMEOUT) $2,"TEST",$3) endif # $1 = test name, $2 = reference -diff-out = $(call quiet-command, diff -u $1.out $2 | head -n 10,"DIFF","$1.out with $2") +# to work around the pipe squashing the status we only pipe the result if +# we know it failed and then force failure at the end. +diff-out = $(call quiet-command, diff -q $1.out $2 || \ + (diff -u $1.out $2 | head -n 10 && false), \ + "DIFF","$1.out with $2") # $1 = test name, $2 = reason skip-test = @printf " SKIPPED %s on $(TARGET_NAME) because %s\n" $1 $2