Commit 82b8adb0 authored by Camillo's avatar Camillo Committed by V8 LUCI CQ

[tools][gm] Support aliases for modes

Now you can use 3-letter alias for all modes: rel, opt, dbg
Example: gm.py x64.opt.d8

No-Try: True
Change-Id: I825ebbf4cc1c509599f4fd2ac5aa0ac6fab998c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3723506Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81382}
parent 29e4a09a
......@@ -45,7 +45,14 @@ ARCHES = ["ia32", "x64", "arm", "arm64", "mipsel", "mips64el", "ppc", "ppc64",
# Arches that get built/run when you don't specify any.
DEFAULT_ARCHES = ["ia32", "x64", "arm", "arm64"]
# Modes that this script understands.
MODES = ["release", "debug", "optdebug"]
MODES = {
"release": "release",
"rel": "release",
"debug": "debug",
"dbg": "debug",
"optdebug": "optdebug",
"opt": "optdebug"
}
# Modes that get built/run when you don't specify any.
DEFAULT_MODES = ["release", "debug"]
# Build targets that can be manually specified.
......@@ -97,9 +104,11 @@ HELP = """<arch> can be any of: %(arches)s
- tests (build test binaries)
- check (build test binaries, run most tests)
- checkall (build all binaries, run more tests)
""" % {"arches": " ".join(ARCHES),
"modes": " ".join(MODES),
"targets": ", ".join(TARGETS)}
""" % {
"arches": " ".join(ARCHES),
"modes": " ".join(MODES.keys()),
"targets": ", ".join(TARGETS)
}
TESTSUITES_TARGETS = {"benchmarks": "d8",
"bigint": "bigint_shell",
......@@ -196,7 +205,7 @@ def PrintHelpAndExit():
def PrintCompletionsAndExit():
for a in ARCHES:
print("%s" % a)
for m in MODES:
for m in set(MODES.values()):
print("%s" % m)
print("%s.%s" % (a, m))
for t in TARGETS:
......@@ -468,13 +477,13 @@ class ArgumentParser(object):
if word in ARCHES:
arches.append(word)
elif word in MODES:
modes.append(word)
modes.append(MODES[word])
elif word in TARGETS:
targets.append(word)
elif word in ACTIONS:
actions.append(word)
elif any(map(lambda x: word.startswith(x + "-"), MODES)):
modes.append(word)
elif any(word.startswith(mode + "-") for mode in MODES.keys()):
modes.append(MODES[word])
else:
print("Didn't understand: %s" % word)
sys.exit(1)
......
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