OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/test/python_utils.h" | 5 #include "net/test/python_utils.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 generated_code_dir = *dir; | 102 generated_code_dir = *dir; |
103 #endif | 103 #endif |
104 *dir = generated_code_dir.Append(kPyProto); | 104 *dir = generated_code_dir.Append(kPyProto); |
105 VLOG(2) << "Found " << kPyProto.value() << " in " << dir->value(); | 105 VLOG(2) << "Found " << kPyProto.value() << " in " << dir->value(); |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 bool GetPythonCommand(CommandLine* python_cmd) { | 109 bool GetPythonCommand(CommandLine* python_cmd) { |
110 DCHECK(python_cmd); | 110 DCHECK(python_cmd); |
111 | 111 |
112 #if defined(OS_WIN) | |
113 // This permits finding the proper python in path even if it is a .bat file. | |
114 python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("cmd.exe"))); | |
115 python_cmd->AppendArg("/c"); | |
116 python_cmd->AppendArg("python"); | |
117 | |
Paweł Hajdan Jr.
2013/12/02 19:37:56
nit: Remove empty line.
M-A Ruel
2013/12/02 20:13:16
Done.
| |
118 #elif defined(OS_POSIX) | |
112 python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("python"))); | 119 python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("python"))); |
113 | 120 #endif |
114 // Launch python in unbuffered mode, so that python output doesn't mix with | 121 // Launch python in unbuffered mode, so that python output doesn't mix with |
115 // gtest output in buildbot log files. See http://crbug.com/147368. | 122 // gtest output in buildbot log files. See http://crbug.com/147368. |
116 python_cmd->AppendArg("-u"); | 123 python_cmd->AppendArg("-u"); |
117 | 124 |
118 return true; | 125 return true; |
119 } | 126 } |
OLD | NEW |