OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 import os | |
7 import sys | |
8 | |
9 _CATAPULT_BASE_PATH = os.path.abspath( | |
10 os.path.join(os.path.dirname(__file__), '..')) | |
11 _TELEMETRY_BASE_PATH = os.path.abspath(os.path.join(_CATAPULT_BASE_PATH, '..')) | |
12 _CATAPULT_PATH = os.path.abspath(os.path.join( | |
13 _CATAPULT_BASE_PATH, '..', '..', '..', 'third_party', 'catapult')) | |
14 | |
15 | |
16 def _RunTestsOrDie(top_level_dir): | |
17 exit_code = run_with_typ.Run(top_level_dir, path=[_TELEMETRY_BASE_PATH]) | |
18 if exit_code: | |
19 sys.exit(exit_code) | |
20 | |
21 | |
22 def _AddToPathIfNeeded(path): | |
23 if path not in sys.path: | |
24 sys.path.insert(0, path) | |
25 | |
26 | |
27 if __name__ == '__main__': | |
28 _AddToPathIfNeeded(_CATAPULT_PATH) | |
29 | |
30 from hooks import install | |
31 if '--no-install-hooks' in sys.argv: | |
32 sys.argv.remove('--no-install-hooks') | |
33 else: | |
34 install.InstallHooks() | |
35 | |
36 from catapult_build import run_with_typ | |
37 _RunTestsOrDie(_CATAPULT_BASE_PATH) | |
38 sys.exit(0) | |
OLD | NEW |