summaryrefslogtreecommitdiff
path: root/zephyr/firmware_builder.py
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-07-02 11:26:53 -0600
committerCommit Bot <commit-bot@chromium.org>2021-07-02 20:53:17 +0000
commitfb7550fd0018e15b91d2badd3847ae94950965c0 (patch)
tree319b89c42e7e9a51f20a9459a36e1a5d8dc20b30 /zephyr/firmware_builder.py
parent2d01036b8275f6c26d8cdbdb493b481c91c18870 (diff)
downloadchrome-ec-fb7550fd0018e15b91d2badd3847ae94950965c0.tar.gz
zephyr: zmake: separate zmake test execution out of zmake
Putting execution of "pytest" inside of zmake testall itself is problematic: The path this code runs relies on a lot of zmake's features, and if there were a bug in zmake that prevented that code from being reached, the code could never get executed. Additionally, the log output is impossible to read as it gets mixed in with all the build output. Separate it into a simple shell script, which greatly simplifies the code, and makes it easier to add further style tests down the road (isort, flake8, black). BUG=b:192389533 BRANCH=none TEST=run firmware_builder.py Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I8795ba0c0225183b597f3738575c790ba73610f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002837 Commit-Queue: Yuval Peress <peress@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'zephyr/firmware_builder.py')
-rwxr-xr-xzephyr/firmware_builder.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/zephyr/firmware_builder.py b/zephyr/firmware_builder.py
index ce817f68a7..13f2d141e0 100755
--- a/zephyr/firmware_builder.py
+++ b/zephyr/firmware_builder.py
@@ -131,14 +131,20 @@ def test(opts):
with open(opts.metrics, 'w') as f:
f.write(json_format.MessageToJson(metrics))
+ zephyr_dir = pathlib.Path(__file__).parent.resolve()
+
+ # Run zmake tests to ensure we have a fully working zmake before
+ # proceeding.
+ subprocess.run([zephyr_dir / 'zmake' / 'run_tests.sh'], check=True)
+
if opts.code_coverage:
- zephyr_dir = pathlib.Path(__file__).parent
- platform_ec = zephyr_dir.resolve().parent
+ platform_ec = zephyr_dir.parent
build_dir = platform_ec / 'build/zephyr-coverage'
return subprocess.run(
['zmake', '-D', 'coverage', build_dir], cwd=platform_ec).returncode
- return subprocess.run(['zmake', '-D', '--cq', 'testall']).returncode
+ subprocess.run(['zmake', '-D', 'testall'], check=True)
+ return 0
def main(args):