| 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" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 class TargetTest : public testing::Test { | 14 class TargetTest : public testing::Test { |
| 15 public: | 15 public: |
| 16 TargetTest() | 16 TargetTest() |
| 17 : build_settings_(), | 17 : build_settings_(), |
| 18 toolchain_(Label(SourceDir("//tc/"), "tc")), | 18 toolchain_(Label(SourceDir("//tc/"), "tc")), |
| 19 settings_(&build_settings_, &toolchain_, std::string()) { | 19 settings_(&build_settings_, &toolchain_, std::string()) { |
| 20 } | 20 } |
| 21 ~TargetTest() { | 21 virtual ~TargetTest() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 protected: | 24 protected: |
| 25 BuildSettings build_settings_; | 25 BuildSettings build_settings_; |
| 26 Toolchain toolchain_; | 26 Toolchain toolchain_; |
| 27 Settings settings_; | 27 Settings settings_; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 b_fwd.OnResolved(); | 151 b_fwd.OnResolved(); |
| 152 a_fwd.OnResolved(); | 152 a_fwd.OnResolved(); |
| 153 | 153 |
| 154 // A_fwd should now have both configs. | 154 // A_fwd should now have both configs. |
| 155 ASSERT_EQ(2u, a_fwd.configs().size()); | 155 ASSERT_EQ(2u, a_fwd.configs().size()); |
| 156 EXPECT_EQ(&all, a_fwd.configs()[0]); | 156 EXPECT_EQ(&all, a_fwd.configs()[0]); |
| 157 EXPECT_EQ(&direct, a_fwd.configs()[1]); | 157 EXPECT_EQ(&direct, a_fwd.configs()[1]); |
| 158 ASSERT_EQ(1u, a_fwd.all_dependent_configs().size()); | 158 ASSERT_EQ(1u, a_fwd.all_dependent_configs().size()); |
| 159 EXPECT_EQ(&all, a_fwd.all_dependent_configs()[0]); | 159 EXPECT_EQ(&all, a_fwd.all_dependent_configs()[0]); |
| 160 } | 160 } |
| OLD | NEW |