Skip to content

Commit 33eb3ea

Browse files
committed
Reorder test configs
Old order: * --test-config * --app-config * test config (as defined in test_config) * `mbed_app.json` in root. New order: * --test-config * --app-config * `mbed_app.json` in root. * test config (as defined in test_config)~ This matches the documentation and user expectation
1 parent 4e66f21 commit 33eb3ea

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tools/test.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
2828
sys.path.insert(0, ROOT)
2929

30-
from tools.config import ConfigException
30+
from tools.config import ConfigException, Config
3131
from tools.test_api import test_path_to_name, find_tests, get_test_config, print_tests, build_tests, test_spec_from_test_builds
32-
import tools.test_configs as TestConfig
32+
from tools.test_configs import get_default_config
3333
from tools.options import get_default_options_parser, extract_profile, extract_mcus
3434
from tools.build_api import build_project, build_library
3535
from tools.build_api import print_build_memory_usage
@@ -144,10 +144,13 @@
144144
config = get_test_config(options.test_config, mcu)
145145
if not config:
146146
args_error(parser, "argument --test-config contains invalid path or identifier")
147-
elif not options.app_config:
148-
config = TestConfig.get_default_config(options.source_dir or ['.'], mcu)
149-
else:
147+
elif options.app_config:
150148
config = options.app_config
149+
else:
150+
config = Config.find_app_config(options.source_dir)
151+
152+
if not config:
153+
config = get_default_config(options.source_dir or ['.'], mcu)
151154

152155
# Find all tests in the relevant paths
153156
for path in all_paths:

0 commit comments

Comments
 (0)