From patchwork Wed Jul 10 10:25:55 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: 168790 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp9769755ilk; Wed, 10 Jul 2019 03:26:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxR6p6r2t9YaWRh/8OUlkS6QNyaMQalyHQ9jrlB9OKUye93rBdckrozzv/A03KQBz13T6+w X-Received: by 2002:a17:906:7e4b:: with SMTP id z11mr26332259ejr.214.1562754405319; Wed, 10 Jul 2019 03:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562754405; cv=none; d=google.com; s=arc-20160816; b=bhq5PHp7LtPDu/03bbsRjIyqEgcw2EYdHI9vaU0qlEfE62c4Zgs4el4qNY0Ra5r83A /XRKvHb8k3SyifJfLoAqj6b/NMRn3VzF5kdqAes6g4PTWFis4ZErq9VE+AayLTZ6/hD1 zMQyMQzmrYxR2yt8ighRPLDleSqURD9nbEd5K/FYnaj8D9PfhZej9QC8J7zhmXOIkWyB rIm7zA1trih4S1mOprdSbm6I8iUcuGz4uYxFfOql5V2SRpH1AfHn9x+PQ0DB/ormO4Lz 72+4oeV5Nz9Y6zagtaTECTbp8Napnwhtcie4SS4gEO/ShSJv0P4V2ITsspIrRc211CKD pXEw== 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=p1ccHw8zWsSvS6fMryBQBe81FnVDKc6P4UtR9wq8jPM=; b=g/8P1uC1l6GLz/C/835y21nLLmBMo5phz1E/XfS78knyUaqesW+3n+oiBA6m9QyjOX m2whP5cWv78wc+ienWI7Cgq0FpdBqVDO8Cp+VVmaIYTth6gfax1TRWxP4/K9LO2ox0WE ziwfM0lWad4ljsDbu9zVoepCLpoRKz/cI2ZkV71Xa+yiEtdUfRkbaLRU33N5/L+dPpSv FPkrz7Edvh4cjytmklYFTH7J3lh8L9Zg/nhFa16bPfQCA+xwn/wafvA1s/hsCyKKdPp9 qH/uq9qFrI3rDr2wmi0JKJtav7fUWcnoTxhci9KtiMsoGUzBiMoaihWz/Y4JwnOELtaV OVhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JYAy0hbX; 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 t23si1019627eju.143.2019.07.10.03.26.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2019 03:26:45 -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=JYAy0hbX; 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]:59756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9oB-0001MT-BT for patch@linaro.org; Wed, 10 Jul 2019 06:26:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41729) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9nk-0001In-Kx for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl9nj-0000lt-C8 for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:16 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:40271) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hl9nj-0000P2-4Y for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:15 -0400 Received: by mail-wr1-x432.google.com with SMTP id r1so1842841wrl.7 for ; Wed, 10 Jul 2019 03:26:01 -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=p1ccHw8zWsSvS6fMryBQBe81FnVDKc6P4UtR9wq8jPM=; b=JYAy0hbX7Gnj2kFTy/qWsUo/iKuQLAV1Rc6YOGNv0jwb5XIpucdWhNCsjw5jXflHJo SDYRtREOjSmgqkaDhqSD8nGKFAk77EltLnAGci2StIP7odRaw+ZqjcFJKxZWpldd3SMy Ws2OfezhtrzkbTquQ3CgE9zt6MYRIipO9SCvVOHrHNQiPKzF+LrTBx9DS/NjG7aFdyMo qGABK5pwA5aUxddynZdI0Mll5llxrI7Ze5gNbKJB5D6+PiJ9uvuv6hS1sntew4uXirsN ZmADe0X9VklTumzX0hBl65N5pkKt047szsFk982Y9M13ZI7HyVtJ2LzAtF/U/qLwnwAY ZEIg== 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=p1ccHw8zWsSvS6fMryBQBe81FnVDKc6P4UtR9wq8jPM=; b=AXBmiIk2X3iNqltuYB7+s2Va6BCu3qiSRehHUChR+h7rRpoXJmm/3KComB12ybuD+U OKggDNLdBWMIWh63wL8F32JMrv+yYi3PLCw3F6EorrQMTTB+pcDZKsLHUfaE0A5cp17s TtvLRfi+GeWjvRitTnwSnftqC3O0MtayHW7HwDZNittOlmoLdi0J/gPLJlyQuyor0Lx6 5D6pUVvREDStwL6kUuGiwyBl9YgU1Lp2O5S+X1eCuVIIb/PwGitLiMxotpOHfq0B3pKT rsRmxBpQNinqKTfukHk6D5fYJ51HlChp9jUUKNI4Fs2fks+DE5BVj5mYYZ4JE/RflOpe PduQ== X-Gm-Message-State: APjAAAWE5d0WnhTfdAQ9fLlwsY8/g6cmSaYVhw7R4dnd09D46O87zbAt WCt5FCy2rtFaLlMAeEBJxmQGnQ== X-Received: by 2002:adf:b64b:: with SMTP id i11mr11520724wre.205.1562754360160; Wed, 10 Jul 2019 03:26:00 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id z1sm1945444wrv.90.2019.07.10.03.25.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 10 Jul 2019 03:25:59 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E00381FF8F; Wed, 10 Jul 2019 11:25:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Wed, 10 Jul 2019 11:25:55 +0100 Message-Id: <20190710102557.3107-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190710102557.3107-1-alex.bennee@linaro.org> References: <20190710102557.3107-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::432 Subject: [Qemu-devel] [PULL 2/4] 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?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 -- 2.20.1 diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 6fa63cc8d5..9f56768624 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