1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

dist/tools/kconfiglib: add configuration evaluation function

This removes the existing hack, in which we wrote the configuration to
/dev/null to trigger its evaluation. Instead a function for this
specific purpose is added.
This commit is contained in:
Leandro Lanzieri 2022-06-10 20:30:32 +02:00
parent 4b6da5c8e4
commit d237fab620
No known key found for this signature in database
GPG Key ID: F4E9A721761C7593
2 changed files with 9 additions and 3 deletions

View File

@ -393,9 +393,7 @@ with error.""")
kconf = RiotKconfig(args.kconfig_filename, warn_to_stderr=False)
merge_configs(kconf, args.config_sources)
# HACK: Force all symbols to be evaluated, to catch warnings generated
# during evaluation (such as out-of-range integers)
kconf.write_config(os.devnull, save_old=False)
kconf.evaluate_config()
if not check_configs(kconf) and not args.ignore_config_errors:
sys.exit(1)

View File

@ -28,6 +28,14 @@ class RiotKconfig(Kconfig):
super(RiotKconfig, self).write_autoconf(filename, header)
self.unique_defined_syms = tmp_unique_defined_syms
def evaluate_config(self):
"""Evaluate the current configuration.
Useful to catch warnings (such as out-of-range integers) before writing
the configuration to a file.
"""
self._config_contents(None)
def standard_riot_kconfig(description=None):
"""