| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 '--total-shards=%d' % total_shards, | 73 '--total-shards=%d' % total_shards, |
| 74 '--shard-index=%d' % shard_index | 74 '--shard-index=%d' % shard_index |
| 75 ] | 75 ] |
| 76 try: | 76 try: |
| 77 valid = True | 77 valid = True |
| 78 rc = 0 | 78 rc = 0 |
| 79 try: | 79 try: |
| 80 rc = common.run_command([sys.executable] + rest_args + sharding_args + [ | 80 rc = common.run_command([sys.executable] + rest_args + sharding_args + [ |
| 81 '--write-abbreviated-json-results-to', args.isolated_script_test_output, | 81 '--write-abbreviated-json-results-to', args.isolated_script_test_output, |
| 82 ], env=env) | 82 ], env=env) |
| 83 valid = bool(rc == 0) | |
| 84 except Exception: | 83 except Exception: |
| 85 traceback.print_exc() | 84 traceback.print_exc() |
| 86 valid = False | 85 valid = False |
| 87 | 86 |
| 88 if not valid: | 87 if not valid: |
| 89 failures = ['(entire test suite)'] | 88 failures = ['(entire test suite)'] |
| 90 with open(args.isolated_script_test_output, 'w') as fp: | 89 with open(args.isolated_script_test_output, 'w') as fp: |
| 91 json.dump({ | 90 json.dump({ |
| 92 'valid': valid, | 91 'valid': valid, |
| 93 'failures': failures, | 92 'failures': failures, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 109 | 108 |
| 110 if __name__ == '__main__': | 109 if __name__ == '__main__': |
| 111 # Conform minimally to the protocol defined by ScriptTest. | 110 # Conform minimally to the protocol defined by ScriptTest. |
| 112 if 'compile_targets' in sys.argv: | 111 if 'compile_targets' in sys.argv: |
| 113 funcs = { | 112 funcs = { |
| 114 'run': None, | 113 'run': None, |
| 115 'compile_targets': main_compile_targets, | 114 'compile_targets': main_compile_targets, |
| 116 } | 115 } |
| 117 sys.exit(common.run_script(sys.argv[1:], funcs)) | 116 sys.exit(common.run_script(sys.argv[1:], funcs)) |
| 118 sys.exit(main()) | 117 sys.exit(main()) |
| OLD | NEW |