1#!/usr/bin/env vpython3 2# Copyright 2015 The Chromium Authors 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6"""Runs an isolate bundled Telemetry GPU integration test. 7 8If optional argument --isolated-script-test-output=[FILENAME] is passed 9to the script, json is written to that file in the format detailed in 10//docs/testing/json-test-results-format.md. 11 12If optional argument --isolated-script-test-filter=[TEST_NAMES] is passed to 13the script, it should be a double-colon-separated ("::") list of test names, 14to run just that subset of tests. 15 16This script is intended to be the base command invoked by the isolate, 17followed by a subsequent Python script. It could be generalized to 18invoke an arbitrary executable. 19""" 20 21import json 22import os 23import sys 24 25import gpu_integration_test_adapter 26 27# Add src/testing/ into sys.path for importing common without pylint errors. 28sys.path.append( 29 os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) 30from scripts import common 31 32 33def main(): 34 adapter = gpu_integration_test_adapter.GpuIntegrationTestAdapater() 35 return adapter.run_test() 36 37 38# This is not really a "script test" so does not need to manually add 39# any additional compile targets. 40def main_compile_targets(args): 41 json.dump([], args.output) 42 43 44if __name__ == '__main__': 45 # Conform minimally to the protocol defined by ScriptTest. 46 if 'compile_targets' in sys.argv: 47 funcs = { 48 'run': None, 49 'compile_targets': main_compile_targets, 50 } 51 sys.exit(common.run_script(sys.argv[1:], funcs)) 52 sys.exit(main()) 53