Commit Graph

12 Commits

Author SHA1 Message Date
Keir Mierle
848ca25109 pw_assert: Add pw_assert_basic CMake build
Change-Id: I5dfda5ccf3077ff799bdf7761250ba9eb00366dd
2020-02-13 14:48:55 -08:00
Wyatt Hepler
76293e3dea pw_containers: Vector class
pw::Vector implements the std::vector interface, but uses a fixed size
buffer instead of dynamically allocated memory. Vectors must be declared
with their max size (Vector<Type, kMaxSize>) but may be referred to
without the max size (Vector<Type>).

Change-Id: Iac16996109b55fdf8fce73a97e8e84072eb8d166
2020-02-10 16:53:13 -08:00
Keir Mierle
3cee879769 pw_assert: Initial assert module
This starts the assert and assert_basic modules, which are the beginning
of our assert foundation. Much more is needed; in particular the "tests"
don't really do much other than check for compilation.

Screenshot
==========

   ▄████▄      ██▀███      ▄▄▄           ██████     ██░ ██
  ▒██▀ ▀█     ▓██ ▒ ██▒   ▒████▄       ▒██    ▒    ▓██░ ██▒
  ▒▓█ 💥 ▄    ▓██ ░▄█ ▒   ▒██  ▀█▄     ░ ▓██▄      ▒██▀▀██░
  ▒▓▓▄ ▄██▒   ▒██▀▀█▄     ░██▄▄▄▄██      ▒   ██▒   ░▓█ ░██
  ▒ ▓███▀ ░   ░██▓ ▒██▒    ▓█   ▓██▒   ▒██████▒▒   ░▓█▒░██▓
  ░ ░▒ ▒  ░   ░ ▒▓ ░▒▓░    ▒▒   ▓▒█░   ▒ ▒▓▒ ▒ ░    ▒ ░░▒░▒
    ░  ▒        ░▒ ░ ▒░     ▒   ▒▒ ░   ░ ░▒  ░ ░    ▒ ░▒░ ░
  ░             ░░   ░      ░   ▒      ░  ░  ░      ░  ░░ ░
  ░ ░            ░              ░  ░         ░      ░  ░  ░
  ░

  Welp, that didn't go as planned. It seems we crashed. Terribly sorry!

  CRASH MESSAGE

     Check failed: x (=50) > y (=51300): You SHOULD see this message

  CRASH FILE & LINE

     ../../pw_assert/assert_test.cc:46

  CRASH FUNCTION

     PigweedTestBody

==========

Change-Id: I9dbb460b3b33040d8009749f44b9fc174e2c8138
2020-02-07 23:18:07 +00:00
Wyatt Hepler
0412a7d8e5 pw_minimal_cpp_stdlib: Extremely limited C++ lib
pw_minimal_cpp_stdlib is an extremely limited, non-standard
implementation of the C++ Standard Library. It requires C++17 and a C
standard library.

Change-Id: I2d0b8d6cf49730e2c746eddf2c4a23308af1eb6a
2020-01-29 16:05:18 -08:00
Wyatt Hepler
2ad6067478 pw_kvs: Add to build; get tests passing
Change-Id: Idfd357beaf60b94ebaf9b4b1f8cd1b3d712e9b10
2020-01-27 19:13:05 +00:00
Wyatt Hepler
4981058686 Bazel and CMake build updates
- Build pw_log and pw_log_basic in Bazel and CMake.
- Use pw_log_basic as the hard-coded backend in Bazel.
- Give CMake auto added tests access to all of the module's
  dependencies.

Change-Id: I15ebb2958506f120c79ee6057fbef0fdcf090354
2020-01-24 15:10:07 -08:00
Wyatt Hepler
92ccb6681e pw_checksum: CCITT CRC16 functions
Change-Id: I731445296690409cd97cad652f0827b50e36a58e
2020-01-22 10:12:09 -08:00
Wyatt Hepler
daf02e0e06 pw_log: Add pw_preprocessor dep and CMakeLists.txt
Change-Id: Iddd9177c633a2442840e357eb2065c23654d1d03
2020-01-21 10:38:05 -08:00
Wyatt Hepler
c542a5d6f7 pw_polyfill: Backports for C++11 and C++14
- The pw_polyfill module brings some C++17 features to C++11 and C++14.
- The module's overrides are added to the GN build to seamlessly
  support older C++ standards.

Change-Id: Icb29772073e681e1ef868561bdde56e629e9c0d9
2020-01-17 09:04:49 -08:00
Wyatt Hepler
89acf60fc9 pw_tokenizer: CMake build
Change-Id: I2fef5f7f3a9b5dfb01487ef678aa978875830dc8
2020-01-10 00:19:10 +00:00
Wyatt Hepler
b8b01e3a5e pw_base64: Module for Base64 encoding and decoding
Provides C and C++ functions for encoding, decoding, and checking the
validity of Base64 data.

Change-Id: I784460d802c68b01ecee5a1778626f289685a871
2020-01-09 22:21:01 +00:00
Wyatt Hepler
0fbcdfc3cd Basic CMake build
- Automatically add simple modules with pw_auto_add_simmple_module.
- Define libraries in a module with pw_add_module_library.
- Define tests and test groups with pw_add_test and
  pw_add_test_to_groups.
- Tests execute with full Ninja dependency resolution, as in the GN
  build.
- Add CMakeLists.txt for existing modules.
- Currently there is no support for targets, but these libraries would
  be trivial to integrate with an existing CMake build.

Change-Id: If73d8b61bce88f91141737eb773f1ebce3a7676e
2020-01-04 01:05:46 +00:00