| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 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 """Runs an isolate bundled Telemetry GPU integration test. | 6 """Runs an isolate bundled Telemetry GPU integration test. |
| 7 | 7 |
| 8 This script attempts to emulate the contract of gtest-style tests | 8 This script attempts to emulate the contract of gtest-style tests |
| 9 invoked via recipes. The main contract is that the caller passes the | 9 invoked via recipes. The main contract is that the caller passes the |
| 10 argument: | 10 argument: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if total_shards is not None and shard_index is not None: | 80 if total_shards is not None and shard_index is not None: |
| 81 sharding_args = [ | 81 sharding_args = [ |
| 82 '--total-shards=%d' % total_shards, | 82 '--total-shards=%d' % total_shards, |
| 83 '--shard-index=%d' % shard_index | 83 '--shard-index=%d' % shard_index |
| 84 ] | 84 ] |
| 85 try: | 85 try: |
| 86 valid = True | 86 valid = True |
| 87 rc = 0 | 87 rc = 0 |
| 88 try: | 88 try: |
| 89 rc = common.run_command([sys.executable] + rest_args + sharding_args + [ | 89 rc = common.run_command([sys.executable] + rest_args + sharding_args + [ |
| 90 '--write-abbreviated-json-results-to', args.isolated_script_test_output, | 90 '--write-full-results-to', args.isolated_script_test_output |
| 91 ], env=env) | 91 ], env=env) |
| 92 except Exception: | 92 except Exception: |
| 93 traceback.print_exc() | 93 traceback.print_exc() |
| 94 valid = False | 94 valid = False |
| 95 | 95 |
| 96 if not valid: | 96 if not valid: |
| 97 failures = ['(entire test suite)'] | 97 failures = ['(entire test suite)'] |
| 98 with open(args.isolated_script_test_output, 'w') as fp: | 98 with open(args.isolated_script_test_output, 'w') as fp: |
| 99 json.dump({ | 99 json.dump({ |
| 100 'valid': valid, | 100 'valid': valid, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 117 | 117 |
| 118 if __name__ == '__main__': | 118 if __name__ == '__main__': |
| 119 # Conform minimally to the protocol defined by ScriptTest. | 119 # Conform minimally to the protocol defined by ScriptTest. |
| 120 if 'compile_targets' in sys.argv: | 120 if 'compile_targets' in sys.argv: |
| 121 funcs = { | 121 funcs = { |
| 122 'run': None, | 122 'run': None, |
| 123 'compile_targets': main_compile_targets, | 123 'compile_targets': main_compile_targets, |
| 124 } | 124 } |
| 125 sys.exit(common.run_script(sys.argv[1:], funcs)) | 125 sys.exit(common.run_script(sys.argv[1:], funcs)) |
| 126 sys.exit(main()) | 126 sys.exit(main()) |
| OLD | NEW |