Commit Graph

4 Commits

Author SHA1 Message Date
Wyatt Hepler
8663e9c4f0 Add evaluated string outputs to the test framework
- Integrate StringBuilder with the test framework. Test failures print
  "Actual: " followed by the evaluated values for the expression.
- Update SimplePrintingEventHandler to have the write function
  optionally output the newline.

Example:

[ RUN      ] Status.CompareToStatusCode
../../pw_status/status_test.cc:43: Failure
      Expected: Status(Status::ABORTED) == Status(Status::DATA_LOSS)
        Actual: ABORTED == DATA_LOSS
[  FAILED  ]

Change-Id: I4bd6f63cfd903ce2dc4959a1491825e7e743a522
2019-11-26 21:29:18 +00:00
Armando Montanez
d3ed0f4d9b Make default unit testing main use pw_dumb_io
Updates the default unit testing main to use dumb_io. This allows unit
tests to run on both host and stm32f429i-disc1 with minimal differences.
This change also updates simple_printing_event_handler to print out a
function that takes a std::string_view instead of a char*.

Change-Id: Ib83bd25ca0db243fd5c18325117b5ebe10e40b4e
2019-11-20 18:32:27 +00:00
Keir Mierle
586719197a pw_toolchain: Start host_clang toolchain
This adds a generic host_clang toolchain, targeting hosts running Mac and
Linux to start, and likely Windows later.

For now, on Mac the default toolchain is set to host_clang_og

Change-Id: Iea457c61586930d509439c6616574c9a74919433
2019-11-14 18:26:54 +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