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

Unified Diff: tools/gn/builder_unittest.cc

Issue 561273003: Add public deps to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: tools/gn/builder_unittest.cc
diff --git a/tools/gn/builder_unittest.cc b/tools/gn/builder_unittest.cc
index bac91926ac8851e903251abb94c05fc9c722f8a9..e20cd96a9d25f6accf1545178a96a87ed7a1d8f4 100644
--- a/tools/gn/builder_unittest.cc
+++ b/tools/gn/builder_unittest.cc
@@ -99,7 +99,7 @@ TEST_F(BuilderTest, BasicDeps) {
// The builder will take ownership of the pointers.
Target* a = new Target(&settings_, a_label);
- a->deps().push_back(LabelTargetPair(b_label));
+ a->public_deps().push_back(LabelTargetPair(b_label));
a->set_output_type(Target::EXECUTABLE);
builder_->ItemDefined(scoped_ptr<Item>(a));
@@ -144,6 +144,7 @@ TEST_F(BuilderTest, BasicDeps) {
// Add the C target.
Target* c = new Target(&settings_, c_label);
+ c->visibility().SetPublic();
c->set_output_type(Target::STATIC_LIBRARY);
builder_->ItemDefined(scoped_ptr<Item>(c));
@@ -153,7 +154,8 @@ TEST_F(BuilderTest, BasicDeps) {
// Add the B target.
Target* b = new Target(&settings_, b_label);
- a->deps().push_back(LabelTargetPair(c_label));
+ b->visibility().SetPublic();
+ a->public_deps().push_back(LabelTargetPair(c_label));
b->set_output_type(Target::SHARED_LIBRARY);
builder_->ItemDefined(scoped_ptr<Item>(b));
@@ -197,6 +199,7 @@ TEST_F(BuilderTest, ShouldGenerate) {
// First define B.
Target* b = new Target(&settings2, b_label);
+ b->visibility().SetPublic();
b->set_output_type(Target::EXECUTABLE);
builder_->ItemDefined(scoped_ptr<Item>(b));
@@ -206,7 +209,7 @@ TEST_F(BuilderTest, ShouldGenerate) {
// Define A with a dependency on B.
Target* a = new Target(&settings_, a_label);
- a->deps().push_back(LabelTargetPair(b_label));
+ a->public_deps().push_back(LabelTargetPair(b_label));
a->set_output_type(Target::EXECUTABLE);
builder_->ItemDefined(scoped_ptr<Item>(a));

Powered by Google App Engine
This is Rietveld 408576698