From nobody Fri Dec 19 20:32:57 2025 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86F0921516A; Thu, 27 Feb 2025 05:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740634423; cv=none; b=rRNQ9cWvOondOgsGHVIYfnj75/7/OFCcQl+NJtLSyZX4AHlTHMdCpZzTZB1qOQGbzT4dbXpAAxVkS12u2r+QJ2xv+MkNtURX+ydt72DfRuU8xUFEmxMC0CznRvrQS/cLR5KygQ12GedMPEn5Yqu4kGYkrke4sKSjSXY6zirxyE4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740634423; c=relaxed/simple; bh=sC4ubW5+4kwXtzdRZ2/gkUGH9C3VuwXIxvenwdxk2Xw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QxDxAcxj3H0IdO9mttNBdZ95O/4jni2y1MGzffnpa2taDueXdaDeU0f7ZNguQ5KYahtpjijx2JP9KkSHffikro460veBhnozb22yM6UiN4LMBpNwxTbTwSLHV43/ejUQdv6YqUG5MJ8MpS3nmjE9ENF60bu86hZ0QrGyIpZ2aks= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Crr1zbRG; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Crr1zbRG" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2fea47bcb51so798474a91.2; Wed, 26 Feb 2025 21:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740634420; x=1741239220; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I6z2b2XULHZzaJQ7AgE9rinHdmnWflM2T2Agc5PlDtQ=; b=Crr1zbRG0gkcR5cLy8MTvh2B1QLP7PNU4CqvyRLMotU3hwMKL8zAGrJ3+VBSJLE8/H BY96/Q3NrYDXDBoBKqm84A826BvOYBuHto7vxADYjksWSsd1ASt1yUPH7IpRtpyd89bJ K9zlnEYFf5yXH7LYdXoc0jZ6ODPaUTpa3iTX6GNU5BjPeAsNRveAeXf5UKEzfQ3djh7B 25InZhL6nYI8i3Tj6EkVnOjd/J8NmPDFpsb6aPSUAeOJP7adUJErPGHVkW0LbJTUsMCi vk9h5lI//qYMlBY0/2eNOx7NbRpNTDpGaCwHD8RrWx9NM+CGQok4kXAJzI8cfwla1B2b nZ+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740634420; x=1741239220; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I6z2b2XULHZzaJQ7AgE9rinHdmnWflM2T2Agc5PlDtQ=; b=uY+cwIPFf/RdetN5GXMrD0J58yeqRNQ2zv8BYLY05Pxv5bb6dvxFsOajf4KAwPdM7a rxRsYwefemumklfl5S8JCW9DNiLXGibxrgOygH2jgwO2R6Sz4pgaStKpPxSigAR81spD 4thMaP7SypCyTZwlNV26HFUAaZv4Fdi7cL3BWI2jMoMC/nzDmQaJKB0QokevJvPVYFKp 3b6RohVtoduyxzGwlyg/hDtaqyuVPHI8ADBMS0VCZ55hOSFZJw24FZ6fmwjqIm8SHkke a2578OissmTHWC+Hz0UGAq+VMa078HXqob5q1BAPafWd0FHfdaGslJmRGVbptyP3cwNH EYfw== X-Forwarded-Encrypted: i=1; AJvYcCV/N0VB9ETuTyhOLDadmH0KmtsFwhXmPtnghKiIO8PnFD2PKDelq8AWsVJhpsbmvxiWPNMGJxZmpVjxw9M=@vger.kernel.org X-Gm-Message-State: AOJu0Yxz5ZGkFoAbYTJgjAIZVLEVDvEIrFgZgIuOePGU+TIEpwVPyM6g 43Ashw+j8PkGHZuIiWhIeFnsPUncSNXLywDOzkv/0lQ7Ziwa4Wggt6eYxVY9bn4= X-Gm-Gg: ASbGncvMSvPEfw9L2HDnPTCC+TIjolBNPWtqKsMH11kuSbFHZdkTMoaoPCKwrrgZLEW TeU2MByWIyXxum6EL+RUf3HlxzeoWZ64EccjJriV0lNYDhUzpgSr5R+WLvDITGFL2ffFtYhkV8I fDfddB9jno72LIbHLZqQMOyghi2T+0RqMAmV9+3H5R/TSdMvmct4LZpfwx+KqgqRCg/0qmyN3Is iWFHzuhUkFDCDW5XA8KmuZ2QqL1tvTY7kEhPGCnV7xDlOD4LenJ5D5a/fcC3V47bxcHltybimf2 2N6Ezxry8Op1aoRu/slrtq363RLReUVpbWVCJH7nDfI= X-Google-Smtp-Source: AGHT+IEcq/QunsKuPH1Q3YVPdIlIf7+yGkD/KLS5diiz1gkkypvEoKGl1k0osNyRJJabEJm7/UPz4g== X-Received: by 2002:a17:90b:4acf:b0:2fe:a614:5cf7 with SMTP id 98e67ed59e1d1-2fea6145e8fmr1937828a91.3.1740634420550; Wed, 26 Feb 2025 21:33:40 -0800 (PST) Received: from fedora.am.students.amrita.edu ([123.63.2.2]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2fea6753143sm582407a91.4.2025.02.26.21.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2025 21:33:40 -0800 (PST) From: Siddharth Menon To: linux-kselftest@vger.kernel.org, shuah@kernel.org Cc: skhan@linuxfoundation.org, pmladek@suse.com, mbenes@suse.cz, linux-kernel@vger.kernel.org, Siddharth Menon Subject: [PATCH v3 1/2 RESEND] selftests: Introduce script to validate required dependencies Date: Thu, 27 Feb 2025 10:59:26 +0530 Message-ID: <20250227053322.114215-2-simeddon@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250227053322.114215-1-simeddon@gmail.com> References: <20250227053322.114215-1-simeddon@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch adds a script to validate that the current kernel configuration satisfies the requirements for selftests by comparing the current kernel configs against the required selftest configs. The script also runs kselftest_deps.sh to check for any missing libraries required by the selftest. A config mismatch exits with error value 1 while matching configs or missing config files exit with value 0. In order to silence missing dependency output, set the environment variable SILENCE=3D1. The code for extracting the current kernel configs is adapted from scripts/kconfig/streamline_config.pl. Suggested-by: Petr Mladek Suggested-by: Miroslav Benes Signed-off-by: Siddharth Menon --- v1->v2: - check selftest/config directly rather than a separate set in the test makefile v2->v3: - Integrate kselftest_deps.sh to check for missing libraries (I have not set it to skip the tests here, as it sometimes throws outputs such as missing $(LIB) or $(MNL_LDLIBS)) - Replaced spaces with tabs, removed trailing spaces and other minor formatting changes - Introduced flag to silence the missing dependencies debug statements - Rename script to a more meaningful name =20 .../testing/selftests/check_kselftest_deps.pl | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100755 tools/testing/selftests/check_kselftest_deps.pl diff --git a/tools/testing/selftests/check_kselftest_deps.pl b/tools/testin= g/selftests/check_kselftest_deps.pl new file mode 100755 index 000000000000..ef1a5fe8c321 --- /dev/null +++ b/tools/testing/selftests/check_kselftest_deps.pl @@ -0,0 +1,170 @@ +#!/usr/bin/env perl +# SPDX-License-Identifier: GPL-2.0 +use warnings; +use strict; +use Getopt::Long; +use File::Spec; +use File::Basename; + +# set the environment variable SILENCE to silence +# debug output. + +# Check if required arguments are provided +die "Usage: $0 \n" unless @ARGV >=3D 2; + +my $test_path =3D $ARGV[0]; +my $cc =3D join(' ', @ARGV[1..$#ARGV]); +my $script_dir =3D dirname(__FILE__); + +my $silenceprint; +$silenceprint =3D 1 if (defined($ENV{SILENCE})); + +sub dprint { + return if ($silenceprint); + print STDERR @_; +} + +my $uname =3D `uname -r`; +chomp $uname; + +my @searchconfigs =3D ( + { + "file" =3D> ".config", + "exec" =3D> "cat", + }, + { + "file" =3D> "/proc/config.gz", + "exec" =3D> "zcat", + }, + { + "file" =3D> "/boot/config-$uname", + "exec" =3D> "cat", + }, + { + "file" =3D> "/boot/vmlinuz-$uname", + "exec" =3D> "scripts/extract-ikconfig", + "test" =3D> "scripts/extract-ikconfig", + }, + { + "file" =3D> "vmlinux", + "exec" =3D> "scripts/extract-ikconfig", + "test" =3D> "scripts/extract-ikconfig", + }, + { + "file" =3D> "/lib/modules/$uname/kernel/kernel/configs.ko", + "exec" =3D> "scripts/extract-ikconfig", + "test" =3D> "scripts/extract-ikconfig", + }, + { + "file" =3D> "/lib/modules/$uname/build/.config", + "exec" =3D> "cat", + }, + { + "file" =3D> "kernel/configs.ko", + "exec" =3D> "scripts/extract-ikconfig", + "test" =3D> "scripts/extract-ikconfig", + }, + { + "file" =3D> "kernel/configs.o", + "exec" =3D> "scripts/extract-ikconfig", + "test" =3D> "scripts/extract-ikconfig", + }, +); + +sub read_config { + foreach my $conf (@searchconfigs) { + my $file =3D $conf->{"file"}; + + next unless -f $file; + + if (defined $conf->{"test"}) { + `$conf->{"test"} $file 2>/dev/null`; + next if $?; + } + + my $exec =3D $conf->{"exec"}; + + # dprint "Kernel config: '$file'\n"; + + open(my $infile, '-|', "$exec $file") or die "Failed to run $exec $file"; + my @config_content =3D <$infile>; + close $infile; + + return @config_content; + } + + dprint "Unable to find kernel config file, skipping check\n"; + exit 0; +} + +sub check_libs { + my $command =3D "cd $script_dir && ./kselftest_deps.sh \"$cc\" $test_path= "; + my $lib_test =3D `$command 2>&1`; + my $exit_code =3D $? >> 8; + + if ($exit_code !=3D 0) { + die "Error: Failed to run kselftest_deps.sh with exit code $exit_code\n"; + } + + return $lib_test; +} + +# Check for missing libraries +my $lib_test =3D check_libs(); +my $fail_libs; + +if ($lib_test =3D~ +/(--------------------------------------------------------\s +*Missing libraries system.*? +--------------------------------------------------------)/s) { + $fail_libs =3D $1; +} + +dprint("$fail_libs\n") if $fail_libs; + +# Read and parse kernel config +my @config_file =3D read_config(); +my %kern_configs; +foreach my $line (@config_file) { + chomp $line; + next if $line =3D~ /^\s*$/ || $line =3D~ /^#/; + + if ($line =3D~ /^(CONFIG_\w+)=3D(.+)$/) { + $kern_configs{$1} =3D $2; + } +} + +# Read and parse test config +my %test_configs; +open(my $fh, '<', "$test_path/config") or exit 0; + +while (my $line =3D <$fh>) { + chomp $line; + next if $line =3D~ /^\s*$/ || $line =3D~ /^#/; + + if ($line =3D~ /^(CONFIG_\w+)=3D(.+)$/) { + $test_configs{$1} =3D $2; + } +} +close $fh; + +# Compare selftest configs with kernel configs +my $all_match =3D 1; +my @missing_or_mismatched; + +foreach my $key (keys %test_configs) { + if (!exists $kern_configs{$key} || $kern_configs{$key} ne $test_configs{$= key}) { + push @missing_or_mismatched, "Required: $key=3D$test_configs{$key}"; + $all_match =3D 0; + } +} + +if ($all_match && !$fail_libs) { + exit 0; +} else { + dprint("--------------------------------------------------------\n") unle= ss $fail_libs; + dprint("$_\n") for @missing_or_mismatched; + dprint("--------------------------------------------------------\n") if @= missing_or_mismatched; + + exit 1; +} --=20 2.48.1 From nobody Fri Dec 19 20:32:57 2025 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D94D2153EA; Thu, 27 Feb 2025 05:33:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740634426; cv=none; b=F4mFxYnsp7RlVwGyj732knF1r2dCscYZs08F6rjWP6EwMdRV1krkebRUT9rVG3VygyE8akwc3dYleJpJW8ZXet2r8P133dpTNymloQ2OtzZP18R+5QhX1FBPpw/hwqzpX3YsIdF8VnKxnV+XY3YYRlN0FYA5PBUBE7AqmpTU//s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740634426; c=relaxed/simple; bh=GzkEP80bc+2j9R7ea6A+JgaA7IWEDxVPCLy+hvQ9hAI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EOc80hEihXKNGHwN0ZzKqvgPo5SFRH4rnVoEibKTExBn4YkO0jldKZsj5AiR6ntpo67s+hchN79r9iU6Dsc3YGWAOcJGO6X27Dhwchh8i8Iz6cuaVEiw4KhJXiI1au4ZYwX78ALqSgsGXASaGjrT2vppL55j9GGJ24MKHEe9Qhk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NHHWHuAo; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NHHWHuAo" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2fbffe0254fso1213900a91.3; Wed, 26 Feb 2025 21:33:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740634424; x=1741239224; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=reYQ3kEdxRIcp+AlEGxe4/u4x5hxYLbz2KdG4kcg/Bg=; b=NHHWHuAolFz4Ijwwa/ohaj9zJ5TkbUEppfOWPw1sSOBkL/Kv1xTAT3uZKPbfm4c0hL DizfrFfTPfnuzTv6N13Oqw5+7OQfW2y2xfnhSUMe5F1ABm1TTu4Do/Y1Etl6FwvqD1eE kfiCfJW0tDLTbDwGI0N9BZbDrgHJUJa2Xi2cUH3qEqsRT1xIdjsn2kEq37eLRsMAbAU6 ZseoXEk6I7StymvUn0xdJ0TKLKPs4oyZVsw07zmBlitC+yFG7FgxfkAQCo2ddkKVMZlX tR0lpDfXXmDNJjYmI7dG/Rstvd0aMTgS9+yihk/pZB3wFYmwEkHw5w/ycsm35GopmMDA 9icA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740634424; x=1741239224; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=reYQ3kEdxRIcp+AlEGxe4/u4x5hxYLbz2KdG4kcg/Bg=; b=lBmL5iVD53KNB/BLU4NWj8o+DC6nWNoGkTAgdGrFkJDJz0S0TifqdWYxFpqZpVDKgJ /Ujd7hvKM1TJ+WlwiMApjeQtG10RBCqPyIt/9V6ERX61c3gGQZJavBJN8ewS5d1rPBiL pvHCuxPmqR4pDWiIc6CEIxVe6KKlm47JJnDbvwrRrMZOi2x8FXsv2WGIy3Y6H0WpkTDi Oz785D+MM0beDlKiWV7k5L3Vtt/Lmv6uiN+xtnEefVIwhfuL5VHhxE6LlwwXFg9Na55w B5QHaJzymSdNufbsc6fCxVKQQmIbTvkAWd+j7l5hTrHz6iuqDm1R6l8VkIzlGPUTrsej +nLQ== X-Forwarded-Encrypted: i=1; AJvYcCU1zHTWhyd3wqJ1bLP79BFq6kfoe+8+OzrBwp3cFIeLOQhKkp3nCGWrwaGLSJ/il1OYb92F8+p7UxHAxkQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwWtrKXmc9uGbMv6CL2CrMRs85+Oj6lhLzlvUPvqv3hB6PAU761 HhIKFTlPwakUmZ0S1qGt2FWF3Jx70Q7LogV5Ns+U+9hIhL+ufk3ibK8WMk8zBw0= X-Gm-Gg: ASbGnctMUQ2lJXN/lEiq2ch/yldUgwRVkpyTZieBXlqInuV7zHsyy2g+teGJBPYC4d7 OmJNxxflHTO8wpaoMl1WU+SzzV+Lqei1UdecEFMNNO19xUCXii/NS0hD/FCAfqTsPQ6vJqAgCkR zrFGq6GSuhdgOWgVzLMluloTuQjZu9+W5s+ZtMp5jpVenIu5oTrlLSL7aLrTMhD1lyvH6zgj82v TBB9r1O6DtnA4oJh2j9F3W1EZOaHn4HUmuW4P8nRAGExINmXmi1dVgxhu9++If/n009XJaEhpAW 69w1ODZelXs71oY7ych21CDSC5il6V7RasJoZEnKswk= X-Google-Smtp-Source: AGHT+IFBTfT+rXScplEGZOSqbKB16z8kFYvuSlvRtid2M/w3rf9uNa3iNQPcokIirQ03KU0lGrh0Vw== X-Received: by 2002:a17:90b:2e0d:b0:2fa:17d2:166 with SMTP id 98e67ed59e1d1-2fe7e3b14cbmr8974123a91.31.1740634424211; Wed, 26 Feb 2025 21:33:44 -0800 (PST) Received: from fedora.am.students.amrita.edu ([123.63.2.2]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2fea6753143sm582407a91.4.2025.02.26.21.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2025 21:33:43 -0800 (PST) From: Siddharth Menon To: linux-kselftest@vger.kernel.org, shuah@kernel.org Cc: skhan@linuxfoundation.org, pmladek@suse.com, mbenes@suse.cz, linux-kernel@vger.kernel.org, Siddharth Menon Subject: [PATCH v3 2/2] selftests/lib.mk: Introduce check to validate required dependencies Date: Thu, 27 Feb 2025 10:59:27 +0530 Message-ID: <20250227053322.114215-3-simeddon@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250227053322.114215-1-simeddon@gmail.com> References: <20250227053322.114215-1-simeddon@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently, kselftests does not have a generalised mechanism to skip compila= tion and run tests when required kernel configuration flags are missing. This patch introduces a check to validate the presence of required config f= lags specified in the selftest config files. In case scripts/config or the curre= nt kernel config is not found, this check is skipped. In order to skip checking for config options required to compile the test, set the environment variable SKIP_CHECKS=3D1. example usage: ``` make SKIP_CHECKS=3D1 -C livepatch/ ``` Suggested-by: Petr Mladek Suggested-by: Miroslav Benes Signed-off-by: Siddharth Menon --- v1->v2: - Moved the logic to check for required configurations to an external script v2 -> v3: - Add SKIP_CHECKS flag to skip checking the dependencies if required - Updated the test skip statement to be more meaningful =20 tools/testing/selftests/lib.mk | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index d6edcfcb5be8..0e11d1d3bab8 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -97,7 +97,18 @@ TEST_GEN_PROGS :=3D $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_= PROGS)) TEST_GEN_PROGS_EXTENDED :=3D $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXT= ENDED)) TEST_GEN_FILES :=3D $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) =20 -all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) \ +TEST_DIR :=3D $(shell pwd) + +check_kselftest_deps: +ifneq ($(SKIP_CHECKS),1) + @$(selfdir)/check_kselftest_deps.pl $(TEST_DIR) $(CC) || { \ + echo "Skipping test: $(notdir $(TEST_DIR)) (missing required kernel feat= ures)"; \ + exit 1; \ + } +endif + + +all: check_kselftest_deps $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(T= EST_GEN_FILES) \ $(if $(TEST_GEN_MODS_DIR),gen_mods_dir) =20 define RUN_TESTS @@ -228,4 +239,4 @@ $(OUTPUT)/%:%.S $(LINK.S) $^ $(LDLIBS) -o $@ endif =20 -.PHONY: run_tests all clean install emit_tests gen_mods_dir clean_mods_dir +.PHONY: run_tests all clean install emit_tests gen_mods_dir clean_mods_dir= check_kselftest_deps --=20 2.48.1