Skip to content

Commit e3ff8da

Browse files
committed
Test spec baud_rate now set based on mbed config
1 parent 088566b commit e3ff8da

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/test_api.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from tools.build_api import add_result_to_report
6161
from tools.build_api import prepare_toolchain
6262
from tools.build_api import scan_resources
63+
from tools.build_api import get_config
6364
from tools.libraries import LIBRARIES, LIBRARY_MAP
6465
from tools.options import extract_profile
6566
from tools.toolchains import TOOLCHAIN_PATHS
@@ -2126,12 +2127,17 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
21262127
base_path = norm_relative_path(build_path, execution_directory)
21272128

21282129
target_name = target if isinstance(target, str) else target.name
2129-
2130+
cfg, macros, features = get_config(base_source_paths, target_name, toolchain_name)
2131+
2132+
baud_rate = 9600
2133+
if 'platform.stdio-baud-rate' in cfg:
2134+
baud_rate = cfg['platform.stdio-baud-rate'].value
2135+
21302136
test_build = {
21312137
"platform": target_name,
21322138
"toolchain": toolchain_name,
21332139
"base_path": base_path,
2134-
"baud_rate": 9600,
2140+
"baud_rate": baud_rate,
21352141
"binary_type": "bootable",
21362142
"tests": {}
21372143
}

0 commit comments

Comments
 (0)