Skip to content

Commit 904bdf8

Browse files
author
Cruz Monrreal
authored
Merge pull request #7477 from theotherjimmy/fix-customtgt-tests
Tools: Skip target lookup in test builds.
2 parents 671b3c8 + 930a611 commit 904bdf8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/test_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,11 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
22252225
execution_directory = "."
22262226
base_path = norm_relative_path(build_path, execution_directory)
22272227

2228-
target_name = target.name if isinstance(target, Target) else target
2228+
if isinstance(target, Target):
2229+
target_name
2230+
else:
2231+
target_name = target
2232+
target = TARGET_MAP[target_name]
22292233
cfg, _, _ = get_config(base_source_paths, target_name, toolchain_name, app_config=app_config)
22302234

22312235
baud_rate = 9600
@@ -2255,7 +2259,7 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
22552259
bin_file = None
22562260
test_case_folder_name = os.path.basename(test_paths[0])
22572261

2258-
args = (src_paths, test_build_path, target, toolchain_name)
2262+
args = (src_paths, test_build_path, deepcopy(target), toolchain_name)
22592263
kwargs = {
22602264
'jobs': 1,
22612265
'clean': clean,

0 commit comments

Comments
 (0)