Skip to content

Commit 4bfd73a

Browse files
committed
[Exporter tests] update mbed-os in selected examples
1 parent c231939 commit 4bfd73a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tools/test/examples/examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def do_compile(args, config):
119119

120120
def do_versionning(args, config):
121121
""" Test update the mbed-os to the version specified by the tag """
122-
lib.update_mbedos_version(config, args.tag)
122+
lib.update_mbedos_version(config, args.tag, args.example)
123123
return 0
124124

125125

tools/test/examples/examples_lib.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def compile_repos(config, toolchains, targets, examples):
382382
return results
383383

384384

385-
def update_mbedos_version(config, tag, example):
385+
def update_mbedos_version(config, tag, examples):
386386
""" For each example repo identified in the config json object, update the version of
387387
mbed-os to that specified by the supplied GitHub tag. This function assumes that each
388388
example repo has already been cloned.
@@ -394,8 +394,10 @@ def update_mbedos_version(config, tag, example):
394394
"""
395395
print("Updating mbed-os in examples to version %s\n" % tag)
396396
for example in config['examples']:
397-
for repo_info in get_repo_list(example):
398-
update_dir = basename(repo_info['repo']) + "/mbed-os"
397+
if example['name'] not in examples:
398+
continue
399+
for repo in get_repo_list(example):
400+
update_dir = basename(repo) + "/mbed-os"
399401
print("\nChanging dir to %s\n" % update_dir)
400402
os.chdir(update_dir)
401403
subprocess.call(["mbed-cli", "update", tag, "--clean"])

0 commit comments

Comments
 (0)