Commit Graph

8 Commits

Author SHA1 Message Date
Wyatt Hepler
405b1468a5 pw_assert_log: Make assert_log.h accessible
Change-Id: Ic6455f622b95b53ad3e53ff07d72f1efa8c2e6df
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/47162
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
2021-05-27 16:13:14 +00:00
Wyatt Hepler
1e36400f26 pw_assert: Reorganize backends for new pattern
- Move all of the pw_assert_basic implementation into the
  pw_assert_basic.impl target.
- Enable the require_link_deps check for pw_assert.

Change-Id: Ie1f64cf0b7704a51710221d7ef02415c788a6235
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/44100
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2021-05-14 01:55:58 +00:00
Wyatt Hepler
6166322c2e pw_build: pw_facade require_link_deps arg
- Make the pw_build_LINK_DEPS check in pw_assert a generic feature in
  pw_facade.
- Use "impl" instead of "deps" for the pw_assert dependencies and
  restructure the impl / backend split.

Change-Id: I75c0f7e67b3b97bfe333760897223ab4601649c0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/43980
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
2021-05-07 17:54:44 +00:00
Wyatt Hepler
8bd4fb003c pw_build: Support specifying final link dependencies
- pw_build_LINK_DEPS is a list of build targets that are linked into
  all build artifacts produced by pw_executable, pw_static_library, and
  pw_shared_library.
- Add a ":deps" group to the pw_assert build interface. Require
  $dir_pw_assert:deps to be listed in pw_build_LINK_DEPS if
  pw_assert_BACKEND is set.

Change-Id: Icc01dbe86f95d971e76aa357c7b7174ce85546ba
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/43521
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>
2021-05-04 22:30:42 +00:00
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