Test spec baud_rate now set based on mbed config

pull/3290/head
Brian Daniels 2016-11-10 13:42:00 -06:00 committed by Anna Bridge
parent 3162e6caae
commit bcf83c05dc
1 changed files with 8 additions and 2 deletions

View File

@ -60,6 +60,7 @@ from tools.build_api import create_result
from tools.build_api import add_result_to_report from tools.build_api import add_result_to_report
from tools.build_api import prepare_toolchain from tools.build_api import prepare_toolchain
from tools.build_api import scan_resources from tools.build_api import scan_resources
from tools.build_api import get_config
from tools.libraries import LIBRARIES, LIBRARY_MAP from tools.libraries import LIBRARIES, LIBRARY_MAP
from tools.options import extract_profile from tools.options import extract_profile
from tools.toolchains import TOOLCHAIN_PATHS from tools.toolchains import TOOLCHAIN_PATHS
@ -2126,12 +2127,17 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
base_path = norm_relative_path(build_path, execution_directory) base_path = norm_relative_path(build_path, execution_directory)
target_name = target if isinstance(target, str) else target.name target_name = target if isinstance(target, str) else target.name
cfg, macros, features = get_config(base_source_paths, target_name, toolchain_name)
baud_rate = 9600
if 'platform.stdio-baud-rate' in cfg:
baud_rate = cfg['platform.stdio-baud-rate'].value
test_build = { test_build = {
"platform": target_name, "platform": target_name,
"toolchain": toolchain_name, "toolchain": toolchain_name,
"base_path": base_path, "base_path": base_path,
"baud_rate": 9600, "baud_rate": baud_rate,
"binary_type": "bootable", "binary_type": "bootable",
"tests": {} "tests": {}
} }