Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Reviewed-by: Armando Montanez <[email protected]> Commit-Queue: Ted Pudlik <[email protected]>
- Loading branch information