Skip to content

Commit

Permalink
ktest.pl: Add a NOT operator
Browse files Browse the repository at this point in the history
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) <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (VMware) committed Jul 1, 2020
1 parent d53cdda commit 1672342
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/testing/ktest/ktest.pl
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,12 @@ sub process_expression {
}
}

if ($val =~ s/^\s*NOT\s+(.*)//) {
my $express = $1;
my $ret = process_expression($name, $express);
return !$ret;
}

if ($val =~ /^\s*0\s*$/) {
return 0;
} elsif ($val =~ /^\s*\d+\s*$/) {
Expand Down

0 comments on commit 1672342

Please sign in to comment.