Liviu Rau | 3da5d4a | 2022-02-23 11:07:12 | [diff] [blame] | 1 | #!/usr/bin/env vpython3 |
Tim van der Lippe | efb2a94 | 2020-04-23 15:22:05 | [diff] [blame] | 2 | # |
| 3 | # Copyright 2019 The Chromium Authors. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | """ |
| 7 | Run unit tests on a pinned version of chrome after automatically compiling the required files |
| 8 | """ |
| 9 | |
| 10 | import argparse |
| 11 | import subprocess |
| 12 | import sys |
Alex Rudenko | 71be973 | 2023-02-02 09:25:21 | [diff] [blame] | 13 | import os |
Tim van der Lippe | efb2a94 | 2020-04-23 15:22:05 | [diff] [blame] | 14 | from os import path |
| 15 | |
| 16 | ROOT_DIRECTORY = path.join(path.dirname(path.abspath(__file__)), '..', '..') |
| 17 | |
| 18 | |
| 19 | def recompile(ninja_build_name, ninja_target_name): |
Alex Rudenko | 71be973 | 2023-02-02 09:25:21 | [diff] [blame] | 20 | ninja_proc = subprocess.Popen([ |
| 21 | 'autoninja.bat' if os.name == 'nt' else 'autoninja', '-C', |
| 22 | 'out/{}'.format(ninja_build_name), ninja_target_name |
| 23 | ], |
| 24 | cwd=ROOT_DIRECTORY) |
Tim van der Lippe | efb2a94 | 2020-04-23 15:22:05 | [diff] [blame] | 25 | |
| 26 | ninja_proc.communicate() |
| 27 | |
| 28 | if ninja_proc.returncode != 0: |
| 29 | sys.exit(ninja_proc.returncode) |