Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.51 KB

docs.rst

File metadata and controls

53 lines (35 loc) · 1.51 KB
.. default-domain:: python

pw_watch

pw_watch is similar to file system watchers found in the web development space. These watchers trigger a web server reload on source change, increasing iteration. In the embedded space, file system watchers are less prevalent but no less useful! The Pigweed watcher module makes it easy to instantly compile, flash, and run tests upon save.

doc_resources/pw_watch_on_device_demo.gif

Note

pw_watch currently only works with Pigweed's GN build.

Module Usage

The simplest way to get started with pw_watch is to launch it from a shell using the Pigweed environment.

$ pw watch

By default, pw_watch will watch for repository changes and then trigger Ninja builds sequentially for each subdirectory in ${PIGWEED_ROOT}/out. To override this behavior, follow pw watch with paths to Ninja build directories like so:

$ pw watch out/host out/disco

The --patterns and --ignore_patterns arguments can be used to include and exclude certain file patterns that will trigger rebuilds.

Unit Test Integration

Thanks to GN's understanding of the full dependency tree, only the tests affected by a file change are run when pw_watch triggers a build. By default, host builds using pw_watch will run unit tests. To run unit tests on a device as part of pw_watch, refer to your device's :ref:`target documentation<chapter-targets>`.