commit | ff074e72f67c37fef58c74ba253ea868d4a504be | [log] [tgz] |
---|---|---|
author | Ted Pudlik <tpudlik@google.com> | Fri Feb 23 21:13:49 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Feb 23 21:13:49 2024 +0000 |
tree | b0ed6e808f5dbeb955ffe396b8963ed6ad3d6ffe | |
parent | 277297be6fea9fc1cbefa8609b2b297c9e87dee2 [diff] |
pw_unit_test: Fix googletest backend With this change, you can use the googletest backend with simple_printing_main. The most important changes here are, 1. Making //pw_unit_test directly expose the pw_unit_test/framework.h header. 2. Adding the dep on googletest_handler_adapter to the googletest target. This was a missing dependency before. But doing (2) requires removing a bunch of target_compatible_with attributes that produced a circular dependency. When the backend is set to googletest, pw_unit_test depends on googletest, which depends on googletest_handler_adapter. But the googletest_handler_adapter used to have a dependency on pw_unit_test itself, through the config_setting that depends on pw_unit_test. I also remove the target_compatible_with on the "framework_test". This test should be compatible with all backends, and indeed passes for the googletest backend. Internal-only consequences: this change makes is a layering check violation to #include "gtest/gtest.h" from a pw_cc_test that doesn't directly depend on googletest. This is good: tests that use pw_unit_test as a framework should #include "pw_unit_test/framework.h" instead, which provides only that subset of gtest.h symbols that are actually supported when building an on-device test. Test: bazel test --//targets:pw_unit_test_backend=//pw_unit_test:googletest //... Fixed: b/324116813 Change-Id: I1bd77d936adcfcbcf5122fabd6a9b9f158926188 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/190593 Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Armando Montanez <amontanez@google.com> Commit-Queue: Ted Pudlik <tpudlik@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.