Skip to content

Commit ceeedfd

Browse files
author
Cruz Monrreal
authored
Merge pull request #6805 from theotherjimmy/reorder-test-configs
tools: Reorder test configuration priority
2 parents 0f51ea0 + 33eb3ea commit ceeedfd

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
@@ -145,10 +145,13 @@
145145
config = get_test_config(options.test_config, mcu)
146146
if not config:
147147
args_error(parser, "argument --test-config contains invalid path or identifier")
148-
elif not options.app_config:
149-
config = TestConfig.get_default_config(options.source_dir or ['.'], mcu)
150-
else:
148+
elif options.app_config:
151149
config = options.app_config
150+
else:
151+
config = Config.find_app_config(options.source_dir)
152+
153+
if not config:
154+
config = get_default_config(options.source_dir or ['.'], mcu)
152155

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

0 commit comments

Comments
 (0)