Build system for perfetto's unittests will trigger gn check errors when inside chromium |
||
Issue descriptiongn check will verify that dependencies are correctly described and not violated. For perfetto the dependency from unit tests to gtest seems wrong. (primiano said: "I think we need to tweak the part behind build_with_chromium") To reproduce ------------- (note that third_party/perfetto is not in .gn's check_targets list so not checked by default) 1. gn out/Default "//third_party/perfetto/*" Expected ----------- No errors Actually ---------- About 10 of the error below: ERROR at //third_party/perfetto/src/base/string_utils_unittest.cc:19:11: Can't include this header from here. #include "gmock/gmock.h" ^------------ The target: //third_party/perfetto/src/base:unittests is including a file from the target: //third_party/googletest:gmock It's usually best to depend directly on the destination target. In some cases, the destination target is considered a subcomponent of an intermediate target. In this case, the intermediate target should depend publicly on the destination to forward the ability to include headers. Dependency chain (there may also be others): //third_party/perfetto/src/base:unittests --> //third_party/perfetto/gn:gtest_deps --> //testing/gmock:gmock --[private]--> //third_party/googletest:gmock
,
Oct 25
Looks more complicated than i expected. Maybe gtest.h can be hidden behind a local gtest.h that hides all the logic?
,
Oct 29
Fixed and verified on TOT. |
||
►
Sign in to add a comment |
||
Comment 1 by eseckler@chromium.org
, Oct 25