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

Side by Side Diff: build/android/pylib/host_driven/test_server.py

Issue 59713002: Android: removes hardcoded out directory in test_server.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Host driven test server controller. 5 """Host driven test server controller.
6 6
7 This class controls the startup and shutdown of a python driven test server that 7 This class controls the startup and shutdown of a python driven test server that
8 runs in a separate process. 8 runs in a separate process.
9 9
10 The server starts up automatically when the object is created. 10 The server starts up automatically when the object is created.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 member variable |port|. 63 member variable |port|.
64 test_server_path: The path (relative to the root src dir) of the server 64 test_server_path: The path (relative to the root src dir) of the server
65 """ 65 """
66 self.host = _TEST_SERVER_HOST 66 self.host = _TEST_SERVER_HOST
67 self.port = test_server_port + shard_index 67 self.port = test_server_port + shard_index
68 68
69 src_dir = constants.DIR_SOURCE_ROOT 69 src_dir = constants.DIR_SOURCE_ROOT
70 # Make dirs into a list of absolute paths. 70 # Make dirs into a list of absolute paths.
71 abs_dirs = [os.path.join(src_dir, d) for d in _PYTHONPATH_DIRS] 71 abs_dirs = [os.path.join(src_dir, d) for d in _PYTHONPATH_DIRS]
72 # Add the generated python files to the path 72 # Add the generated python files to the path
73 abs_dirs.extend([os.path.join(src_dir, 'out', constants.GetBuildType(), d) 73 abs_dirs.extend([os.path.join(src_dir, constants.GetOutDirectory(), d)
74 for d in _GENERATED_PYTHONPATH_DIRS]) 74 for d in _GENERATED_PYTHONPATH_DIRS])
75 current_python_path = os.environ.get('PYTHONPATH') 75 current_python_path = os.environ.get('PYTHONPATH')
76 extra_python_path = ':'.join(abs_dirs) 76 extra_python_path = ':'.join(abs_dirs)
77 if current_python_path: 77 if current_python_path:
78 python_path = current_python_path + ':' + extra_python_path 78 python_path = current_python_path + ':' + extra_python_path
79 else: 79 else:
80 python_path = extra_python_path 80 python_path = extra_python_path
81 81
82 # NOTE: A separate python process is used to simplify getting the right 82 # NOTE: A separate python process is used to simplify getting the right
83 # system path for finding includes. 83 # system path for finding includes.
84 cmd = ['python', os.path.join(src_dir, test_server_path), 84 cmd = ['python', os.path.join(src_dir, test_server_path),
85 '--log-to-console', 85 '--log-to-console',
86 ('--host=%s' % self.host), 86 ('--host=%s' % self.host),
87 ('--port=%d' % self.port)] 87 ('--port=%d' % self.port)]
88 self._test_server_process = subprocess.Popen( 88 self._test_server_process = subprocess.Popen(
89 cmd, env={'PYTHONPATH': python_path}) 89 cmd, env={'PYTHONPATH': python_path})
90 90
91 def TearDown(self): 91 def TearDown(self):
92 self._test_server_process.kill() 92 self._test_server_process.kill()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698