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

Unified Diff: net/test/python_utils.cc

Issue 10907162: Reland: Take 2: Force python test server output to be unbuffered, so it doesn't mix with gtest outpu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't use unbuffered mode on Windows. Created 8 years, 3 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 | « net/test/python_utils.h ('k') | net/test/python_utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/python_utils.cc
diff --git a/net/test/python_utils.cc b/net/test/python_utils.cc
index 0eec8166dd113c51637d8628b6bd96b284d6d61d..d81941423bed418ea585360bc2d0870541fb2684 100644
--- a/net/test/python_utils.cc
+++ b/net/test/python_utils.cc
@@ -5,6 +5,7 @@
#include "net/test/python_utils.h"
#include "base/base_paths.h"
+#include "base/command_line.h"
#include "base/environment.h"
#include "base/file_path.h"
#include "base/file_util.h"
@@ -103,15 +104,26 @@ bool GetPyProtoPath(FilePath* dir) {
return true;
}
-bool GetPythonRunTime(FilePath* dir) {
+bool GetPythonCommand(CommandLine* python_cmd) {
+ DCHECK(python_cmd);
+ FilePath dir;
#if defined(OS_WIN)
- if (!PathService::Get(base::DIR_SOURCE_ROOT, dir))
+ if (!PathService::Get(base::DIR_SOURCE_ROOT, &dir))
return false;
- *dir = dir->Append(FILE_PATH_LITERAL("third_party"))
- .Append(FILE_PATH_LITERAL("python_26"))
- .Append(FILE_PATH_LITERAL("python.exe"));
+ dir = dir.Append(FILE_PATH_LITERAL("third_party"))
+ .Append(FILE_PATH_LITERAL("python_26"))
+ .Append(FILE_PATH_LITERAL("python.exe"));
#elif defined(OS_POSIX)
- *dir = FilePath("python");
+ dir = FilePath("python");
#endif
+
+ python_cmd->SetProgram(dir);
+
+#if defined(OS_POSIX)
+ // Launch python in unbuffered mode, so that python output doesn't mix with
+ // gtest output in buildbot log files. See http://crbug.com/147368.
+ python_cmd->AppendArg("-u");
+#endif
+
return true;
}
« no previous file with comments | « net/test/python_utils.h ('k') | net/test/python_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698