]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ktest: Allow tests to undefine default options
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Fri, 21 Nov 2014 21:21:25 +0000 (16:21 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Sat, 22 Nov 2014 00:38:57 +0000 (19:38 -0500)
commit22c37a9ac49d0bf3ec384cdbc60a5600d48e298e
tree7bb7cc996241a58b0a3c5e62fcb47c1a791467f7
parent9972fc0b859e7aaeb6d2d33bdb591959d9a436c0
ktest: Allow tests to undefine default options

Tests can set options that override the default ones. But if a test
tries to undefine a default option, it is simply ignored and the
default option stays as is.

For example, if you want to have a test that defines no MIN_CONFIG
then the test should be able to do that with:

   TEST_START
   MIN_CONFIG =

Which should make MIN_CONFIG not defined for that test. But the way
the code currently works, undefined options in tests are dropped.
This is because the NULL options are evaluated during the reading of
the config file and since one can disable default options in the default
section with this method, it is evaluated there (the option turns to a
undef). But undef options in the test section mean to use the default
option.

To fix this, keep the empty string in the option during the reading
of the config file, and then evaluate it when running the test. This
will allow tests to null out default options.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl