From patchwork Wed Sep 25 13:24:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 11160671 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F062714DB for ; Wed, 25 Sep 2019 13:24:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8E7021D80 for ; Wed, 25 Sep 2019 13:24:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406136AbfIYNYu (ORCPT ); Wed, 25 Sep 2019 09:24:50 -0400 Received: from foss.arm.com ([217.140.110.172]:49384 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406133AbfIYNYu (ORCPT ); Wed, 25 Sep 2019 09:24:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9616F142F; Wed, 25 Sep 2019 06:24:49 -0700 (PDT) Received: from e120937-lin.cambridge.arm.com (e120937-lin.cambridge.arm.com [10.1.197.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E33703F59C; Wed, 25 Sep 2019 06:24:48 -0700 (PDT) From: Cristian Marussi To: linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, shuah@kernel.org Cc: dave.martin@arm.com Subject: [PATCH 1/2] kselftest: add capability to skip chosen TARGETS Date: Wed, 25 Sep 2019 14:24:20 +0100 Message-Id: <20190925132421.23572-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Let the user specify an optional TARGETS skiplist through the new optional SKIP_TARGETS Makefile variable. It is easier to skip at will a reduced and well defined list of possibly problematic targets with SKIP_TARGETS then to provide a partially stripped down list of good targets using the usual TARGETS variable. Signed-off-by: Cristian Marussi --- tools/testing/selftests/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 25b43a8c2b15..103936faa46d 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -132,6 +132,10 @@ else ARCH=$(ARCH) -C $(top_srcdir) headers_install endif +# User can optionally provide a TARGETS skiplist. +SKIP_TARGETS ?= +TARGETS := $(filter-out $(SKIP_TARGETS), $(TARGETS)) + all: khdr @for TARGET in $(TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ From patchwork Wed Sep 25 13:24:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 11160673 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B44C914DB for ; Wed, 25 Sep 2019 13:24:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CA2621D7C for ; Wed, 25 Sep 2019 13:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406161AbfIYNYv (ORCPT ); Wed, 25 Sep 2019 09:24:51 -0400 Received: from foss.arm.com ([217.140.110.172]:49392 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406133AbfIYNYu (ORCPT ); Wed, 25 Sep 2019 09:24:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7B42F1596; Wed, 25 Sep 2019 06:24:50 -0700 (PDT) Received: from e120937-lin.cambridge.arm.com (e120937-lin.cambridge.arm.com [10.1.197.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C91DF3F59C; Wed, 25 Sep 2019 06:24:49 -0700 (PDT) From: Cristian Marussi To: linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, shuah@kernel.org Cc: dave.martin@arm.com Subject: [PATCH 2/2] kselftest: exclude failed TARGETS from runlist Date: Wed, 25 Sep 2019 14:24:21 +0100 Message-Id: <20190925132421.23572-2-cristian.marussi@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190925132421.23572-1-cristian.marussi@arm.com> References: <20190925132421.23572-1-cristian.marussi@arm.com> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org A TARGET which failed to be built/installed should not be included in the runlist generated inside the run_kselftest.sh script. Signed-off-by: Cristian Marussi --- As an example, here BPF failed to compile but was included in the runlist and attempted to run anyway: ... ./KSFT_LAST_2/run_kselftest.sh: 37: cd: can't cd to bpf TAP version 13 1..49 \# selftests: KSFT_LAST_2: test_verifier \# Warning: file test_verifier is missing! not ok 1 selftests: KSFT_LAST_2: test_verifier \# selftests: KSFT_LAST_2: test_tag \# Warning: file test_tag is missing! --- tools/testing/selftests/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 103936faa46d..e11ace11b07c 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -202,8 +202,12 @@ ifdef INSTALL_PATH echo " cat /dev/null > \$$logfile" >> $(ALL_SCRIPT) echo "fi" >> $(ALL_SCRIPT) + @# While building run_kselftest.sh skip also non-existent TARGET dirs: + @# they could be the result of a build failure and should NOT be + @# included in the generated runlist. for TARGET in $(TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ + [ ! -d $$INSTALL_PATH/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \ echo "[ -w /dev/kmsg ] && echo \"kselftest: Running tests in $$TARGET\" >> /dev/kmsg" >> $(ALL_SCRIPT); \ echo "cd $$TARGET" >> $(ALL_SCRIPT); \ echo -n "run_many" >> $(ALL_SCRIPT); \