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

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

Issue 302033004: GN: Don't link source sets into static libraries (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/target.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/settings.h" 8 #include "tools/gn/settings.h"
9 #include "tools/gn/target.h" 9 #include "tools/gn/target.h"
10 #include "tools/gn/toolchain.h" 10 #include "tools/gn/toolchain.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 d.OnResolved(); 218 d.OnResolved();
219 c.OnResolved(); 219 c.OnResolved();
220 b.OnResolved(); 220 b.OnResolved();
221 a.OnResolved(); 221 a.OnResolved();
222 222
223 // C should have D in its inherited libs. 223 // C should have D in its inherited libs.
224 const std::set<const Target*>& c_inherited = c.inherited_libraries(); 224 const std::set<const Target*>& c_inherited = c.inherited_libraries();
225 EXPECT_EQ(1u, c_inherited.size()); 225 EXPECT_EQ(1u, c_inherited.size());
226 EXPECT_TRUE(c_inherited.find(&d) != c_inherited.end()); 226 EXPECT_TRUE(c_inherited.find(&d) != c_inherited.end());
227 227
228 // B should have C in its inherited libs, but not D (the static library will 228 // B should have C and D in its inherited libs.
229 // include the source sets's code).
230 const std::set<const Target*>& b_inherited = b.inherited_libraries(); 229 const std::set<const Target*>& b_inherited = b.inherited_libraries();
231 EXPECT_EQ(1u, b_inherited.size()); 230 EXPECT_EQ(2u, b_inherited.size());
232 EXPECT_TRUE(b_inherited.find(&c) != b_inherited.end()); 231 EXPECT_TRUE(b_inherited.find(&c) != b_inherited.end());
232 EXPECT_TRUE(b_inherited.find(&d) != b_inherited.end());
233 233
234 // A should have B in its inherited libs, but not any others (the shared 234 // A should have B in its inherited libs, but not any others (the shared
235 // library will include the static library, which will include the source 235 // library will include the static library and source set).
236 // set).
237 const std::set<const Target*>& a_inherited = a.inherited_libraries(); 236 const std::set<const Target*>& a_inherited = a.inherited_libraries();
238 EXPECT_EQ(1u, a_inherited.size()); 237 EXPECT_EQ(1u, a_inherited.size());
239 EXPECT_TRUE(a_inherited.find(&b) != a_inherited.end()); 238 EXPECT_TRUE(a_inherited.find(&b) != a_inherited.end());
240 } 239 }
OLDNEW
« no previous file with comments | « tools/gn/target.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698