From patchwork Sun May 28 19:29:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9752635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C959C6038E for ; Sun, 28 May 2017 19:29:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B94822018F for ; Sun, 28 May 2017 19:29:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE766201BD; Sun, 28 May 2017 19:29:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50DAE201BC for ; Sun, 28 May 2017 19:29:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750823AbdE1T3Q (ORCPT ); Sun, 28 May 2017 15:29:16 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34489 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750802AbdE1T3O (ORCPT ); Sun, 28 May 2017 15:29:14 -0400 Received: by mail-wm0-f67.google.com with SMTP id d127so12947066wmf.1 for ; Sun, 28 May 2017 12:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bj333ZMe8boiOiG2aF9W7JBYLGLFlEZh4KzclrHeOl0=; b=EvK2WaEBqqcpYdPpUfpORxR4oliFwTeWkG/arhz6f5hgXJghWRZj/VMmMXHYk3e79q 3xWE0otm2RI3n8Jgy/jxA2SLyrq47eo2sQAEJuUMk5VU0N+iE8gY0yXpN9odBTn0bkLC u3rnlGVUyS8kgT/tzsq0/aEV/0Yml0hr/xxavAJoDXrseKGSJlV83FtEUct3Yn16pWf0 LlbryuQzbJAlzkU4K+EI+Nvv+JbIHaFE3kPaM12n7AN3yrIBgbMEtFLZT5TN9U1kXK5v BSqt6s826kTogh3VK4K1lFxSdcazsHVP02GX96m6DpDv4U3ncH+kIY5W3IamSxUKY80O 3X6g== 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; bh=bj333ZMe8boiOiG2aF9W7JBYLGLFlEZh4KzclrHeOl0=; b=ADGV6XWHXMJgtNU+6le3snkHSWaM8NcwMYBdZKQ0p7d2mphpRIWELrChY3jx91bWcj Pu66YbFf91RhOZ5KUbjeZFJ65rUcKtcx8Ld86cObWQyLkLrSuHeAtgy40e7M038MBGv/ lVNnICZDBnS55+KrNWRmL7Ack5hxaSBw3s19GPr1L44Y+mkzkThEDi2WFDP+E2R5UdSm 5HFTslXZZHIUkdkGSsGww39FXlYjavxWCgXwkUdl9GCskkrQziMmbSvHJJ4AQjIAS9QX StLkeyajR7g3QxwmJyh8ILTQOIDsJYQ5eqDFcQm0N+PzfwVInsN85/+DQZx88odHvXQ7 ySIg== X-Gm-Message-State: AODbwcBm/I2/CxllX6a4YIEdjC+AGLm6swChwdciexrTJlATps9aDEkn ZthN9BQbnoVzkzUPfFw= X-Received: by 10.80.139.202 with SMTP id n10mr10173727edn.106.1495999753041; Sun, 28 May 2017 12:29:13 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:840:6400:ec7b:61ba:4d3e:5951]) by smtp.gmail.com with ESMTPSA id k17sm3840297eda.61.2017.05.28.12.29.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 May 2017 12:29:12 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 2/6] testsuite: grep the expected output only when needed Date: Sun, 28 May 2017 21:29:02 +0200 Message-Id: <20170528192906.1023-3-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170528192906.1023-1-luc.vanoostenryck@gmail.com> References: <20170528192906.1023-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently the testsuite always try to extract the expected output from the test case description. This is done with grep & sed. But in some case we're not interested to compare the actual output with the expected one. And in those cases the grep & sed are just wasted CPU cycles. Fix this by extracting the expected output only when we know that it won't be ignored. This speedup the testsuite by a modest 1%. Signed-off-by: Luc Van Oostenryck --- validation/test-suite | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/validation/test-suite b/validation/test-suite index fa4cd36cf..ce2ca454c 100755 --- a/validation/test-suite +++ b/validation/test-suite @@ -206,12 +206,6 @@ do_test() verbose "Using command : $cmd" - # grab the expected output - sed -n '/check-output-start/,/check-output-end/p' $file \ - | grep -v check-output > "$file".output.expected - sed -n '/check-error-start/,/check-error-end/p' $file \ - | grep -v check-error > "$file".error.expected - # grab the expected exit value expected_exit_value=$check_exit_value verbose "Expecting exit value: $expected_exit_value" @@ -230,6 +224,10 @@ do_test() eval ignore=\$check_${stream}_ignore [ $ignore -eq 1 ] && continue + # grab the expected output + sed -n "/check-$stream-start/,/check-$stream-end/p" $file \ + | grep -v check-$stream > "$file".$stream.expected + diff -u "$file".$stream.expected "$file".$stream.got > "$file".$stream.diff if [ "$?" -ne "0" ]; then error "actual $stream text does not match expected $stream text."