• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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"""Runs an isolate bundled Telemetry GPU integration test.
6
7If optional argument --isolated-script-test-output=[FILENAME] is passed
8to the script, json is written to that file in the format detailed in
9//docs/testing/json-test-results-format.md.
10
11If optional argument --isolated-script-test-filter=[TEST_NAMES] is passed to
12the script, it should be a  double-colon-separated ("::") list of test names,
13to run just that subset of tests.
14
15This script is intended to be the base command invoked by the isolate,
16followed by a subsequent Python script. It could be generalized to
17invoke an arbitrary executable.
18"""
19
20import json
21import sys
22
23import common
24import gpu_integration_test_adapter
25
26
27def main():
28  adapter = gpu_integration_test_adapter.GpuIntegrationTestAdapater()
29  return adapter.run_test()
30
31
32# This is not really a "script test" so does not need to manually add
33# any additional compile targets.
34def main_compile_targets(args):
35  json.dump([], args.output)
36
37
38if __name__ == '__main__':
39  # Conform minimally to the protocol defined by ScriptTest.
40  if 'compile_targets' in sys.argv:
41    funcs = {
42        'run': None,
43        'compile_targets': main_compile_targets,
44    }
45    sys.exit(common.run_script(sys.argv[1:], funcs))
46  sys.exit(main())
47