[Exporter tests] update mbed-os in selected examples

pull/3206/head
Sarah Marsh 2016-11-04 17:15:11 -05:00
parent c231939a8d
commit 4bfd73a661
2 changed files with 6 additions and 4 deletions
tools/test/examples

View File

@ -119,7 +119,7 @@ def do_compile(args, config):
def do_versionning(args, config):
""" Test update the mbed-os to the version specified by the tag """
lib.update_mbedos_version(config, args.tag)
lib.update_mbedos_version(config, args.tag, args.example)
return 0

View File

@ -382,7 +382,7 @@ def compile_repos(config, toolchains, targets, examples):
return results
def update_mbedos_version(config, tag, example):
def update_mbedos_version(config, tag, examples):
""" For each example repo identified in the config json object, update the version of
mbed-os to that specified by the supplied GitHub tag. This function assumes that each
example repo has already been cloned.
@ -394,8 +394,10 @@ def update_mbedos_version(config, tag, example):
"""
print("Updating mbed-os in examples to version %s\n" % tag)
for example in config['examples']:
for repo_info in get_repo_list(example):
update_dir = basename(repo_info['repo']) + "/mbed-os"
if example['name'] not in examples:
continue
for repo in get_repo_list(example):
update_dir = basename(repo) + "/mbed-os"
print("\nChanging dir to %s\n" % update_dir)
os.chdir(update_dir)
subprocess.call(["mbed-cli", "update", tag, "--clean"])