Skip to content

Commit 68badb2

Browse files
authored
Merge pull request #3257 from bridadan/baudrate_in_test_spec
Baudrate in test spec
2 parents ad35eaf + e3ff8da commit 68badb2

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tools/build_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def get_config(src_paths, target, toolchain_name):
134134
toolchain.config.add_config_files(resources.json_files)
135135

136136
# Add features while we find new ones
137-
features = toolchain.config.get_features()
137+
features = set(toolchain.config.get_features())
138138
if features == prev_features:
139139
break
140140

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)