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/scope_per_file_provider.h" | 7 #include "tools/gn/scope_per_file_provider.h" |
8 #include "tools/gn/settings.h" | 8 #include "tools/gn/settings.h" |
9 #include "tools/gn/toolchain.h" | 9 #include "tools/gn/toolchain.h" |
10 #include "tools/gn/variables.h" | 10 #include "tools/gn/variables.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 Settings settings(&build_settings, &toolchain, std::string()); | 24 Settings settings(&build_settings, &toolchain, std::string()); |
25 Scope scope(&settings); | 25 Scope scope(&settings); |
26 scope.set_source_dir(SourceDir("//source/")); | 26 scope.set_source_dir(SourceDir("//source/")); |
27 | 27 |
28 ScopePerFileProvider provider(&scope); | 28 ScopePerFileProvider provider(&scope); |
29 | 29 |
30 EXPECT_EQ("//toolchain:tc", provider.GetProgrammaticValue( | 30 EXPECT_EQ("//toolchain:tc", provider.GetProgrammaticValue( |
31 variables::kCurrentToolchain)->string_value()); | 31 variables::kCurrentToolchain)->string_value()); |
32 EXPECT_EQ("//toolchain:default", provider.GetProgrammaticValue( | 32 EXPECT_EQ("//toolchain:default", provider.GetProgrammaticValue( |
33 variables::kDefaultToolchain)->string_value()); | 33 variables::kDefaultToolchain)->string_value()); |
34 EXPECT_EQ("../..",provider.GetProgrammaticValue( | |
35 variables::kRelativeBuildToSourceRootDir)->string_value()); | |
36 EXPECT_EQ("../out/Debug", provider.GetProgrammaticValue( | |
37 variables::kRelativeRootOutputDir)->string_value()); | |
38 EXPECT_EQ("../out/Debug/gen", provider.GetProgrammaticValue( | |
39 variables::kRelativeRootGenDir)->string_value()); | |
40 EXPECT_EQ("..", provider.GetProgrammaticValue( | |
41 variables::kRelativeSourceRootDir)->string_value()); | |
42 EXPECT_EQ("../out/Debug/obj/source", provider.GetProgrammaticValue( | |
43 variables::kRelativeTargetOutputDir)->string_value()); | |
44 EXPECT_EQ("../out/Debug/gen/source", provider.GetProgrammaticValue( | |
45 variables::kRelativeTargetGenDir)->string_value()); | |
46 EXPECT_EQ("//out/Debug/gen",provider.GetProgrammaticValue( | 34 EXPECT_EQ("//out/Debug/gen",provider.GetProgrammaticValue( |
47 variables::kRootGenDir)->string_value()); | 35 variables::kRootGenDir)->string_value()); |
| 36 EXPECT_EQ("//out/Debug",provider.GetProgrammaticValue( |
| 37 variables::kRootOutDir)->string_value()); |
48 EXPECT_EQ("//out/Debug/gen/source",provider.GetProgrammaticValue( | 38 EXPECT_EQ("//out/Debug/gen/source",provider.GetProgrammaticValue( |
49 variables::kTargetGenDir)->string_value()); | 39 variables::kTargetGenDir)->string_value()); |
| 40 EXPECT_EQ("//out/Debug/obj/source",provider.GetProgrammaticValue( |
| 41 variables::kTargetOutDir)->string_value()); |
50 } | 42 } |
OLD | NEW |