blob: 5d5e8404d9111f8ae30711380d0024d15b2c5955 [file] [log] [blame]
Liviu Rau3da5d4a2022-02-23 11:07:121#!/usr/bin/env vpython3
Tim van der Lippeefb2a942020-04-23 15:22:052#
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"""
7Run unit tests on a pinned version of chrome after automatically compiling the required files
8"""
9
10import argparse
11import subprocess
12import sys
Alex Rudenko71be9732023-02-02 09:25:2113import os
Tim van der Lippeefb2a942020-04-23 15:22:0514from os import path
15
16ROOT_DIRECTORY = path.join(path.dirname(path.abspath(__file__)), '..', '..')
17
18
19def recompile(ninja_build_name, ninja_target_name):
Alex Rudenko71be9732023-02-02 09:25:2120 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 Lippeefb2a942020-04-23 15:22:0525
26 ninja_proc.communicate()
27
28 if ninja_proc.returncode != 0:
29 sys.exit(ninja_proc.returncode)