Commit c3e1b5f8 authored by jochen's avatar jochen Committed by Commit bot

Add an option --gn to run-tests.py that just runs the latest gn build

R=machenbach@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2295703002
Cr-Commit-Position: refs/heads/master@{#39011}
parent df801161
......@@ -34,7 +34,7 @@ import json
import multiprocessing
import optparse
import os
from os.path import join
from os.path import getmtime, isdir, join
import platform
import random
import shlex
......@@ -55,6 +55,8 @@ from testrunner.objects import context
# Base dir of the v8 checkout to be used as cwd.
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEFAULT_OUT_GN = "out.gn"
ARCH_GUESS = utils.DefaultArch()
# Map of test name synonyms to lists of test suites. Should be ordered by
......@@ -294,6 +296,8 @@ def BuildOptions():
" \"%s\"" % ",".join(EXHAUSTIVE_VARIANTS))
result.add_option("--outdir", help="Base directory with compile output",
default="out")
result.add_option("--gn", help="Scan out.gn for the last built configuration",
default=False, action="store_true")
result.add_option("--predictable",
help="Compare output of several reruns of each test",
default=False, action="store_true")
......@@ -427,6 +431,20 @@ def ProcessOptions(options):
# First try to auto-detect configurations based on the build if GN was
# used. This can't be overridden by cmd-line arguments.
options.auto_detect = False
if options.gn:
gn_out_dir = os.path.join(BASE_DIR, DEFAULT_OUT_GN)
latest_timestamp = -1
latest_config = None
for gn_config in os.listdir(gn_out_dir):
gn_config_dir = os.path.join(gn_out_dir, gn_config)
if not isdir(gn_config_dir):
continue
if os.path.getmtime(gn_config_dir) > latest_timestamp:
latest_timestamp = os.path.getmtime(gn_config_dir)
latest_config = gn_config
if latest_config:
options.outdir = os.path.join(DEFAULT_OUT_GN, latest_config)
build_config_path = os.path.join(
BASE_DIR, options.outdir, "v8_build_config.json")
if os.path.exists(build_config_path):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment