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

Side by Side Diff: tools/gn/target_unittest.cc

Issue 1375023003: tools/gn: Remove code for forward_dependent_configs_from variable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/build_settings.h" 6 #include "tools/gn/build_settings.h"
7 #include "tools/gn/config.h" 7 #include "tools/gn/config.h"
8 #include "tools/gn/scheduler.h" 8 #include "tools/gn/scheduler.h"
9 #include "tools/gn/settings.h" 9 #include "tools/gn/settings.h"
10 #include "tools/gn/target.h" 10 #include "tools/gn/target.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 // Executable target shouldn't get either by depending on shared. 70 // Executable target shouldn't get either by depending on shared.
71 TestTarget exec(setup, "//foo:exec", Target::EXECUTABLE); 71 TestTarget exec(setup, "//foo:exec", Target::EXECUTABLE);
72 exec.private_deps().push_back(LabelTargetPair(&shared)); 72 exec.private_deps().push_back(LabelTargetPair(&shared));
73 ASSERT_TRUE(exec.OnResolved(&err)); 73 ASSERT_TRUE(exec.OnResolved(&err));
74 EXPECT_EQ(0u, exec.all_libs().size()); 74 EXPECT_EQ(0u, exec.all_libs().size());
75 EXPECT_EQ(0u, exec.all_lib_dirs().size()); 75 EXPECT_EQ(0u, exec.all_lib_dirs().size());
76 } 76 }
77 77
78 // Test all_dependent_configs, public_config inheritance, and 78 // Test all_dependent_configs, public_config inheritance, and
79 // forward_dependent_configs_from 79 // forward_dependent_configs.
brettw 2015/10/05 18:06:06 I think you remove the forward_dependent_configs r
tfarina 2015/10/06 03:28:50 Done.
80 TEST(Target, DependentConfigs) { 80 TEST(Target, DependentConfigs) {
81 TestWithScope setup; 81 TestWithScope setup;
82 Err err; 82 Err err;
83 83
84 // Set up a dependency chain of a -> b -> c 84 // Set up a dependency chain of a -> b -> c
85 TestTarget a(setup, "//foo:a", Target::EXECUTABLE); 85 TestTarget a(setup, "//foo:a", Target::EXECUTABLE);
86 TestTarget b(setup, "//foo:b", Target::STATIC_LIBRARY); 86 TestTarget b(setup, "//foo:b", Target::STATIC_LIBRARY);
87 TestTarget c(setup, "//foo:c", Target::STATIC_LIBRARY); 87 TestTarget c(setup, "//foo:c", Target::STATIC_LIBRARY);
88 a.private_deps().push_back(LabelTargetPair(&b)); 88 a.private_deps().push_back(LabelTargetPair(&b));
89 b.private_deps().push_back(LabelTargetPair(&c)); 89 b.private_deps().push_back(LabelTargetPair(&c));
(...skipping 27 matching lines...) Expand all
117 // A should have just gotten the "all" dependent config from C. 117 // A should have just gotten the "all" dependent config from C.
118 ASSERT_EQ(1u, a.configs().size()); 118 ASSERT_EQ(1u, a.configs().size());
119 EXPECT_EQ(&all, a.configs()[0].ptr); 119 EXPECT_EQ(&all, a.configs()[0].ptr);
120 EXPECT_EQ(&all, a.all_dependent_configs()[0].ptr); 120 EXPECT_EQ(&all, a.all_dependent_configs()[0].ptr);
121 121
122 // Making an an alternate A and B with B forwarding the direct dependents. 122 // Making an an alternate A and B with B forwarding the direct dependents.
123 TestTarget a_fwd(setup, "//foo:a_fwd", Target::EXECUTABLE); 123 TestTarget a_fwd(setup, "//foo:a_fwd", Target::EXECUTABLE);
124 TestTarget b_fwd(setup, "//foo:b_fwd", Target::STATIC_LIBRARY); 124 TestTarget b_fwd(setup, "//foo:b_fwd", Target::STATIC_LIBRARY);
125 a_fwd.private_deps().push_back(LabelTargetPair(&b_fwd)); 125 a_fwd.private_deps().push_back(LabelTargetPair(&b_fwd));
126 b_fwd.private_deps().push_back(LabelTargetPair(&c)); 126 b_fwd.private_deps().push_back(LabelTargetPair(&c));
127 b_fwd.forward_dependent_configs().push_back(LabelTargetPair(&c)); 127 b_fwd.forward_dependent_configs().push_back(LabelTargetPair(&c));
brettw 2015/10/05 18:06:06 Delete this. I'm not sure if any expectations belo
tfarina 2015/10/06 03:28:50 Done.
128 128
129 ASSERT_TRUE(b_fwd.OnResolved(&err)); 129 ASSERT_TRUE(b_fwd.OnResolved(&err));
130 ASSERT_TRUE(a_fwd.OnResolved(&err)); 130 ASSERT_TRUE(a_fwd.OnResolved(&err));
131 131
132 // A_fwd should now have both configs. 132 // A_fwd should now have both configs.
133 ASSERT_EQ(2u, a_fwd.configs().size()); 133 ASSERT_EQ(2u, a_fwd.configs().size());
134 EXPECT_EQ(&all, a_fwd.configs()[0].ptr); 134 EXPECT_EQ(&all, a_fwd.configs()[0].ptr);
135 EXPECT_EQ(&direct, a_fwd.configs()[1].ptr); 135 EXPECT_EQ(&direct, a_fwd.configs()[1].ptr);
136 ASSERT_EQ(1u, a_fwd.all_dependent_configs().size()); 136 ASSERT_EQ(1u, a_fwd.all_dependent_configs().size());
137 EXPECT_EQ(&all, a_fwd.all_dependent_configs()[0].ptr); 137 EXPECT_EQ(&all, a_fwd.all_dependent_configs()[0].ptr);
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 "\n" 612 "\n"
613 "From //foo:bar\n" 613 "From //foo:bar\n"
614 " header: pch.h\n" 614 " header: pch.h\n"
615 " source: //pcs.cc\n" 615 " source: //pcs.cc\n"
616 "\n" 616 "\n"
617 "From //foo:c2\n" 617 "From //foo:c2\n"
618 " header: pch2.h\n" 618 " header: pch2.h\n"
619 " source: //pcs2.cc", 619 " source: //pcs2.cc",
620 err.help_text()); 620 err.help_text());
621 } 621 }
OLDNEW
« tools/gn/builder.cc ('K') | « tools/gn/target_generator.cc ('k') | tools/gn/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698