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

Unified Diff: tools/gn/filesystem_utils_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/filesystem_utils.cc ('k') | tools/gn/function_get_path_info_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/filesystem_utils_unittest.cc
diff --git a/tools/gn/filesystem_utils_unittest.cc b/tools/gn/filesystem_utils_unittest.cc
index d398366e69c6f8e27536d954d2167ec32ebb0b42..9f874ebd4f58a8840d5b7bc5e67b5dced66b31e5 100644
--- a/tools/gn/filesystem_utils_unittest.cc
+++ b/tools/gn/filesystem_utils_unittest.cc
@@ -505,6 +505,22 @@ TEST(FilesystemUtils, GetOutDirForSourceDir) {
EXPECT_EQ("two/obj/foo/bar/",
GetOutputDirForSourceDirAsOutputFile(
&other_settings, SourceDir("//foo/bar/")).value());
+
+ // Absolute source path
+ EXPECT_EQ("//out/Debug/obj/ABS_PATH/abs/",
+ GetOutputDirForSourceDir(
+ &default_settings, SourceDir("/abs")).value());
+ EXPECT_EQ("obj/ABS_PATH/abs/",
+ GetOutputDirForSourceDirAsOutputFile(
+ &default_settings, SourceDir("/abs")).value());
+#if defined(OS_WIN)
+ EXPECT_EQ("//out/Debug/obj/ABS_PATH/C/abs/",
+ GetOutputDirForSourceDir(
+ &default_settings, SourceDir("/C:/abs")).value());
+ EXPECT_EQ("obj/ABS_PATH/C/abs/",
+ GetOutputDirForSourceDirAsOutputFile(
+ &default_settings, SourceDir("/C:/abs")).value());
+#endif
}
TEST(FilesystemUtils, GetGenDirForSourceDir) {
« no previous file with comments | « tools/gn/filesystem_utils.cc ('k') | tools/gn/function_get_path_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698