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

Merge pull request #18192 from leandrolanzieri/pr/dist/tools/kconfiglib/add_evaluate_config

dist/tools/kconfiglib: add configuration evaluation function
This commit is contained in:
Kevin "Tristate Tom" Weiss 2022-06-13 10:35:46 +02:00 committed by GitHub
commit 22977ea01d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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):
"""