summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2025-07-18 16:18:43 -0400
committerSteven Rostedt <rostedt@goodmis.org>2025-07-21 16:31:04 -0400
commitacd98e230ee86a9812c56a081929248cdbe412fa (patch)
treef599c199064bd48da82b51b7a6a6e380a323fa0c
parent3bcdb6e90c9f5403e764dc9cdbe7907026de59a0 (diff)
ktest.pl: Have -D option work without a space
Allow -DBUILD_TYPE=boot work the same as -D BUILD_TYPE=boot just like normal single character option does in most applications. Cc: "John Warthog9 Hawley" <warthog9@kernel.org> Cc: Dhaval Giani <dhaval.giani@gmail.com> Cc: Greg KH <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/20250718202053.567246162@kernel.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rwxr-xr-xtools/testing/ktest/ktest.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 7b94b9b83ee7..95e62929cda7 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -4297,6 +4297,15 @@ while ( $#ARGV >= 0 ) {
$command_vars[$#command_vars + 1] = $val;
}
+ } elsif ( $ARGV[0] =~ m/^-D(.*)/) {
+ my $val = $1;
+ shift;
+
+ if ($val =~ m/(.*?):=(.*)$/) {
+ set_variable($1, $2, 1);
+ } else {
+ $command_vars[$#command_vars + 1] = $val;
+ }
} elsif ( $ARGV[0] eq "-h" ) {
die_usage;
} else {