OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |