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