| 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 default_context, SourceDir("/C:/abs"), BuildDirType::GEN) | 762 default_context, SourceDir("/C:/abs"), BuildDirType::GEN) |
| 763 .value()); | 763 .value()); |
| 764 #endif | 764 #endif |
| 765 } | 765 } |
| 766 | 766 |
| 767 TEST(FilesystemUtils, GetBuildDirForTarget) { | 767 TEST(FilesystemUtils, GetBuildDirForTarget) { |
| 768 BuildSettings build_settings; | 768 BuildSettings build_settings; |
| 769 build_settings.SetBuildDir(SourceDir("//out/Debug/")); | 769 build_settings.SetBuildDir(SourceDir("//out/Debug/")); |
| 770 Settings settings(&build_settings, ""); | 770 Settings settings(&build_settings, ""); |
| 771 | 771 |
| 772 Target a(&settings, Label(SourceDir("//foo/bar/"), "baz")); | 772 Target a(&settings, Label(SourceDir("//foo/bar/"), "baz"), {}); |
| 773 EXPECT_EQ("//out/Debug/obj/foo/bar/", | 773 EXPECT_EQ("//out/Debug/obj/foo/bar/", |
| 774 GetBuildDirForTargetAsSourceDir(&a, BuildDirType::OBJ).value()); | 774 GetBuildDirForTargetAsSourceDir(&a, BuildDirType::OBJ).value()); |
| 775 EXPECT_EQ("obj/foo/bar/", | 775 EXPECT_EQ("obj/foo/bar/", |
| 776 GetBuildDirForTargetAsOutputFile(&a, BuildDirType::OBJ).value()); | 776 GetBuildDirForTargetAsOutputFile(&a, BuildDirType::OBJ).value()); |
| 777 EXPECT_EQ("//out/Debug/gen/foo/bar/", | 777 EXPECT_EQ("//out/Debug/gen/foo/bar/", |
| 778 GetBuildDirForTargetAsSourceDir(&a, BuildDirType::GEN).value()); | 778 GetBuildDirForTargetAsSourceDir(&a, BuildDirType::GEN).value()); |
| 779 EXPECT_EQ("gen/foo/bar/", | 779 EXPECT_EQ("gen/foo/bar/", |
| 780 GetBuildDirForTargetAsOutputFile(&a, BuildDirType::GEN).value()); | 780 GetBuildDirForTargetAsOutputFile(&a, BuildDirType::GEN).value()); |
| 781 } | 781 } |
| 782 | 782 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 797 GetBuildDirAsSourceDir(context, BuildDirType::OBJ).value()); | 797 GetBuildDirAsSourceDir(context, BuildDirType::OBJ).value()); |
| 798 | 798 |
| 799 EXPECT_EQ("", | 799 EXPECT_EQ("", |
| 800 GetBuildDirAsOutputFile(context, BuildDirType::TOOLCHAIN_ROOT) | 800 GetBuildDirAsOutputFile(context, BuildDirType::TOOLCHAIN_ROOT) |
| 801 .value()); | 801 .value()); |
| 802 EXPECT_EQ("gen/", | 802 EXPECT_EQ("gen/", |
| 803 GetBuildDirAsOutputFile(context, BuildDirType::GEN).value()); | 803 GetBuildDirAsOutputFile(context, BuildDirType::GEN).value()); |
| 804 EXPECT_EQ("obj/", | 804 EXPECT_EQ("obj/", |
| 805 GetBuildDirAsOutputFile(context, BuildDirType::OBJ).value()); | 805 GetBuildDirAsOutputFile(context, BuildDirType::OBJ).value()); |
| 806 } | 806 } |
| OLD | NEW |