Commit Graph

4 Commits

Author SHA1 Message Date
Ewout van Bekkum
e4d7b690c8 pw_build: add "-Wundef" to strict_warnings
Adds "-Wundef" to "strict_warnings" to catch use of accidentally
undefined macros which otherwise implicitly default to 0.

Updates macros across Pigweed to make it compile.

Drops support for PW_TEST_DONT_DEFINE_* in addition to
GTEST_DONT_DEFINE_*, instead only GTEST_DONT_DEFINE_* is used.

Change-Id: Id89f85f7cb8a52c1619bc0f7262349310203067b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21463
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
2020-10-16 23:28:19 +00:00
Wyatt Hepler
d49f8fe3f3 BUILD.gn files: Improve import formatting
The "# gn-format disable" comments are no longer necessary. Delete these
comments and reformat with a Vim macro and gn format.

Change-Id: Ia62c40ad73eef91187d0d443d6e3b0fa723e5aa9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21380
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-15 18:12:55 +00:00
Keir Mierle
854adece94 pw_assert: Add new "light" PW_ASSERT macros
This introduces two new macros: PW_ASSERT() and PW_DASSERT(). These
exist to offer a lightweight assert that is safe to use in headers and
is safe for constexpr. Most of the time, these macros should not be
used, and instead the PW_CHECK() and PW_DCHECK() variants used instead.

Other changes:

- Renames PW_ASSERT_ENABLE_DCHECK to PW_ASSERT_ENABLE_DEBUG, to reflect
  that the setting applies to both PW_CHECK and PW_ASSERT.
- Updates Roadamp & Status documentation sections

Testing: Since currently it is not possible to test the PW_ASSERT macros
due to needing to swap the backend, this is manually tested by flipping
the #if in pw_assert/light_test.cc to 1, and verifying that it crashes
as expected.

Change-Id: I6d2c68f772da4280e61a52576bfb6ab60e280bdf
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17462
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Keir Mierle <keir@google.com>
2020-09-25 20:14:31 +00:00
Keir Mierle
b776cb2b83 pw_assert_log: Route asserts through log
This adds a new module, pw_assert_log, which routes asserts into the
logging backend with a flag set, which can be detected to terminate
execution. This will enable clean assert tokenization.

Change-Id: Id7d14bb35ee0aefd465f4ce109ac270d523a3ec1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16103
Commit-Queue: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-08-17 21:53:18 +00:00