From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751397AbdGQARz (ORCPT ); Sun, 16 Jul 2017 20:17:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52258 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbdGQAQe (ORCPT ); Sun, 16 Jul 2017 20:16:34 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2791A2C1554 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=swood@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2791A2C1554 From: Scott Wood To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Scott Wood Subject: [PATCH 2/8] ktest: Set buildonly=1 for CONFIG_BISECT_TYPE=build Date: Sun, 16 Jul 2017 19:16:24 -0500 Message-Id: <20170717001630.10518-2-swood@redhat.com> In-Reply-To: <20170717001630.10518-1-swood@redhat.com> References: <20170717001630.10518-1-swood@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Jul 2017 00:16:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rather than adding a third copy of the same logic, rework it to cover all three buildonly cases at once. In the future, please consider using the same variable to perform the same function regardless of context... Signed-off-by: Scott Wood --- tools/testing/ktest/ktest.pl | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index cdf6974bc462..36e1b91259cd 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -718,22 +718,14 @@ sub set_value { my $prvalue = process_variables($rvalue); - if ($buildonly && $lvalue =~ /^TEST_TYPE(\[.*\])?$/ && $prvalue ne "build") { + if ($lvalue =~ /^(TEST|BISECT|CONFIG_BISECT)_TYPE(\[.*\])?$/ && + $prvalue !~ /^(config_|)bisect$/ && + $prvalue !~ /^build$/ && + $buildonly) { + # Note if a test is something other than build, then we # will need other mandatory options. if ($prvalue ne "install") { - # for bisect, we need to check BISECT_TYPE - if ($prvalue ne "bisect") { - $buildonly = 0; - } - } else { - # install still limits some mandatory options. - $buildonly = 2; - } - } - - if ($buildonly && $lvalue =~ /^BISECT_TYPE(\[.*\])?$/ && $prvalue ne "build") { - if ($prvalue ne "install") { $buildonly = 0; } else { # install still limits some mandatory options. -- 2.9.4