diff options
author | Jeremy Bettis <jbettis@google.com> | 2021-03-30 14:34:16 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-31 18:58:26 +0000 |
commit | 9b918d35a2a5573405250e1dfeef084f40ef0c99 (patch) | |
tree | c2e1eec258d694f63570b6c2505c22a65d559e9b /zephyr/zmake/zmake/zmake.py | |
parent | 68da2a47999aa5f2a6398bbadebc0b859bce63f3 (diff) | |
download | chrome-ec-9b918d35a2a5573405250e1dfeef084f40ef0c99.tar.gz |
zephyr: Add find_projects() to zmake.project.
A new generator function which searches subdirectories for zmake
projects.
BUG=b:183007888
TEST=zmake testall
BRANCH=none
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: Iceca946a12e0e64a46c5994366734addb3e24cb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2795931
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/zmake/zmake/zmake.py')
-rw-r--r-- | zephyr/zmake/zmake/zmake.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py index 51897f0cd4..865e477698 100644 --- a/zephyr/zmake/zmake/zmake.py +++ b/zephyr/zmake/zmake/zmake.py @@ -383,25 +383,20 @@ class Zmake: def testall(self, fail_fast=False): """Test all the valid test targets""" - root_dirs = [self.module_paths['ec'] / 'zephyr'] - project_dirs = [] - for root_dir in root_dirs: - self.logger.info('Finding zmake target under \'%s\'.', root_dir) - for path in pathlib.Path(root_dir).rglob('zmake.yaml'): - project_dirs.append(path.parent) - executor = zmake.multiproc.Executor(fail_fast=fail_fast) tmp_dirs = [] - for project_dir in project_dirs: - is_test = zmake.project.Project(project_dir).config.is_test + for project in zmake.project.find_projects( + self.module_paths['ec'] / 'zephyr'): + is_test = project.config.is_test temp_build_dir = tempfile.mkdtemp( - suffix='-{}'.format(os.path.basename(project_dir.as_posix())), - prefix='zbuild-') + suffix='-{}'.format(os.path.basename( + project.project_dir.as_posix())), + prefix='zbuild-') tmp_dirs.append(temp_build_dir) # Configure and run the test. executor.append( func=lambda: self.configure( - project_dir=pathlib.Path(project_dir), + project_dir=project.project_dir, build_dir=pathlib.Path(temp_build_dir), build_after_configure=True, test_after_configure=is_test)) |