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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "tools/gn/err.h" | 10 #include "tools/gn/err.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 { "//chrome/", ":", false, "", " ", "", "" }, | 33 { "//chrome/", ":", false, "", " ", "", "" }, |
34 { "//chrome/", "/:", false, "", " ", "", "" }, | 34 { "//chrome/", "/:", false, "", " ", "", "" }, |
35 { "//chrome/", "blah", true, "//chrome/blah/", " blah", "//t/", "d" }, | 35 { "//chrome/", "blah", true, "//chrome/blah/", " blah", "//t/", "d" }, |
36 { "//chrome/", "blah:bar", true, "//chrome/blah/", " bar", "//t/", "d" }, | 36 { "//chrome/", "blah:bar", true, "//chrome/blah/", " bar", "//t/", "d" }, |
37 // Absolute paths. | 37 // Absolute paths. |
38 { "//chrome/", "/chrome:bar", true , "/chrome/", " bar", "//t/", "d" }, | 38 { "//chrome/", "/chrome:bar", true , "/chrome/", " bar", "//t/", "d" }, |
39 { "//chrome/", "/chrome/:bar", true, "/chrome/", " bar", "//t/", "d" }, | 39 { "//chrome/", "/chrome/:bar", true, "/chrome/", " bar", "//t/", "d" }, |
40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
41 { "//chrome/", "/C:/chrome:bar", true , "/C:/chrome/", " bar", "//t/", "d" }, | 41 { "//chrome/", "/C:/chrome:bar", true , "/C:/chrome/", " bar", "//t/", "d" }, |
42 { "//chrome/", "/C:/chrome/:bar", true, "/C:/chrome/", " bar", "//t/", "d" }, | 42 { "//chrome/", "/C:/chrome/:bar", true, "/C:/chrome/", " bar", "//t/", "d" }, |
43 { "//chrome/", "C:/chrome:bar", false, "", " ", "", "" }, | 43 { "//chrome/", "C:/chrome:bar", true, "/C:/chrome/", " bar", "//t/", "d" }, |
brettw
2016/04/05 00:01:57
Can you add a test here that "C:foo" is parsed as
| |
44 #endif | 44 #endif |
45 // Refers to root dir. | 45 // Refers to root dir. |
46 { "//chrome/", "//:bar", true, "//", " bar", "//t/", "d" }, | 46 { "//chrome/", "//:bar", true, "//", " bar", "//t/", "d" }, |
47 // Implicit directory | 47 // Implicit directory |
48 { "//chrome/", ":bar", true, "//chrome/", " bar", "//t/", "d" }, | 48 { "//chrome/", ":bar", true, "//chrome/", " bar", "//t/", "d" }, |
49 { "//chrome/renderer/", ":bar", true, "//chrome/renderer/", " bar", "//t/", "d" }, | 49 { "//chrome/renderer/", ":bar", true, "//chrome/renderer/", " bar", "//t/", "d" }, |
50 // Implicit names. | 50 // Implicit names. |
51 { "//chrome/", "//base", true, "//base/", " base", "//t/", "d" }, | 51 { "//chrome/", "//base", true, "//base/", " base", "//t/", "d" }, |
52 { "//chrome/", "//base/i18n", true, "//base/i18n/", " i18n", "//t/", "d" }, | 52 { "//chrome/", "//base/i18n", true, "//base/i18n/", " i18n", "//t/", "d" }, |
53 { "//chrome/", "//base/i18n:foo", true, "//base/i18n/", " foo", "//t/", "d" }, | 53 { "//chrome/", "//base/i18n:foo", true, "//base/i18n/", " foo", "//t/", "d" }, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 EXPECT_EQ(cur.expected_name, result.name()) | 87 EXPECT_EQ(cur.expected_name, result.name()) |
88 << i << " " << cur.str; | 88 << i << " " << cur.str; |
89 EXPECT_EQ(cur.expected_toolchain_dir, | 89 EXPECT_EQ(cur.expected_toolchain_dir, |
90 result.toolchain_dir().value()) | 90 result.toolchain_dir().value()) |
91 << i << " " << cur.str; | 91 << i << " " << cur.str; |
92 EXPECT_EQ(cur.expected_toolchain_name, result.toolchain_name()) | 92 EXPECT_EQ(cur.expected_toolchain_name, result.toolchain_name()) |
93 << i << " " << cur.str; | 93 << i << " " << cur.str; |
94 } | 94 } |
95 } | 95 } |
96 } | 96 } |
OLD | NEW |