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/err.h" | 6 #include "tools/gn/err.h" |
7 #include "tools/gn/label.h" | 7 #include "tools/gn/label.h" |
8 #include "tools/gn/value.h" | 8 #include "tools/gn/value.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 15 matching lines...) Expand all Loading... |
26 // cur input succ expected dir n
ame tc dir tc name | 26 // cur input succ expected dir n
ame tc dir tc name |
27 { "//chrome/", "", false, "", "
", "", "" }, | 27 { "//chrome/", "", false, "", "
", "", "" }, |
28 { "//chrome/", "/", false, "", "
", "", "" }, | 28 { "//chrome/", "/", false, "", "
", "", "" }, |
29 { "//chrome/", ":", false, "", "
", "", "" }, | 29 { "//chrome/", ":", false, "", "
", "", "" }, |
30 { "//chrome/", "/:", false, "", "
", "", "" }, | 30 { "//chrome/", "/:", false, "", "
", "", "" }, |
31 { "//chrome/", "blah", true, "//chrome/blah/", "
blah", "//t/", "d" }, | 31 { "//chrome/", "blah", true, "//chrome/blah/", "
blah", "//t/", "d" }, |
32 { "//chrome/", "blah:bar", true, "//chrome/blah/", "
bar", "//t/", "d" }, | 32 { "//chrome/", "blah:bar", true, "//chrome/blah/", "
bar", "//t/", "d" }, |
33 // Absolute paths. | 33 // Absolute paths. |
34 { "//chrome/", "/chrome:bar", true , "/chrome/", "
bar", "//t/", "d" }, | 34 { "//chrome/", "/chrome:bar", true , "/chrome/", "
bar", "//t/", "d" }, |
35 { "//chrome/", "/chrome/:bar", true, "/chrome/", "
bar", "//t/", "d" }, | 35 { "//chrome/", "/chrome/:bar", true, "/chrome/", "
bar", "//t/", "d" }, |
| 36 #if defined(OS_WIN) |
| 37 { "//chrome/", "/C:/chrome:bar", true , "/C:/chrome/", "
bar", "//t/", "d" }, |
| 38 { "//chrome/", "/C:/chrome/:bar", true, "/C:/chrome/", "
bar", "//t/", "d" }, |
| 39 { "//chrome/", "C:/chrome:bar", false, "", "
", "", "" }, |
| 40 #endif |
36 // Refers to root dir. | 41 // Refers to root dir. |
37 { "//chrome/", "//:bar", true, "//", "
bar", "//t/", "d" }, | 42 { "//chrome/", "//:bar", true, "//", "
bar", "//t/", "d" }, |
38 // Implicit directory | 43 // Implicit directory |
39 { "//chrome/", ":bar", true, "//chrome/", "
bar", "//t/", "d" }, | 44 { "//chrome/", ":bar", true, "//chrome/", "
bar", "//t/", "d" }, |
40 { "//chrome/renderer/", ":bar", true, "//chrome/renderer/", "
bar", "//t/", "d" }, | 45 { "//chrome/renderer/", ":bar", true, "//chrome/renderer/", "
bar", "//t/", "d" }, |
41 // Implicit names. | 46 // Implicit names. |
42 { "//chrome/", "//base", true, "//base/", "
base", "//t/", "d" }, | 47 { "//chrome/", "//base", true, "//base/", "
base", "//t/", "d" }, |
43 { "//chrome/", "//base/i18n", true, "//base/i18n/", "
i18n", "//t/", "d" }, | 48 { "//chrome/", "//base/i18n", true, "//base/i18n/", "
i18n", "//t/", "d" }, |
44 { "//chrome/", "//base/i18n:foo", true, "//base/i18n/", "
foo", "//t/", "d" }, | 49 { "//chrome/", "//base/i18n:foo", true, "//base/i18n/", "
foo", "//t/", "d" }, |
45 { "//chrome/", "//", false, "", "
", "", "" }, | 50 { "//chrome/", "//", false, "", "
", "", "" }, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 EXPECT_EQ(cur.expected_name, result.name()) | 83 EXPECT_EQ(cur.expected_name, result.name()) |
79 << i << " " << cur.str; | 84 << i << " " << cur.str; |
80 EXPECT_EQ(cur.expected_toolchain_dir, | 85 EXPECT_EQ(cur.expected_toolchain_dir, |
81 result.toolchain_dir().value()) | 86 result.toolchain_dir().value()) |
82 << i << " " << cur.str; | 87 << i << " " << cur.str; |
83 EXPECT_EQ(cur.expected_toolchain_name, result.toolchain_name()) | 88 EXPECT_EQ(cur.expected_toolchain_name, result.toolchain_name()) |
84 << i << " " << cur.str; | 89 << i << " " << cur.str; |
85 } | 90 } |
86 } | 91 } |
87 } | 92 } |
OLD | NEW |