1*8975f5c5SAndroid Build Coastguard Worker#!/usr/bin/env python 2*8975f5c5SAndroid Build Coastguard Worker# 3*8975f5c5SAndroid Build Coastguard Worker# Copyright 2021 The ANGLE Project Authors. All rights reserved. 4*8975f5c5SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be 5*8975f5c5SAndroid Build Coastguard Worker# found in the LICENSE file. 6*8975f5c5SAndroid Build Coastguard Worker""" Merges dEQP sharded test results in the ANGLE testing infrastucture.""" 7*8975f5c5SAndroid Build Coastguard Worker 8*8975f5c5SAndroid Build Coastguard Workerimport os 9*8975f5c5SAndroid Build Coastguard Workerimport sys 10*8975f5c5SAndroid Build Coastguard Workerif sys.version_info.major != 3 and __name__ == '__main__': 11*8975f5c5SAndroid Build Coastguard Worker # Swarming prepends sys.executable so we get python2 regardless of shebang. 12*8975f5c5SAndroid Build Coastguard Worker # Spawn itself with vpython3 instead. 13*8975f5c5SAndroid Build Coastguard Worker import subprocess 14*8975f5c5SAndroid Build Coastguard Worker sys.exit(subprocess.call(['vpython3', os.path.realpath(__file__)] + sys.argv[1:])) 15*8975f5c5SAndroid Build Coastguard Worker 16*8975f5c5SAndroid Build Coastguard Workerimport pathlib # python3 17*8975f5c5SAndroid Build Coastguard Worker 18*8975f5c5SAndroid Build Coastguard WorkerPY_UTILS = str(pathlib.Path(__file__).resolve().parents[1] / 'src' / 'tests' / 'py_utils') 19*8975f5c5SAndroid Build Coastguard Workerif PY_UTILS not in sys.path: 20*8975f5c5SAndroid Build Coastguard Worker os.stat(PY_UTILS) and sys.path.insert(0, PY_UTILS) 21*8975f5c5SAndroid Build Coastguard Workerimport angle_path_util 22*8975f5c5SAndroid Build Coastguard Worker 23*8975f5c5SAndroid Build Coastguard Workerangle_path_util.AddDepsDirToPath('testing/merge_scripts') 24*8975f5c5SAndroid Build Coastguard Workerimport merge_api 25*8975f5c5SAndroid Build Coastguard Workerimport standard_isolated_script_merge 26*8975f5c5SAndroid Build Coastguard Worker 27*8975f5c5SAndroid Build Coastguard Worker 28*8975f5c5SAndroid Build Coastguard Workerdef main(raw_args): 29*8975f5c5SAndroid Build Coastguard Worker 30*8975f5c5SAndroid Build Coastguard Worker parser = merge_api.ArgumentParser() 31*8975f5c5SAndroid Build Coastguard Worker args = parser.parse_args(raw_args) 32*8975f5c5SAndroid Build Coastguard Worker 33*8975f5c5SAndroid Build Coastguard Worker # TODO(jmadill): Merge QPA files into one. http://anglebug.com/42263789 34*8975f5c5SAndroid Build Coastguard Worker 35*8975f5c5SAndroid Build Coastguard Worker return standard_isolated_script_merge.StandardIsolatedScriptMerge( 36*8975f5c5SAndroid Build Coastguard Worker args.output_json, args.summary_json, args.jsons_to_merge) 37*8975f5c5SAndroid Build Coastguard Worker 38*8975f5c5SAndroid Build Coastguard Worker 39*8975f5c5SAndroid Build Coastguard Workerif __name__ == '__main__': 40*8975f5c5SAndroid Build Coastguard Worker sys.exit(main(sys.argv[1:])) 41