Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1843062ybn; Thu, 26 Sep 2019 03:05:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqw27/ssaQuHBz2VFtE2tyvYSMZeD7ucaLfFL7IT9uIOKqqC2lqmzVtwjbupzY8CjLBNPocn X-Received: by 2002:a50:9438:: with SMTP id p53mr2596203eda.291.1569492325235; Thu, 26 Sep 2019 03:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569492325; cv=none; d=google.com; s=arc-20160816; b=V1th3XqjkBHswb/lbAsfhvEZbkdqre51PZ23Kp14m5GSR1d7nB7uC0ZVofTRLmvJrI z6ZMpBlPL+d3US5EYiKgf3biHd3JfE1qYCJl8hRdohdAvcGqjKdYo6qgqO9BcxDLE4qa cHWJd+wOfAPI+ggbBx6a5d3/L1iQZ5Mby4LDzBJtNDvL6nnipLRVdH5tBQAzW6yssRef OAg+3v2PokUMuDw52R37d+KXDQTPkBW3qDbwJGWbENO68dYY2YxY1VJJDIgkW6zeMsyd ciNFQ1GWs5SpIg3D4jlUxZwrpB0HCNgjTUEqHKnVB7Cu+6xHws0P1ZzzAKGbBypsRUOR yU1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1YMz9ksrdQ7cPPABsA09urm67yr9R6IZjmvoUPzxwJQ=; b=goSyzY0a/ZkOUgfj1yf4rp+unJwgrCfvySebp8GDWIQRobWKORvgKxUZvqBqSKhIH7 3rlQk2QzotFA4uhFL5xBRM2bjw6n8U2SwvqgXwBXKlF2xUzqePIyf81HfpvyPjrvkkwz g0ErWPVeFN8jdEJWyom1CCbqgSfExDiOOjQTtM7UrGx73SjD7UpPYbAhQ8e0+a8Y7YgA +PhrdLW4tRD+6agjBiFt8zUJU6qDLO7z1DLa3ONh25xqZHJgmD0zoDkXuhAzD9ICI7l+ hdq/7g/0TXL3pCpgSegzpdWXNpgEHW5Olf/oQ/qpoFG/zQ/CuT6tD3hev4zCh7N4y6Rf sM+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=iXN5gYJ5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a36si1042032edf.123.2019.09.26.03.05.01; Thu, 26 Sep 2019 03:05:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=iXN5gYJ5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731163AbfIYXFL (ORCPT + 99 others); Wed, 25 Sep 2019 19:05:11 -0400 Received: from mail-io1-f41.google.com ([209.85.166.41]:42321 "EHLO mail-io1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731106AbfIYXFJ (ORCPT ); Wed, 25 Sep 2019 19:05:09 -0400 Received: by mail-io1-f41.google.com with SMTP id n197so1296989iod.9 for ; Wed, 25 Sep 2019 16:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1YMz9ksrdQ7cPPABsA09urm67yr9R6IZjmvoUPzxwJQ=; b=iXN5gYJ5HULpGN4jiBNeGuKrRsjjPCDh0f9k1OxW4Nd2WYGpXycEP3lfZM7IOa5V7u zt9TqVjh2B9U+yS6H3EZEzn/YQrfGuLWwf5fAhfYC+MY1xW744IuTr1tyfLVi9r881CN Mv+6lnH86+wahkV4TiXZQFpSCgltvSkdS2irA= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=1YMz9ksrdQ7cPPABsA09urm67yr9R6IZjmvoUPzxwJQ=; b=oIvbDpWADzpegpGSQA6QXJs/7aT4OmpWr21kFDqfvJpmdRURXKgLkT3eZ81ekycuCL Q5MbkNK48+PqfT5o3vyjOdaQDMGV4ps4XTs2vua+FSVMdoVQcvFZRhmhgt34UqlSCLNo 0EVKd5eog6nNJN1D00pjjfY4+90zfnqJ0ujBGPo2kYYiHTbcbq2CwVzSmSDhU375PGwN lVUdiGtO8wrZ3jRlzzOIoVCOEi1o6nGMwsvN7/ohANHDS1Q6ZWi7LX5UTGZ8gIRD0lxX 9u9WsuSdJo9yU0NiQGY18eHMWDhJHcJZ6/ud26SdBJWC2VI0fJNtD4vNUhQyLfufF3BQ 0/yg== X-Gm-Message-State: APjAAAUeK2Z/cfhX2J1axaBPWuaUs+jZap0kqpf30/jsMfkHJUgseDR8 scRGIFYa8G3RN9OxjWiTken8M5gk3HI= X-Received: by 2002:a5d:9a16:: with SMTP id s22mr521750iol.79.1569452709196; Wed, 25 Sep 2019 16:05:09 -0700 (PDT) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id f23sm70767ioc.36.2019.09.25.16.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 16:05:08 -0700 (PDT) From: Shuah Khan To: yamada.masahiro@socionext.com, michal.lkml@markovi.net, shuah@kernel.org Cc: Shuah Khan , linux-kbuild@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] selftests: Add kselftest_install target to main Makefile Date: Wed, 25 Sep 2019 17:04:35 -0600 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add kselftest_install target to install tests from the top level Makefile. This is to simplify kselftest use-cases for CI and distributions where build and test systems are different. This change addresses requests from developers and testers to add support for installing kselftest from the main Makefile. In addition, make the install directory the same when install is run using "make kselftest_install" or by running kselftest_install.sh. Also fix the INSTALL_PATH variable conflict between main Makefile. Signed-off-by: Shuah Khan --- Makefile | 4 ++++ tools/testing/selftests/Makefile | 8 ++++++-- tools/testing/selftests/kselftest_install.sh | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ac4af6fc4b50..65c62af6b6fa 100644 --- a/Makefile +++ b/Makefile @@ -1241,6 +1241,10 @@ PHONY += kselftest kselftest: $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests +PHONY += kselftest_install +kselftest_install: + $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests install + PHONY += kselftest-clean kselftest-clean: $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests clean diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index c3feccb99ff5..bad18145ed1a 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -171,9 +171,12 @@ run_pstore_crash: # 1. output_dir=kernel_src # 2. a separate output directory is specified using O= KBUILD_OUTPUT # 3. a separate output directory is specified using KBUILD_OUTPUT +# Avoid conflict with INSTALL_PATH set by the main Makefile # -INSTALL_PATH ?= $(BUILD)/install -INSTALL_PATH := $(abspath $(INSTALL_PATH)) +KSFT_INSTALL_PATH ?= $(BUILD)/kselftest_install +KSFT_INSTALL_PATH := $(abspath $(KSFT_INSTALL_PATH)) +# Avoid changing the rest of the logic here and lib.mk. +INSTALL_PATH := $(KSFT_INSTALL_PATH) ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh install: all @@ -203,6 +206,7 @@ ifdef INSTALL_PATH 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); \ + echo -n "Emit Tests for $$TARGET\n"; \ $(MAKE) -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ echo "" >> $(ALL_SCRIPT); \ echo "cd \$$ROOT" >> $(ALL_SCRIPT); \ diff --git a/tools/testing/selftests/kselftest_install.sh b/tools/testing/selftests/kselftest_install.sh index ec304463883c..e2e1911d62d5 100755 --- a/tools/testing/selftests/kselftest_install.sh +++ b/tools/testing/selftests/kselftest_install.sh @@ -24,12 +24,12 @@ main() echo "$0: Installing in specified location - $install_loc ..." fi - install_dir=$install_loc/kselftest + install_dir=$install_loc/kselftest_install # Create install directory mkdir -p $install_dir # Build tests - INSTALL_PATH=$install_dir make install + KSFT_INSTALL_PATH=$install_dir make install } main "$@" -- 2.20.1