From patchwork Thu Feb 14 16:00:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 10813135 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC7B41390 for ; Thu, 14 Feb 2019 16:00:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC04D2ECCF for ; Thu, 14 Feb 2019 16:00:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A09E92ECD3; Thu, 14 Feb 2019 16:00:20 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 572F62ECCF for ; Thu, 14 Feb 2019 16:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393802AbfBNQAT (ORCPT ); Thu, 14 Feb 2019 11:00:19 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:40122 "EHLO mail-wr1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731286AbfBNQAS (ORCPT ); Thu, 14 Feb 2019 11:00:18 -0500 Received: by mail-wr1-f54.google.com with SMTP id q1so7039678wrp.7 for ; Thu, 14 Feb 2019 08:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=eCTj0yIdfMvLqQoFpAxyOnNf5hUbX1UZ1y8plFtmUwQ=; b=c39haskDFoBYC8bkPOlaZKaxMG/0TcqPT+t86oG0jR6x62uNVeo9G1Q3bOw9c7e/cd EsJNzUeTx25UzCCLepeJEvH/LLhZ70JzWUVbaRnogKJEalJydbQsexp2A4hTjQL0xd6t kk765BQqOrmIyfBiWTT/N8pZsX4Zj7RUoRQr5o1giIHM+O0FYJ75LGrkrOWC+iZKNKOO b2FBokgnZOJcSY+5irb4fsBnCMiPLe1Oa26Zzw7cqjAxUp8H5HgV2NrhUPu0JJFOBzV5 3sgcMntt6VevJoRdv7TOBTRi8G5O1fnbCqNuGyVcrKyWOt8LeSCHjzXYSBd7cXmDNKiY peqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=eCTj0yIdfMvLqQoFpAxyOnNf5hUbX1UZ1y8plFtmUwQ=; b=kC6/TAt77TqsjBOz7LpoRGeSApEigJhF2Ce+YEp+heLkHRiaPMLnem+5MvEuH2n8Lm 0BJgaI3LggtW7sLzyHOFaIZTDGREhnLr64XPUMeu/9K/KRaL3e2P4daOiKqTbvvQT8Tx h7n1HhQAhKcf1pNiK2afjdgp/iuRfuUi5LIlJQzb+ilfP6+PBaRplbkPPwSJhMyqWFly az/2U1S2Npx0itWaS8BKsGo7/cOWdOvyZxbSX2SNyU6hrn5reFIDvfnkhlMremVFMJT6 zMKd5aQRet2dbUAOPYrjC/xbBgFQpyuG28v2dlKrNwfcVwMGkPOpAwMa7WE9fSqzDHhi FREw== X-Gm-Message-State: AHQUAuZ07PovzQLkIp0hd9hW8KBeXrPZYCUrvboN1UvMUGDbRB078LF+ gctp1fAETBT3v5JODnJJYC3BOPHz X-Google-Smtp-Source: AHgI3IbESwEX+k+19k1FHl5mUE/FDuKAj6f78/WehZnrYI8Pezy0BnXaMCP0PhvF2N5reCUYtFSKDQ== X-Received: by 2002:adf:fd07:: with SMTP id e7mr3642838wrr.175.1550160016475; Thu, 14 Feb 2019 08:00:16 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id x3sm3068511wrd.19.2019.02.14.08.00.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 08:00:14 -0800 (PST) From: Paolo Bonzini To: kvm@vger.kernel.org Cc: Sean Christopherson Subject: [PATCH kvm-unit-tests] run_tests: allow specifying desired tests on the command line Date: Thu, 14 Feb 2019 17:00:13 +0100 Message-Id: <1550160013-10938-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is a simpler version of Sean Christopherson's patch, which also allows specifying more than one test. Signed-off-by: Paolo Bonzini --- run_tests.sh | 2 ++ scripts/runtime.bash | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/run_tests.sh b/run_tests.sh index 102c806..6b0af19 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -65,6 +65,8 @@ while getopts "ag:htj:v" opt; do ;; esac done +shift $((OPTIND - 1)) +only_tests="$*" # RUNTIME_log_file will be configured later RUNTIME_log_stderr () { cat >> $RUNTIME_log_file; } diff --git a/scripts/runtime.bash b/scripts/runtime.bash index fffa7dd..2f8026d 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -97,6 +97,10 @@ function run() return fi + if [ -n "$only_tests" ] && ! grep -qw "$testname" <<<$only_tests; then + return + fi + if [ -n "$only_group" ] && ! grep -qw "$only_group" <<<$groups; then return fi