Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Unified Diff: tools/gn/header_checker_unittest.cc

Issue 2940873002: Implement tracking of BUILD.gn files used to define target, toolchain or (Closed)
Patch Set: Fix compilation after rebase. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/functions.cc ('k') | tools/gn/import_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/header_checker_unittest.cc
diff --git a/tools/gn/header_checker_unittest.cc b/tools/gn/header_checker_unittest.cc
index 19d5e4054fd4f850d0f6672180166c57b7ca8abb..363a3ba1a66d61069661db63eae21321838f3e06 100644
--- a/tools/gn/header_checker_unittest.cc
+++ b/tools/gn/header_checker_unittest.cc
@@ -16,10 +16,10 @@ namespace {
class HeaderCheckerTest : public testing::Test {
public:
HeaderCheckerTest()
- : a_(setup_.settings(), Label(SourceDir("//a/"), "a")),
- b_(setup_.settings(), Label(SourceDir("//b/"), "b")),
- c_(setup_.settings(), Label(SourceDir("//c/"), "c")),
- d_(setup_.settings(), Label(SourceDir("//d/"), "d")) {
+ : a_(setup_.settings(), Label(SourceDir("//a/"), "a"), {}),
+ b_(setup_.settings(), Label(SourceDir("//b/"), "b"), {}),
+ c_(setup_.settings(), Label(SourceDir("//c/"), "c"), {}),
+ d_(setup_.settings(), Label(SourceDir("//d/"), "d"), {}) {
a_.set_output_type(Target::SOURCE_SET);
b_.set_output_type(Target::SOURCE_SET);
c_.set_output_type(Target::SOURCE_SET);
@@ -75,7 +75,7 @@ TEST_F(HeaderCheckerTest, IsDependencyOf) {
// Add a target P ("private") that privately depends on C, and hook up the
// chain so that A -> P -> C. A will depend on C via two different paths.
Err err;
- Target p(setup_.settings(), Label(SourceDir("//p/"), "p"));
+ Target p(setup_.settings(), Label(SourceDir("//p/"), "p"), {});
p.set_output_type(Target::SOURCE_SET);
p.SetToolchain(setup_.toolchain(), &err);
EXPECT_FALSE(err.has_error());
@@ -165,15 +165,17 @@ TEST_F(HeaderCheckerTest, CheckInclude) {
// Create another toolchain.
Settings other_settings(setup_.build_settings(), "other/");
Toolchain other_toolchain(&other_settings,
- Label(SourceDir("//toolchain/"), "other"));
+ Label(SourceDir("//toolchain/"), "other"), {});
TestWithScope::SetupToolchain(&other_toolchain);
other_settings.set_toolchain_label(other_toolchain.label());
other_settings.set_default_toolchain_label(setup_.toolchain()->label());
// Add a target in the other toolchain with a header in it that is not
// connected to any targets in the main toolchain.
- Target otc(&other_settings, Label(SourceDir("//p/"), "otc",
- other_toolchain.label().dir(), other_toolchain.label().name()));
+ Target otc(&other_settings,
+ Label(SourceDir("//p/"), "otc", other_toolchain.label().dir(),
+ other_toolchain.label().name()),
+ {});
otc.set_output_type(Target::SOURCE_SET);
Err err;
EXPECT_TRUE(otc.SetToolchain(&other_toolchain, &err));
@@ -222,7 +224,7 @@ TEST_F(HeaderCheckerTest, CheckInclude) {
TEST_F(HeaderCheckerTest, PublicFirst) {
// Now make a A -> Z -> D private dependency chain (one shorter than the
// public one to get to D).
- Target z(setup_.settings(), Label(SourceDir("//a/"), "a"));
+ Target z(setup_.settings(), Label(SourceDir("//a/"), "a"), {});
z.set_output_type(Target::SOURCE_SET);
Err err;
EXPECT_TRUE(z.SetToolchain(setup_.toolchain(), &err));
« no previous file with comments | « tools/gn/functions.cc ('k') | tools/gn/import_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698