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

Side by Side Diff: tools/telemetry/telemetry/__init__.py

Issue 1366913004: Add coverage Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | tools/telemetry/telemetry/testing/run_tests.py » ('j') | 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 """A library for cross-platform browser tests.""" 5 """A library for cross-platform browser tests."""
6 import os 6 import os
7 import sys 7 import sys
8 8
9 # Ensure Python >= 2.7. 9 # Ensure Python >= 2.7.
10 if sys.version_info < (2, 7): 10 if sys.version_info < (2, 7):
11 print >> sys.stderr, 'Need Python 2.7 or greater.' 11 print >> sys.stderr, 'Need Python 2.7 or greater.'
12 sys.exit(-1) 12 sys.exit(-1)
13 13
14 from telemetry.internal.util import global_hooks 14 from telemetry.internal.util import global_hooks
15 global_hooks.InstallHooks() 15 global_hooks.InstallHooks()
16 16
17 # Add depdendencies into our path. 17 # Add depdendencies into our path.
18 from telemetry.core import util 18 from telemetry.core import util
19 19
20 def _AddDirToPythonPath(*path_parts): 20 def _AddDirToPythonPath(*path_parts):
21 path = os.path.abspath(os.path.join(*path_parts)) 21 path = os.path.abspath(os.path.join(*path_parts))
22 if os.path.isdir(path) and path not in sys.path: 22 if os.path.isdir(path) and path not in sys.path:
23 # Some callsite that use telemetry assumes that sys.path[0] is the directory 23 # Some callsite that use telemetry assumes that sys.path[0] is the directory
24 # containing the script, so we add these extra paths to right after it. 24 # containing the script, so we add these extra paths to right after it.
25 sys.path.insert(1, path) 25 sys.path.insert(1, path)
26 26
27 27
28 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'altgraph') 28 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'altgraph')
29 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'coverage')
29 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'mock') 30 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'mock')
30 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'modulegraph') 31 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'modulegraph')
31 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'pexpect') 32 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'pexpect')
32 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'png') 33 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'png')
33 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'pyserial') 34 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'pyserial')
34 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'typ') 35 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'typ')
35 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'webpagereplay') 36 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'webpagereplay')
36 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'websocket-client') 37 _AddDirToPythonPath(util.GetTelemetryThirdPartyDir(), 'websocket-client')
37 38
38 _AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android') 39 _AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android')
39 _AddDirToPythonPath(util.GetChromiumSrcDir(), 40 _AddDirToPythonPath(util.GetChromiumSrcDir(),
40 'third_party', 'catapult', 'tracing') 41 'third_party', 'catapult', 'tracing')
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/telemetry/testing/run_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698