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

Unified Diff: tools/gn/path_output_unittest.cc

Issue 630223002: gn: Support build directories outside the source tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch that compiles and passes unit tests on both Windows and Linux Created 6 years, 1 month 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/path_output.cc ('k') | tools/gn/setup.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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("//"),
« no previous file with comments | « tools/gn/path_output.cc ('k') | tools/gn/setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698