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

Unified Diff: tools/gn/function_get_path_info_unittest.cc

Issue 334333005: Add directory extraction to GN path handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge to new file template function Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/function_get_path_info.cc ('k') | tools/gn/function_get_target_outputs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_get_path_info_unittest.cc
diff --git a/tools/gn/function_get_path_info_unittest.cc b/tools/gn/function_get_path_info_unittest.cc
index 12bdc2a5adab7a0dced4433ccac8d30d8e1ec71b..1756c0c3f4c84a81e7e2fbfad4416f3f56a21dee 100644
--- a/tools/gn/function_get_path_info_unittest.cc
+++ b/tools/gn/function_get_path_info_unittest.cc
@@ -87,3 +87,25 @@ TEST_F(GetPathInfoTest, AbsPath) {
EXPECT_EQ("/foo/", Call("/foo/", "abspath"));
EXPECT_EQ("/", Call("/", "abspath"));
}
+
+// Note build dir is "//out/Debug/".
+TEST_F(GetPathInfoTest, OutDir) {
+ EXPECT_EQ("//out/Debug/obj/src/foo/foo", Call("foo/bar.txt", "out_dir"));
+ EXPECT_EQ("//out/Debug/obj/src/foo/bar", Call("bar/", "out_dir"));
+ EXPECT_EQ("//out/Debug/obj/src/foo", Call(".", "out_dir"));
+ EXPECT_EQ("//out/Debug/obj/src/foo", Call("bar", "out_dir"));
+ EXPECT_EQ("//out/Debug/obj/foo", Call("//foo/bar.txt", "out_dir"));
+ // System paths go into the root obj directory.
+ EXPECT_EQ("//out/Debug/obj", Call("/foo/bar.txt", "out_dir"));
+}
+
+// Note build dir is "//out/Debug/".
+TEST_F(GetPathInfoTest, GenDir) {
+ EXPECT_EQ("//out/Debug/gen/src/foo/foo", Call("foo/bar.txt", "gen_dir"));
+ EXPECT_EQ("//out/Debug/gen/src/foo/bar", Call("bar/", "gen_dir"));
+ EXPECT_EQ("//out/Debug/gen/src/foo", Call(".", "gen_dir"));
+ EXPECT_EQ("//out/Debug/gen/src/foo", Call("bar", "gen_dir"));
+ EXPECT_EQ("//out/Debug/gen/foo", Call("//foo/bar.txt", "gen_dir"));
+ // System paths go into the root obj directory.
+ EXPECT_EQ("//out/Debug/gen", Call("/foo/bar.txt", "gen_dir"));
+}
« no previous file with comments | « tools/gn/function_get_path_info.cc ('k') | tools/gn/function_get_target_outputs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698