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

Unified Diff: tools/gn/target_unittest.cc

Issue 1518663003: Make GN public configs apply libs to targets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/target.cc ('k') | tools/gn/variables.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target_unittest.cc
diff --git a/tools/gn/target_unittest.cc b/tools/gn/target_unittest.cc
index 426243ece8ccc14479f847d6902f405c028325e3..e7c4c31bd820abec72376840827b21241f5387ca 100644
--- a/tools/gn/target_unittest.cc
+++ b/tools/gn/target_unittest.cc
@@ -386,6 +386,8 @@ TEST(Target, PublicConfigs) {
Label pub_config_label(SourceDir("//a/"), "pubconfig");
Config pub_config(setup.settings(), pub_config_label);
+ std::string lib_name("testlib");
+ pub_config.own_values().libs().push_back(lib_name);
ASSERT_TRUE(pub_config.OnResolved(&err));
// This is the destination target that has a public config.
@@ -406,6 +408,11 @@ TEST(Target, PublicConfigs) {
ASSERT_EQ(1u, dep_on_pub.configs().size());
EXPECT_EQ(&pub_config, dep_on_pub.configs()[0].ptr);
+ // Libs have special handling, check that they were forwarded from the
+ // public config to all_libs.
+ ASSERT_EQ(1u, dep_on_pub.all_libs().size());
+ ASSERT_EQ(lib_name, dep_on_pub.all_libs()[0]);
+
// This target has a private dependency on dest for forwards configs.
TestTarget forward(setup, "//a:f", Target::SOURCE_SET);
forward.private_deps().push_back(LabelTargetPair(&dest));
« no previous file with comments | « tools/gn/target.cc ('k') | tools/gn/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698