diff options
author | Anthony DiGirolamo <tonymd@google.com> | 2023-01-24 00:43:27 +0000 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-01-24 00:43:27 +0000 |
commit | cd4481c13b0fb360b3cf35251cd05083bf58154c (patch) | |
tree | f5d4c2fb5898241e648c7e5d0e50cb33a64056bd /pw_build/py/build_recipe_test.py | |
parent | 9f8288e1a29392e9d96c221d6a4b03b254c88c92 (diff) | |
download | pigweed-cd4481c13b0fb360b3cf35251cd05083bf58154c.tar.gz |
pw_build: Python API
- Improvements to the BuildCommand and BuildRecipe APIs
- Allow --build-system-commands for pw watch and pw build commands
to be chained.
- Added logfile related options:
--logfile FILE to log build output
--separate-logfiles option to break out build output to a separate
log file per out directory.
- run_builds() function to execute a collection of BuildRecipes
- run_watch() function to pw-watch a collection of BuildRecipes
- Improvements to the print_build_summary output. Pending builds are
now shown with slug '...'.
- Hookup -j, --keep-going, and --colors options for bazel
Change-Id: I9b856d4324b3851b8e0071626992de8c2f71e2bd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/124990
Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Chad Norvell <chadnorvell@google.com>
Diffstat (limited to 'pw_build/py/build_recipe_test.py')
-rw-r--r-- | pw_build/py/build_recipe_test.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pw_build/py/build_recipe_test.py b/pw_build/py/build_recipe_test.py index 4b5e7a5b0..6361da5b8 100644 --- a/pw_build/py/build_recipe_test.py +++ b/pw_build/py/build_recipe_test.py @@ -14,6 +14,7 @@ """Tests for pw_watch.build_recipe""" from pathlib import Path +import shlex import unittest from parameterized import parameterized # type: ignore @@ -63,7 +64,7 @@ class TestBuildRecipe(unittest.TestCase): 'cmake shell command', BuildCommand( build_dir=Path('outcmake'), - command_string='cmake -G Ninja -S ./ -B outcmake', + command=shlex.split('cmake -G Ninja -S ./ -B outcmake'), ), # result ['cmake', '-G', 'Ninja', '-S', './', '-B', 'outcmake'], @@ -72,7 +73,7 @@ class TestBuildRecipe(unittest.TestCase): 'gn shell command', BuildCommand( build_dir=Path('out'), - command_string='gn gen out --export-compile-commands', + command=shlex.split('gn gen out --export-compile-commands'), ), # result ['gn', 'gen', 'out', '--export-compile-commands'], @@ -81,11 +82,22 @@ class TestBuildRecipe(unittest.TestCase): 'python shell command', BuildCommand( build_dir=Path('outpytest'), - command_string='python pw_build/py/build_recipe_test.py', + command=shlex.split( + 'python pw_build/py/build_recipe_test.py' + ), ), # result ['python', 'pw_build/py/build_recipe_test.py'], ), + ( + 'gn shell command with a list', + BuildCommand( + build_dir=Path('out'), + command=['gn', 'gen', 'out', '--export-compile-commands'], + ), + # result + ['gn', 'gen', 'out', '--export-compile-commands'], + ), ] ) def test_build_command_get_args( |