From patchwork Mon Jan 21 16:33:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 10774187 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 6FCEB1390 for ; Mon, 21 Jan 2019 16:33:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6099C29385 for ; Mon, 21 Jan 2019 16:33:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54EBB2972C; Mon, 21 Jan 2019 16:33:49 +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.9 required=2.0 tests=BAYES_00,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 EAD2729385 for ; Mon, 21 Jan 2019 16:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729870AbfAUQdr (ORCPT ); Mon, 21 Jan 2019 11:33:47 -0500 Received: from mx2.suse.de ([195.135.220.15]:46356 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730522AbfAUQdq (ORCPT ); Mon, 21 Jan 2019 11:33:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DBC09AFA3 for ; Mon, 21 Jan 2019 16:33:44 +0000 (UTC) Received: from starscream.home.jeffm.io (starscream-1.home.jeffm.io [IPv6:2001:559:c0d4::1fe]) by mail.home.jeffm.io (Postfix) with ESMTPS id A7CEC81AD3EF; Mon, 21 Jan 2019 11:31:58 -0500 (EST) Received: by starscream.home.jeffm.io (Postfix, from userid 1000) id 46C1A265DB1; Mon, 21 Jan 2019 11:33:42 -0500 (EST) From: jeffm@suse.com To: fstests@vger.kernel.org Cc: Jeff Mahoney Subject: [PATCH 7/7] check: move test exclusion handling to _prepare_test_list Date: Mon, 21 Jan 2019 11:33:16 -0500 Message-Id: <20190121163316.20616-7-jeffm@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190121163316.20616-1-jeffm@suse.com> References: <20190121163316.20616-1-jeffm@suse.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jeff Mahoney In order to simplify combining excluded tests specified on the command line vs specified via config files, it makes sense to push the handling into _prepare_test_list. This means we start with a fresh $tmp.xlist and rebuild it each time _prepare_test_list is called. Signed-off-by: Jeff Mahoney --- check | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/check b/check index 77a06b00..17073c4e 100755 --- a/check +++ b/check @@ -230,7 +230,28 @@ _prepare_test_list() done fi - # Specified groups to exclude + :> $tmp.xlist + + # Per-fstype/generic/shared file of tests to exclude (-X) + for xfile in $XGROUP_FILES; do + for d in $SRC_GROUPS $FSTYP; do + [ -f $SRC_DIR/$d/$xfile ] || continue + for f in `sed "s/#.*$//" $SRC_DIR/$d/$xfile`; do + echo "$d/$f command line" >> $tmp.xlist + done + done + done + + # External file of tests to exclude (-E) + for xfile in $EXCLUDE_FILES; do + if [ -f $xfile ]; then + sed -e "s/#.*$//" \ + -e "s;$; file $xfile;" "$xfile" \ + >> $tmp.xlist + fi + done + + # Specified groups to exclude (-x) for xgroup in $XGROUP_LIST; do list=$(get_group_list $xgroup) if [ -z "$list" ]; then @@ -273,13 +294,8 @@ while [ $# -gt 0 ]; do XGROUP_LIST="$XGROUP_LIST ${xgroup//,/ }" ;; - -X) subdir_xfile=$2; shift ; - ;; - -E) xfile=$2; shift ; - if [ -f $xfile ]; then - sed "s/#.*$//" "$xfile" >> $tmp.xlist - fi - ;; + -X) XGROUP_FILES="$XGROUP_FILES $2" ; shift ;; + -E) EXCLUDE_FILES="$EXCLUDE_FILES $2" ; shift ;; -s) RUN_SECTION="$RUN_SECTION $2"; shift ;; -S) EXCLUDE_SECTION="$EXCLUDE_SECTION $2"; shift ;; -l) diff="diff" ;; @@ -320,15 +336,6 @@ if ! . ./common/rc; then exit 1 fi -if [ -n "$subdir_xfile" ]; then - for d in $SRC_GROUPS $FSTYP; do - [ -f $SRC_DIR/$d/$subdir_xfile ] || continue - for f in `sed "s/#.*$//" $SRC_DIR/$d/$subdir_xfile`; do - echo $d/$f >> $tmp.xlist - done - done -fi - # Process tests from command line now. if $have_test_arg; then while [ $# -gt 0 ]; do