()
| 11 | |
| 12 | |
| 13 | def main(): |
| 14 | parser = ArgumentParser() |
| 15 | parser.add_argument( |
| 16 | '-t', |
| 17 | '--blink-tools-path', |
| 18 | help=("Absolute path to where blink tools are located " |
| 19 | "(usually inside a local chromium checkout).")) |
| 20 | parser.add_argument( |
| 21 | '--config-path', |
| 22 | help="Absolute path to a project configuration json file.", |
| 23 | default=(Path(__file__).parent / 'v8configs.json')) |
| 24 | parser.add_argument( |
| 25 | '--phase', |
| 26 | help=("Phase of the import process to run. One of 'ALL', 'PREBUILD', " |
| 27 | "'POSTBUILD', 'UPLOAD'. ALL will run all phases; suitable for " |
| 28 | "local runs. PREBUILD and POSTBUILD are to be used when building " |
| 29 | "and running the tests is delegated to a proper builder. UPLOAD is " |
| 30 | "used for creating and uploading the CL for the import. UPLOAD is " |
| 31 | "deferred to the recipe on the import builder. This importer " |
| 32 | "script gets called twice on the builder, first with PREBUILD and " |
| 33 | "second with POSTBUILD. Build and UPLOAD phases are deferred to " |
| 34 | "the recipe on the builder."), |
| 35 | choices=['ALL', 'PREBUILD', 'POSTBUILD', 'UPLOAD'], |
| 36 | default='ALL') |
| 37 | parser.add_argument( |
| 38 | '--test262-failure-file', |
| 39 | help=('Absolute path to a file with names of the test to be skipped for ' |
| 40 | 'this import. Used only in PREBUILD phase.'), |
| 41 | default=None) |
| 42 | parser.add_argument( |
| 43 | '--v8-test262-last-revision', |
| 44 | help=('Used only in POSTBUILD when called separately. The old revision was' |
| 45 | ' overwritten at this point by the PREBUILD phase.'), |
| 46 | default=None) |
| 47 | args, exporter_args = parser.parse_known_args(sys.argv) |
| 48 | |
| 49 | sys.path.append(args.blink_tools_path) |
| 50 | from blinkpy.common import exit_codes |
| 51 | from blinkpy.common.host import Host |
| 52 | from blinkpy.common.path_finder import add_depot_tools_dir_to_os_path |
| 53 | |
| 54 | from v8configs import config_from_file |
| 55 | from v8_importer import V8TestImporter |
| 56 | |
| 57 | add_depot_tools_dir_to_os_path() |
| 58 | host = Host(project_config_factory=config_from_file(args.config_path)) |
| 59 | importer = V8TestImporter( |
| 60 | phase=args.phase, |
| 61 | host=host, |
| 62 | test262_failure_file=args.test262_failure_file, |
| 63 | v8_test262_last_rev=args.v8_test262_last_revision) |
| 64 | try: |
| 65 | success = importer.main(exporter_args[1:]) |
| 66 | host.exit(0 if success else 1) |
| 67 | except KeyboardInterrupt: |
| 68 | host.print_('Interrupted, exiting') |
| 69 | host.exit(exit_codes.INTERRUPTED_EXIT_STATUS) |
| 70 |
no test coverage detected
searching dependent graphs…