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

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

Issue 775543003: Fix FilesystemUtils.SourceDirForPath after r306368 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | no next file » | 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.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/filesystem_utils.h" 10 #include "tools/gn/filesystem_utils.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 base::FilePath("/source/foo/bar/")).value()); 409 base::FilePath("/source/foo/bar/")).value());
410 EXPECT_EQ("//bar/baz/", SourceDirForPath(root, 410 EXPECT_EQ("//bar/baz/", SourceDirForPath(root,
411 base::FilePath("/source/foo/bar/baz/")).value()); 411 base::FilePath("/source/foo/bar/baz/")).value());
412 412
413 // Should be case-sensitive. 413 // Should be case-sensitive.
414 EXPECT_EQ("/SOURCE/foo/bar/", SourceDirForPath(root, 414 EXPECT_EQ("/SOURCE/foo/bar/", SourceDirForPath(root,
415 base::FilePath("/SOURCE/foo/bar/")).value()); 415 base::FilePath("/SOURCE/foo/bar/")).value());
416 416
417 // Empty source dir. 417 // Empty source dir.
418 base::FilePath empty; 418 base::FilePath empty;
419 EXPECT_EQ("/source/foo", 419 EXPECT_EQ("/source/foo/",
420 SourceDirForPath(empty, base::FilePath("/source/foo")).value()); 420 SourceDirForPath(empty, base::FilePath("/source/foo")).value());
421 #endif 421 #endif
422 } 422 }
423 423
424 TEST(FilesystemUtils, GetToolchainDirs) { 424 TEST(FilesystemUtils, GetToolchainDirs) {
425 BuildSettings build_settings; 425 BuildSettings build_settings;
426 build_settings.SetBuildDir(SourceDir("//out/Debug/")); 426 build_settings.SetBuildDir(SourceDir("//out/Debug/"));
427 427
428 // The default toolchain. 428 // The default toolchain.
429 Settings default_settings(&build_settings, ""); 429 Settings default_settings(&build_settings, "");
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 EXPECT_EQ("gen/", GetToolchainGenDirAsOutputFile(&settings).value()); 567 EXPECT_EQ("gen/", GetToolchainGenDirAsOutputFile(&settings).value());
568 EXPECT_EQ("//obj/", 568 EXPECT_EQ("//obj/",
569 GetOutputDirForSourceDir(&settings, SourceDir("//")).value()); 569 GetOutputDirForSourceDir(&settings, SourceDir("//")).value());
570 EXPECT_EQ("obj/", 570 EXPECT_EQ("obj/",
571 GetOutputDirForSourceDirAsOutputFile( 571 GetOutputDirForSourceDirAsOutputFile(
572 &settings, SourceDir("//")).value()); 572 &settings, SourceDir("//")).value());
573 EXPECT_EQ("gen/", 573 EXPECT_EQ("gen/",
574 GetGenDirForSourceDirAsOutputFile( 574 GetGenDirForSourceDirAsOutputFile(
575 &settings, SourceDir("//")).value()); 575 &settings, SourceDir("//")).value());
576 } 576 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698