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

Side by Side Diff: chrome/test/pylib/common/chrome_paths.py

Issue 14882007: Android: support glob-style gtest filters with content browser tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use DIR_SOURCE_ROOT. Created 7 years, 6 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
« no previous file with comments | « chrome/test/pylib/common/__init__.py ('k') | chrome/test/pylib/common/unittest_util.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 """Paths to common resources in the Chrome repository."""
6
7 import os
8
9 import util
10
11
12 _THIS_DIR = os.path.abspath(os.path.dirname(__file__))
13
14
15 def GetSrc():
16 """Returns the path to the root src directory."""
17 return os.path.join(_THIS_DIR, os.pardir, os.pardir, os.pardir, os.pardir)
18
19
20 def GetTestData():
21 """Returns the path to the src/chrome/test/data directory."""
22 return os.path.join(GetSrc(), 'chrome', 'test', 'data')
23
24
25 def GetThirdParty():
26 """Returns the path to the src/third_party directory."""
27 return os.path.join(GetSrc(), 'third_party')
28
29
30 def GetBuildDir(required_paths):
31 """Returns the preferred build directory that contains given paths."""
32 dirs = ['out', 'build', 'xcodebuild', 'sconsbuild']
33 rel_dirs = [os.path.join(x, 'Release') for x in dirs]
34 debug_dirs = [os.path.join(x, 'Debug') for x in dirs]
35 full_dirs = [os.path.join(GetSrc(), x) for x in rel_dirs + debug_dirs]
36 for build_dir in full_dirs:
37 for required_path in required_paths:
38 if not os.path.exists(os.path.join(build_dir, required_path)):
39 break
40 else:
41 return build_dir
42 raise RuntimeError('Cannot find build directory containing ' +
43 ', '.join(required_paths))
OLDNEW
« no previous file with comments | « chrome/test/pylib/common/__init__.py ('k') | chrome/test/pylib/common/unittest_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698