Skip to content

Commit 1672342

Browse files
committed
ktest.pl: Add a NOT operator
There is a NOT DEFINED operator, but there is not an operator that can negate any other expression. For example: NOT (${FOO} == boot || ${BAR} == run) Add the keyword NOT to allow the ktest.pl config files to negate operators. Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent d53cdda commit 1672342

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/testing/ktest/ktest.pl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,12 @@ sub process_expression {
911911
}
912912
}
913913

914+
if ($val =~ s/^\s*NOT\s+(.*)//) {
915+
my $express = $1;
916+
my $ret = process_expression($name, $express);
917+
return !$ret;
918+
}
919+
914920
if ($val =~ /^\s*0\s*$/) {
915921
return 0;
916922
} elsif ($val =~ /^\s*\d+\s*$/) {

0 commit comments

Comments
 (0)