Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: tools/gn/label_unittest.cc

Issue 857163002: Absolute path fixes for gn. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve error message Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/label_pattern.cc ('k') | tools/gn/source_dir.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/gn/label_pattern.cc ('k') | tools/gn/source_dir.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698