From 9bd4d24104c52556c50953cab4f53b65df955feb Mon Sep 17 00:00:00 2001 From: Saheer Babu Date: Fri, 23 Apr 2021 13:25:36 +0100 Subject: [PATCH] create symbolic links for all sub examples which has mbed-os.lib. --- tools/test/examples/examples_lib.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/test/examples/examples_lib.py b/tools/test/examples/examples_lib.py index f72eb836bf1..13cc1c97961 100644 --- a/tools/test/examples/examples_lib.py +++ b/tools/test/examples/examples_lib.py @@ -493,7 +493,16 @@ def symlink_mbedos(config, path, exp_filter): for example in config['examples']: if example['name'] not in exp_filter: continue - for name in get_sub_examples_list(example): + + # traverse the path and find directories with "mbed-os.lib" + dirs_with_mbed_os_lib = [] + for root, dirs, files in os.walk(example['name']): + for the_file in files: + if the_file.endswith("mbed-os.lib"): + dirs_with_mbed_os_lib.append(root) + + # symlink all sub directories with mbed-os.lib + for name in dirs_with_mbed_os_lib: os.chdir(name) logging.info("In folder '%s'" % name) if os.path.exists("mbed-os.lib"):