Index: tools/gn/path_output_unittest.cc |
diff --git a/tools/gn/path_output_unittest.cc b/tools/gn/path_output_unittest.cc |
index 217f6dcfc3b30409dcd59bd289c0a25f98ce5d1c..131f55ec5faa2245caac72992709e121fbfbabbc 100644 |
--- a/tools/gn/path_output_unittest.cc |
+++ b/tools/gn/path_output_unittest.cc |
@@ -4,6 +4,7 @@ |
#include <sstream> |
+#include "base/files/file_path.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "tools/gn/output_file.h" |
#include "tools/gn/path_output.h" |
@@ -12,7 +13,8 @@ |
TEST(PathOutput, Basic) { |
SourceDir build_dir("//out/Debug/"); |
- PathOutput writer(build_dir, ESCAPE_NONE); |
+ base::StringPiece source_root("/source/root"); |
+ PathOutput writer(build_dir, source_root, ESCAPE_NONE); |
{ |
// Normal source-root path. |
std::ostringstream out; |
@@ -53,7 +55,8 @@ TEST(PathOutput, Basic) { |
// Same as basic but the output dir is the root. |
TEST(PathOutput, BasicInRoot) { |
SourceDir build_dir("//"); |
- PathOutput writer(build_dir, ESCAPE_NONE); |
+ base::StringPiece source_root("/source/root"); |
+ PathOutput writer(build_dir, source_root, ESCAPE_NONE); |
{ |
// Normal source-root path. |
std::ostringstream out; |
@@ -70,7 +73,8 @@ TEST(PathOutput, BasicInRoot) { |
TEST(PathOutput, NinjaEscaping) { |
SourceDir build_dir("//out/Debug/"); |
- PathOutput writer(build_dir, ESCAPE_NINJA); |
+ base::StringPiece source_root("/source/root"); |
+ PathOutput writer(build_dir, source_root, ESCAPE_NINJA); |
{ |
// Spaces and $ in filenames. |
std::ostringstream out; |
@@ -87,7 +91,8 @@ TEST(PathOutput, NinjaEscaping) { |
TEST(PathOutput, NinjaForkEscaping) { |
SourceDir build_dir("//out/Debug/"); |
- PathOutput writer(build_dir, ESCAPE_NINJA_COMMAND); |
+ base::StringPiece source_root("/source/root"); |
+ PathOutput writer(build_dir, source_root, ESCAPE_NINJA_COMMAND); |
// Spaces in filenames should get quoted on Windows. |
writer.set_escape_platform(ESCAPE_PLATFORM_WIN); |
@@ -140,7 +145,8 @@ TEST(PathOutput, NinjaForkEscaping) { |
TEST(PathOutput, InhibitQuoting) { |
SourceDir build_dir("//out/Debug/"); |
- PathOutput writer(build_dir, ESCAPE_NINJA_COMMAND); |
+ base::StringPiece source_root("/source/root"); |
+ PathOutput writer(build_dir, source_root, ESCAPE_NINJA_COMMAND); |
writer.set_inhibit_quoting(true); |
writer.set_escape_platform(ESCAPE_PLATFORM_WIN); |
@@ -163,7 +169,8 @@ TEST(PathOutput, InhibitQuoting) { |
TEST(PathOutput, WriteDir) { |
{ |
SourceDir build_dir("//out/Debug/"); |
- PathOutput writer(build_dir, ESCAPE_NINJA); |
+ base::StringPiece source_root("/source/root"); |
+ PathOutput writer(build_dir, source_root, ESCAPE_NINJA); |
{ |
std::ostringstream out; |
writer.WriteDir(out, SourceDir("//foo/bar/"), |
@@ -259,7 +266,8 @@ TEST(PathOutput, WriteDir) { |
} |
{ |
// Empty build dir writer. |
- PathOutput root_writer(SourceDir("//"), ESCAPE_NINJA); |
+ base::StringPiece source_root("/source/root"); |
+ PathOutput root_writer(SourceDir("//"), source_root, ESCAPE_NINJA); |
{ |
std::ostringstream out; |
root_writer.WriteDir(out, SourceDir("//"), |