ktest updates for v6.9:
- Allow variables to contain variables. This makes the shell commands have a bit more flexibility to reuse existing variables. - Have make_warnings_file in build-only mode require limited variables The make_warnings_file test will create a file with all existing warnings (which can be used to compare against in builds with new commits). Add it to the build-only list that doesn't require other variables (like how to reset a machine), as the make_warnings_file makes the most sense on build only tests. -----BEGIN PGP SIGNATURE----- iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCZfhlQRQccm9zdGVkdEBn b29kbWlzLm9yZwAKCRAp5XQQmuv6qoLnAP0XUeKMKV9JN1ayPUdQoN0stsseVLmt W+O0lowXVj3JWwD/d8mTVFVQHJ7zcmJQ3LJ/+daUmULjYX8daWGmVWYSyAg= =PMaK -----END PGP SIGNATURE----- Merge tag 'ktest-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest Pull ktest updates from Steven Rostedt: - Allow variables to contain variables. This makes the shell commands have a bit more flexibility to reuse existing variables. - Have make_warnings_file in build-only mode require limited variables The make_warnings_file test will create a file with all existing warnings (which can be used to compare against in builds with new commits). Add it to the build-only list that doesn't require other variables (like how to reset a machine), as the make_warnings_file makes the most sense on build only tests. * tag 'ktest-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest: force $buildonly = 1 for 'make_warnings_file' test type ktest.pl: Process variables within variables
This commit is contained in:
commit
65b64246f2
@ -792,13 +792,13 @@ sub process_variables {
|
|||||||
my $retval = "";
|
my $retval = "";
|
||||||
|
|
||||||
# We want to check for '\', and it is just easier
|
# We want to check for '\', and it is just easier
|
||||||
# to check the previous characet of '$' and not need
|
# to check the previous character of '$' and not need
|
||||||
# to worry if '$' is the first character. By adding
|
# to worry if '$' is the first character. By adding
|
||||||
# a space to $value, we can just check [^\\]\$ and
|
# a space to $value, we can just check [^\\]\$ and
|
||||||
# it will still work.
|
# it will still work.
|
||||||
$value = " $value";
|
$value = " $value";
|
||||||
|
|
||||||
while ($value =~ /(.*?[^\\])\$\{(.*?)\}(.*)/) {
|
while ($value =~ /(.*?[^\\])\$\{([^\{]*?)\}(.*)/) {
|
||||||
my $begin = $1;
|
my $begin = $1;
|
||||||
my $var = $2;
|
my $var = $2;
|
||||||
my $end = $3;
|
my $end = $3;
|
||||||
@ -818,16 +818,20 @@ sub process_variables {
|
|||||||
# we simple convert to 0
|
# we simple convert to 0
|
||||||
$retval = "${retval}0";
|
$retval = "${retval}0";
|
||||||
} else {
|
} else {
|
||||||
# put back the origin piece.
|
# put back the origin piece, but with $#### to not reprocess it
|
||||||
$retval = "$retval\$\{$var\}";
|
$retval = "$retval\$####\{$var\}";
|
||||||
# This could be an option that is used later, save
|
# This could be an option that is used later, save
|
||||||
# it so we don't warn if this option is not one of
|
# it so we don't warn if this option is not one of
|
||||||
# ktests options.
|
# ktests options.
|
||||||
$used_options{$var} = 1;
|
$used_options{$var} = 1;
|
||||||
}
|
}
|
||||||
$value = $end;
|
$value = "$retval$end";
|
||||||
|
$retval = "";
|
||||||
}
|
}
|
||||||
$retval = "$retval$value";
|
$retval = $value;
|
||||||
|
|
||||||
|
# Convert the saved variables with $####{var} back to ${var}
|
||||||
|
$retval =~ s/\$####/\$/g;
|
||||||
|
|
||||||
# remove the space added in the beginning
|
# remove the space added in the beginning
|
||||||
$retval =~ s/ //;
|
$retval =~ s/ //;
|
||||||
@ -843,6 +847,7 @@ sub set_value {
|
|||||||
if ($lvalue =~ /^(TEST|BISECT|CONFIG_BISECT)_TYPE(\[.*\])?$/ &&
|
if ($lvalue =~ /^(TEST|BISECT|CONFIG_BISECT)_TYPE(\[.*\])?$/ &&
|
||||||
$prvalue !~ /^(config_|)bisect$/ &&
|
$prvalue !~ /^(config_|)bisect$/ &&
|
||||||
$prvalue !~ /^build$/ &&
|
$prvalue !~ /^build$/ &&
|
||||||
|
$prvalue !~ /^make_warnings_file$/ &&
|
||||||
$buildonly) {
|
$buildonly) {
|
||||||
|
|
||||||
# Note if a test is something other than build, then we
|
# Note if a test is something other than build, then we
|
||||||
|
Loading…
x
Reference in New Issue
Block a user