summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-08-14 23:40:29 +0200
committerRichard Braun <rbraun@sceen.net>2018-08-14 23:40:29 +0200
commit1ac91d54063b376f04190e5236595532de2861fb (patch)
tree80d84500da2158bcb81144f35e74217916d132ce
parent6cd5e45e802df7c2cb7ad0f4061812897aa56cf2 (diff)
tools/build_configs.py: generate the test set dynamically
-rwxr-xr-xtools/build_configs.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/tools/build_configs.py b/tools/build_configs.py
index f3546e93..c0fce99c 100755
--- a/tools/build_configs.py
+++ b/tools/build_configs.py
@@ -15,6 +15,7 @@ import shutil
import subprocess
import sys
import tempfile
+import pathlib
def quote_if_needed(value):
if not value.isdigit() and value != 'y' and value != 'n':
@@ -106,20 +107,13 @@ large_options_dict.update({
'CONFIG_THREAD_STACK_GUARD' : ['y', 'n'],
})
-# TODO Generate this list from test/test_*.c
-test_list = [
- 'CONFIG_TEST_MODULE_ATOMIC',
- 'CONFIG_TEST_MODULE_BULLETIN',
- 'CONFIG_TEST_MODULE_MUTEX',
- 'CONFIG_TEST_MODULE_MUTEX_PI',
- 'CONFIG_TEST_MODULE_PMAP_UPDATE_MP',
- 'CONFIG_TEST_MODULE_RCU_DEFER',
- 'CONFIG_TEST_MODULE_SREF_DIRTY_ZEROES',
- 'CONFIG_TEST_MODULE_SREF_NOREF',
- 'CONFIG_TEST_MODULE_SREF_WEAKREF',
- 'CONFIG_TEST_MODULE_VM_PAGE_FILL',
- 'CONFIG_TEST_MODULE_XCALL',
-]
+def gen_test_module_option(path):
+ name = path.name
+ root, ext = os.path.splitext(name)
+ return 'CONFIG_' + root.upper()
+
+test_path = pathlib.Path('test')
+test_list = [gen_test_module_option(p) for p in test_path.glob('test_*.c')]
test_options_dict = dict(small_options_dict)