Commit Graph

12 Commits

Author SHA1 Message Date
Armando Montanez
04c56ae138 pw_build: Add pw_facade template
Introduces a pw_facade template that provides a useful error message
when a backend is used but not properly set. This change also changes
pigweed to build pw_docs and module tests by default.

Change-Id: Ie78a0e291782592289baa94d06fd06e493c56956
2019-12-13 11:26:08 -08:00
Wyatt Hepler
edf6f2928b pw_unit_test: Create test running groups
Have pw_test_group create a *_run test group that runs all of the tests
in that group and dependent groups. This allows, for example, using
pw_module_tests_run to run all tests without rebuilding the docs.

Change-Id: I5b37129e94c1cc0f44085e02b0093848f1f8d249
2019-12-02 16:03:32 -08:00
Alexei Frolov
82d3cb35d3 pw_varint: Add varint module
This change adds a pw_varint module containing functions for encoding
and decoding variable-length integers.

Change-Id: I50bdf6d9d6762bffb93ee638683de53afed9c849
2019-12-02 18:39:29 +00:00
Alexei Frolov
a454c68bd8 Define pw_test_group template
This change adds a GN template to the pw_unit_test module which defines
a group of unit tests. The template creates a generated_file target with
JSON metadata for the unit tests and dependencies within the test group.
These metadata files are intended to be parsed by the test runner script
to run unit tests outside of GN.

A pw_test_group target is added to each of the existing modules which
have unit tests.

Change-Id: I363b937da365d0a3482a979feace18ecba1807a9
2019-11-19 20:52:52 +00:00
Armando Montanez
68de071c7d Add pw_dumb_io with host backend
This change introduces the pw_dumb_io module, a module intended for
pigweed testing and bringup. pw_dumb_io includes a facade, and a backend
implementation using stdio (pw_dumb_io_stdio).

Change-Id: I5d9ca3c256c7e7c6d60cc07292aaead808a7f3dd
2019-11-16 00:14:15 +00:00
Alexei Frolov
0efdb117e1
Add root docs directory
This change adds a docs directory at the root level of the Pigweed
repository for building documentation for the entirety of Pigweed.
The directory contains a top-level index.rst and conf.py for docgen,
and a pw_doc_gen build target to render the documentation.

Change-Id: Iba981c64662d48a1d23bb7bda9bf0ed5a104873b
2019-11-14 17:29:23 -08:00
Alexei Frolov
e2016763a8
Add pw_bloat module
This change adds a size reporting module named pw_bloat. The module
uses Bloaty McBloatface to generate size report cards for binaries. It
provides a GN template which defines an action to perform a size diff
on a group of binary targets.

Example output:

                       simple_bloat
                       ────────────
┌────────────────┬──────────────┬────────┬───────┬───────┐
│      Label     │    Segment   │ Before │ Delta │ After │
├════════════════┼══════════════┼════════┼═══════┼═══════┤
│     Add a loop │ EXAMPLE CODE │    429 │   +32 │   461 │
│                │ EXAMPLE  RAM │    576 │    +8 │   584 │
├────────────────┼──────────────┼────────┼───────┼───────┤
│ Add a function │ EXAMPLE CODE │    429 │   +16 │   445 │
│                │ EXAMPLE  RAM │    576 │    +8 │   584 │
└────────────────┴──────────────┴────────┴───────┴───────┘

Change-Id: I14b3d383ec450bc6d017bf5d0111e266b0a3c368
2019-11-14 14:29:28 -08:00
Wyatt Hepler
48db4d6f50 Start the pw_string module
Introduce functions for outputting numbers as strings. Unlike some
snprintf implementations, these functions support 64-bit integers. Also,
very limited floating point support is provided.

These functions are faster than snprintf and never truncate numbers.

Change-Id: Id5ae06a5d175f15403c34cddb2a077a88be47cf8
2019-11-14 16:32:39 +00:00
Wyatt Hepler
771056581c pw_span module
pw::span is a stand-in for C++20's std::span.

Change-Id: I1f36d5da43493c20b4806f6cb1198faf62d47743
2019-11-08 17:15:01 -08:00
Alexei Frolov
925fb8f510 Build and run unit tests through GN
This change adds a GN template for defining unit test executables.
The template, called pw_test, defines the executable and outputs a JSON
metadata file for the test.

A new build argument is added. This argument determines whether unit
test run targets are supported by the current build target. If this is
set, the pw_test template additionally creates a run target for its test
executable which invokes the executable through a script.

A basic test runner script is added to the pw_unit_test module. This
script currently only runs a single test executable directly.

The unit tests in the pw_preprocessor module are updated to use the
pw_test template.

Change-Id: I3cbde9c19440276dbab80dd2bab5fec87abe6d7e
2019-11-08 01:16:04 +00:00
Alexei Frolov
c10c81201d Add preprocessor and unit_test modules
This change adds two Pigweed modules: pw_preprocessor and pw_unit_test.
The preprocessor module contains header files providing helpful macros
for the C preprocessor. The unit test module contains a starter
implementation of a unit testing framework for Pigweed.

Change-Id: I46e1a4cae1fd8ce36d7840a2e92f8013fb489cde
2019-11-04 16:07:34 -08:00
Alexei Frolov
1a82c146ff
Initial Pigweed modules
This change adds Pigweed's first few (incomplete) modules: pw_build,
pw_status, and pw_toolchain. The main scaffolding for Pigweed's GN-based
build system is also included, with a root BUILDCONFIG and BUILD.gn file
defining a top-level modules build target.

Change-Id: I09599443d50696343d6c5b85853cb5cee3ce0026
2019-10-31 17:43:53 -07:00