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

Side by Side Diff: net/tools/testserver/run_testserver.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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 29 matching lines...) Expand all
40 40
41 sync_test_path = 41 sync_test_path =
42 sync_test_path.Append(FILE_PATH_LITERAL("chromiumsync_test.py")); 42 sync_test_path.Append(FILE_PATH_LITERAL("chromiumsync_test.py"));
43 FilePath python_runtime; 43 FilePath python_runtime;
44 if (!GetPythonRunTime(&python_runtime)) { 44 if (!GetPythonRunTime(&python_runtime)) {
45 LOG(ERROR) << "Could not get python runtime command."; 45 LOG(ERROR) << "Could not get python runtime command.";
46 return false; 46 return false;
47 } 47 }
48 48
49 CommandLine python_command(python_runtime); 49 CommandLine python_command(python_runtime);
50
51 // Use unbuffered output, so that testserver output doesn't mix with gtest
52 // output in test log files. See http://crbug.com/147368.
53 python_command.AppendArg("-u");
54
50 python_command.AppendArgPath(sync_test_path); 55 python_command.AppendArgPath(sync_test_path);
51 if (!base::LaunchProcess(python_command, base::LaunchOptions(), NULL)) { 56 if (!base::LaunchProcess(python_command, base::LaunchOptions(), NULL)) {
52 LOG(ERROR) << "Failed to launch test script."; 57 LOG(ERROR) << "Failed to launch test script.";
53 return false; 58 return false;
54 } 59 }
55 return true; 60 return true;
56 } 61 }
57 62
58 // Gets a port value from the switch with name |switch_name| and writes it to 63 // Gets a port value from the switch with name |switch_name| and writes it to
59 // |port|. Returns true if successful and false otherwise. 64 // |port|. Returns true if successful and false otherwise.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 UTF16ToUTF8(test_server->document_root().LossyDisplayName()).c_str()); 180 UTF16ToUTF8(test_server->document_root().LossyDisplayName()).c_str());
176 return -1; 181 return -1;
177 } 182 }
178 183
179 printf("testserver running at %s (type ctrl+c to exit)\n", 184 printf("testserver running at %s (type ctrl+c to exit)\n",
180 test_server->host_port_pair().ToString().c_str()); 185 test_server->host_port_pair().ToString().c_str());
181 186
182 message_loop.Run(); 187 message_loop.Run();
183 return 0; 188 return 0;
184 } 189 }
OLDNEW
« content/public/test/browser_test_utils.cc ('K') | « net/test/local_test_server_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698