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

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: Make GetPythonRunTime take a CommandLine instead of a FilePath. 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
« net/test/python_utils.h ('K') | « net/test/python_utils_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 22 matching lines...) Expand all
33 } 33 }
34 34
35 FilePath sync_test_path; 35 FilePath sync_test_path;
36 if (!net::TestServer::GetTestServerDirectory(&sync_test_path)) { 36 if (!net::TestServer::GetTestServerDirectory(&sync_test_path)) {
37 LOG(ERROR) << "Error trying to get python test server path."; 37 LOG(ERROR) << "Error trying to get python test server path.";
38 return false; 38 return false;
39 } 39 }
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
44 if (!GetPythonRunTime(&python_runtime)) { 44 CommandLine python_command(CommandLine::NO_PROGRAM);
45 if (!GetPythonRunTime(&python_command)) {
45 LOG(ERROR) << "Could not get python runtime command."; 46 LOG(ERROR) << "Could not get python runtime command.";
46 return false; 47 return false;
47 } 48 }
48 49
49 CommandLine python_command(python_runtime);
50 python_command.AppendArgPath(sync_test_path); 50 python_command.AppendArgPath(sync_test_path);
51 if (!base::LaunchProcess(python_command, base::LaunchOptions(), NULL)) { 51 if (!base::LaunchProcess(python_command, base::LaunchOptions(), NULL)) {
52 LOG(ERROR) << "Failed to launch test script."; 52 LOG(ERROR) << "Failed to launch test script.";
53 return false; 53 return false;
54 } 54 }
55 return true; 55 return true;
56 } 56 }
57 57
58 // Gets a port value from the switch with name |switch_name| and writes it to 58 // Gets a port value from the switch with name |switch_name| and writes it to
59 // |port|. Returns true if successful and false otherwise. 59 // |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()); 175 UTF16ToUTF8(test_server->document_root().LossyDisplayName()).c_str());
176 return -1; 176 return -1;
177 } 177 }
178 178
179 printf("testserver running at %s (type ctrl+c to exit)\n", 179 printf("testserver running at %s (type ctrl+c to exit)\n",
180 test_server->host_port_pair().ToString().c_str()); 180 test_server->host_port_pair().ToString().c_str());
181 181
182 message_loop.Run(); 182 message_loop.Run();
183 return 0; 183 return 0;
184 } 184 }
OLDNEW
« net/test/python_utils.h ('K') | « net/test/python_utils_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698