Skip to content

Commit dee8e7f

Browse files
committed
Use default mbed-os test configuration if no app_config is supplied
1 parent ba6eb98 commit dee8e7f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tools/test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
from tools.config import ConfigException
3030
from tools.test_api import test_path_to_name, find_tests, get_test_config, print_tests, build_tests, test_spec_from_test_builds
31+
from tools.test_configs import TestConfig
3132
from tools.options import get_default_options_parser, extract_profile, extract_mcus
3233
from tools.build_api import build_project, build_library
3334
from tools.build_api import print_build_memory_usage
@@ -145,6 +146,8 @@
145146
config, module_conf = get_test_config(options.test_config, mcu)
146147
if not config:
147148
args_error(parser, "argument --test-config contains invalid path or identifier")
149+
elif not options.app_config:
150+
config = TestConfig.get_default_config(mcu)
148151
else:
149152
config = options.app_config
150153

tools/test_configs/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ def get_config_path(cls, conf_name, target_name):
2323
return join(cls.CONFIG_DIR, configs[conf_name.upper()])
2424
else:
2525
return None
26+
27+
@classmethod
28+
def get_default_config(cls, target_name):
29+
configs = cls.get_valid_configs(target_name)
30+
if configs:
31+
keys = configs.keys()
32+
return join(cls.CONFIG_DIR, configs[keys[0]])
33+
else:
34+
return None

0 commit comments

Comments
 (0)