- Move test functions into their own source
- Override the window layout for test-mode. By default 3 log panes
are shown, 2 with filters added.
- Remove unused byte_size from LogStore class for PyPy compatibility
Change-Id: Ib6fa4f67f9d74a83df05aebc5bd58a3bf53036cb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108840
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
WriteRepeatedSfixed64() was missing from the proto encoder because the
WriteRepeatedFixed64() function was implemented twice.
Change-Id: Ifa5791925cda05770c04db04ba704e93cfaba0bf
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/109277
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
The original intent of the ChannelOutput-accepting variant
of ProcessPacket was to support dynamic assignment of
channels, but that is solved via a different API now.
The interface is currently used to report errors, but those
are also available via the return status.
Change-Id: Id829f2c365f8e9dc2592fe5dda97bb652a6c46fc
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/107335
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Taylor Cramer <cramertj@google.com>
Allstar (https://github.com/ossf/allstar/) has been flagging checked-in
binary artifacts in the Pigweed repo on GitHub
(https://github.com/google/pigweed/issues/5). The artifacts in question
are empty ELF files used to test ELF parsing code. Add these files to an
allowlist to silence the warnings.
Change-Id: I14ea5b5617f86b5bd3f390b03612a5a99f6531d2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/109231
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
- Add a section about how to choose between InlineString and
StringBuilder.
- Emphasize that InlineString can be used to add null-terminators to
length-delimited strings (std::string_view).
Change-Id: Ie45de936afc48dbbd134335d9a9765a8501e4789
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/109230
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Tested by building the docs locally and verifying the favicon is shown.
Change-Id: I6f43ed4a78d16400759aa521f1d18c96b7405c2f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/109078
Pigweed-Auto-Submit: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Printed size report every time a new diff report was calculated,
causing the pw watch to print out lots of duplicate tables before
finishing the entire size report.
Change-Id: I2c5fa8a6d875ba6e729a14c30e67d2776a566239
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/109013
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Brandon Vu <brandonvu@google.com>
pw::InlineBasicString<T, kCapacity> is a fixed-capacity null-terminated
string class that closely resembles std::basic_string<T>. The char alias
pw::InlineString<kCapacity> is equivalent to std::string.
pw::InlineString instances must be constructed with the capacity
specified, but strings of any capacity may be used through an
pw::InlineString<> reference.
Fixes: b/234869764
Change-Id: I4384ccac76ea27bd58012ceca9c9c289db7f0185
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/92742
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
This CL forwards the visibility variable in pw_exec targets through to
the underlying pw_python_action (and then the GN action target) to
enable users to restrict the visibility of pw_exec targets.
Change-Id: I6a48850042c2649defa6ad64289ace99f4f0313e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108993
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Eli Lipsitz <elipsitz@google.com>
Allow PW_NC_EXPECT() statements to span multiple lines. The statements
must contain only string literals or //-style comments. This prevents
clang-format from breaking PW_NC_EXPECT() statements when it reflows
string literals.
With this change, statements like the following are permitted:
PW_NC_EXPECT( // This is a comment
"This is a \"very\" long string that didn't " // Comment
"fit on one line,\nokay?");
Also added tests for negative compilation test parsing.
Change-Id: Ie7ad157c817eaf7f0f576bcd841f00426623b635
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/107678
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
This commit adds two new toolchain arguments that enable a user to
customize the GN target type that pw_unit_test uses to build test
executables. The default maintains the same behavior, using
'pw_executable'.
This allows a toolchain to do special handling of test executables.
Change-Id: Ibf5ea92da840d50a70bddf0ca77a361d8eac3002
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108733
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Eli Lipsitz <elipsitz@google.com>
The ChannelOutput argument is being removed. This will
allow callers to gradually transition their code to the new API.
Change-Id: Id13d7702378d6b67cbe41d65720c1f57d81c7b26
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108950
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Taylor Cramer <cramertj@google.com>
Add the zephyr/ prefix to the include paths needed for ToT zephyr
builds as well as removing the type-limits warning. Type limit warnings
don't work with Zephyr because of the Kconfig feature. In a given
build we can check `uintptr >= CONFIG_X` and CONFIG_X may be 0, but
in another build it might be 10.
Bug: b/236263182
Change-Id: Iaf3a5075a4af51f740efe66abcd709d6d9796396
Signed-off-by: Yuval Peress <peress@google.com>
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108834
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Barnes <robbarnes@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Specfiying only 1 data sources broke the difference algorithm
as it relied on having 2 or more data sources to calculate the
difference. Fix the algorithm by only subtracting the lowest
level within the DataSourceMap struct. Adding diff label
title to ASCII table outputs as well.
Change-Id: Ib5b1fb18a6145a7f954c885712915e2fd9142ed3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108750
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Brandon Vu <brandonvu@google.com>
Removes the deprecated std::span polyfill, which was only available in
GN and disabled by default.
In a future change, span_common.inc will be merged into pw_span/span.h.
Bug: b/235237667
Change-Id: I0652a295e76c90877d6fbbafa2eae35dcecfacf6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108732
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
This changes the version of Bloaty installed by CIPD from the custom
Pigweed fork to Fuchsia's Bloaty package, which tracks upstream.
Bug: b/223182409
Change-Id: Iadac60e62e6da24f174a326a7d21104135867cff
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108811
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Brandon Vu <brandonvu@google.com>
Bundling is usually recommended but the structure of Pigweed was
causing duplications in the bundled d.ts file. Which resulted in type
mismatches downstream.
Change-Id: I43cfb41573f85e79507a2fb007a95a8cb8f7f27c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108710
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Asad Memon <asadmemon@google.com>
Previously each separate log pane had it's own redraw timer. This
could lead to screen redraws triggering unnecessarily in quick
sucession. This change switches to a single log redraw timer with a
max of 10 fps. This is just for new log lines. The prompt_toolkit app
will still run at 30 fps so input is more responsive.
Change-Id: Ibf299630cb7356f739058f1523e44a3cc4abaf30
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108730
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Source filter argument from GN template was getting passed even if
empty, causing Bloaty to return an empty size report. Using a json
file to hold all the arguments from the GN build will make it
easier to store and parse arguments in bloat.py compared to
reading over command line arguments.
Change-Id: I67cf1691d304236ac8de78fc607370e80ac0c4ca
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108220
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Brandon Vu <brandonvu@google.com>
Currently only works for UnaryMethods. Example usage:
```
let device = new Device();
device.connect();
...
const [status, response] =
await device.rpcs.pw.rpc.EchoService.Echo("Hello");
```
Change-Id: Icdfbc0d3f325a6c088a3608e86e5421db56dfa07
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/107976
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Asad Memon <asadmemon@google.com>
- Add host and device logfile options
- Merge host and device into single logfile option
- Remove ANSI colors from logfiles
- Add IPython option in case the pw_console TUI is not needed
- Set pyserial timeout to small timespan to avoid 100% CPU usage
Change-Id: I308c78e7a157d914359b2a77c511768f23932d68
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108555
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
- Added TotalSizeBytes to PrefixedEntryRingBuffer.
- This is needed by users that don't know the size of ring buffer.
Bug: b/242740148
Change-Id: I5b6fc24757d01d38413773a60b5f49666f1dc598
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/107172
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Fateh Singh <fsingh@google.com>