From patchwork Mon Jan 2 13:22:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9493541 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 7434A62AB2 for ; Mon, 2 Jan 2017 13:23:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 669E2223B2 for ; Mon, 2 Jan 2017 13:23:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B412268AE; Mon, 2 Jan 2017 13:23:31 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 5F2E02679B for ; Mon, 2 Jan 2017 13:23:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932944AbdABNXR (ORCPT ); Mon, 2 Jan 2017 08:23:17 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33095 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589AbdABNXQ (ORCPT ); Mon, 2 Jan 2017 08:23:16 -0500 Received: by mail-wm0-f66.google.com with SMTP id u144so82060444wmu.0 for ; Mon, 02 Jan 2017 05:23:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=QBlKFUELzW9lmLtl4QYak6njgzfDv8eHKILn1WvEQwk=; b=U8M1YszhfXP9bm9JGQwkIepZOZo/rermciQvssZnhUN36OO02tM687bZYFGHTd+y2A aZ962UcSD4sygNVIgrMn2mt9KGBaGsCiQx2WNBHrkmera3tYp0Lp1j8AiTesFtPLdsdQ rKAi7x+NCujB7hFFTUzgcr+UPM4sEneitI4zkf75SxFziqJHzKhkOE94JysDwVAjScD1 9rpSB0MCUi9M+7g6JS14zrzRwuECUg8WKIrnCisHTEZYTArCOcIkiDI3vZnwCdtVrBet 9Sj+39BvW5qQEO7t0BiY2mo9qnUe2DKgQnvIPN1+yWsRfjF63iO2LR3HEkQgojHVPxQt C0YA== 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; bh=QBlKFUELzW9lmLtl4QYak6njgzfDv8eHKILn1WvEQwk=; b=IkdBwd6L1Mz0WOyGZ9W9rItgVw0TzNZk1yR5yFKAdNDcUT42TbfkLLOvaMjspswizx b803BoXNEACpV/3sCSTspE/AkgqhZyfz4Gz8G3voajC6Oi+gDIxylPB6K6YNGX49jPRz HZh5N69exC0Ytfvya99yLSDLcYvE1nbmOvbMf7YgdnS4BK2008u29ezumltVz5mWEBuM CObddiftlhqzWGXyYKla9PoC1sdAxlUKzFuU00nlzoaFH1x2ZIxsnbv7CDKhWc+6IiBo NdYRPQ4QKG98qyAcGWj4K5IHJBYm+dUYtUhU7NO8T1gEdNmp5vitrqd5aw5aiWfk0Kwu Cl6w== X-Gm-Message-State: AIkVDXJKl7GCmIR737iPnqImX3KFWDt113FldpYlNb/2CwRSz0oYRylJmLz6miwnsZCebA== X-Received: by 10.28.221.11 with SMTP id u11mr53757987wmg.123.1483363394477; Mon, 02 Jan 2017 05:23:14 -0800 (PST) Received: from amir-VirtualBox.ctera.local (bzq-82-81-193-202.cablep.bezeqint.net. [82.81.193.202]) by smtp.gmail.com with ESMTPSA id 204sm84378318wmj.7.2017.01.02.05.23.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Jan 2017 05:23:13 -0800 (PST) From: Amir Goldstein To: Eryu Guan Cc: fstests@vger.kernel.org Subject: [PATCH 1/2] check: factor out get_sub_group_list() helper Date: Mon, 2 Jan 2017 15:22:58 +0200 Message-Id: <1483363379-10210-1-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This helper gets a list of tests that belong to a group under a specific tests subdir. Signed-off-by: Amir Goldstein --- check | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/check b/check index cf6379b..faf6281 100755 --- a/check +++ b/check @@ -87,19 +87,30 @@ testlist options exit 0 } +get_sub_group_list() +{ + local d=$1 + local grp=$2 + + test -s "$SRC_DIR/$d/group" || return 1 + + local grpl=$(sed -n < $SRC_DIR/$d/group \ + -e 's/#.*//' \ + -e 's/$/ /' \ + -e "s;^\($VALID_TEST_NAME\).* $grp .*;$SRC_DIR/$d/\1;p") + echo $grpl +} + get_group_list() { - grp=$1 + local grp=$1 + local grpl="" for d in $SRC_GROUPS $FSTYP; do if ! test -d "$SRC_DIR/$d" ; then continue fi - l=$(sed -n < $SRC_DIR/$d/group \ - -e 's/#.*//' \ - -e 's/$/ /' \ - -e "s;^\($VALID_TEST_NAME\).* $grp .*;$SRC_DIR/$d/\1;p") - grpl="$grpl $l" + grpl="$grpl $(get_sub_group_list $d $grp)" done echo $grpl }