mirror of https://github.com/ARMmbed/mbed-os.git
Make build_tests work with target names, not just Target instances
With this change, custom targets defined by the application being tested in its mbed_app.json file can be used with tests. Note that `build_project` already accepts both target names and instances, so the call to `build_project` inside `build_tests` will still work.pull/2102/head
parent
e3d29fe5d2
commit
36a577e1ef
|
@ -2030,9 +2030,11 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
|
||||||
execution_directory = "."
|
execution_directory = "."
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
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": 9600,
|
||||||
|
@ -2086,7 +2088,7 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
|
||||||
print 'Image: %s'% bin_file
|
print 'Image: %s'% bin_file
|
||||||
|
|
||||||
test_builds = {}
|
test_builds = {}
|
||||||
test_builds["%s-%s" % (target.name, toolchain_name)] = test_build
|
test_builds["%s-%s" % (target_name, toolchain_name)] = test_build
|
||||||
|
|
||||||
|
|
||||||
return result, test_builds
|
return result, test_builds
|
||||||
|
|
Loading…
Reference in New Issue