diff options
Diffstat (limited to 'test/default_run.py')
-rwxr-xr-x | test/default_run.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/default_run.py b/test/default_run.py index c30b651079..3f311a83e7 100755 --- a/test/default_run.py +++ b/test/default_run.py @@ -17,9 +17,10 @@ import sys, os, shutil, shlex, re, subprocess, glob from argparse import ArgumentParser, BooleanOptionalAction, Namespace from os import path from os.path import isfile, isdir, basename -from typing import List from subprocess import DEVNULL, PIPE, STDOUT from tempfile import NamedTemporaryFile +from testrunner import env +from typing import List COLOR = (os.environ.get("LUCI_CONTEXT") == None) # Disable colors on LUCI. COLOR_BLUE = '\033[94m' if COLOR else '' @@ -133,6 +134,17 @@ def parse_args(argv): return argp.parse_args(argv) +def get_target_arch(is64: bool) -> str: + # We may build for two arches. Get the one with the expected bitness. + arches = [a for a in [env.TARGET_ARCH, env.TARGET_2ND_ARCH] if a] + assert len(arches) > 0, "TARGET_ARCH/TARGET_2ND_ARCH not set" + if is64: + arches = [a for a in arches if a.endswith("64")] + assert len(arches) == 1, f"Can not find (unique) 64-bit arch in {arches}" + else: + arches = [a for a in arches if not a.endswith("64")] + assert len(arches) == 1, f"Can not find (unique) 32-bit arch in {arches}" + return arches[0] # Note: This must start with the CORE_IMG_JARS in Android.common_path.mk # because that's what we use for compiling the boot.art image. @@ -580,6 +592,8 @@ def default_run(ctx, args, **kwargs): f"{ANDROID_BUILD_TOP}/art/test/utils/get-device-isa {GET_DEVICE_ISA_BITNESS_FLAG}", adb.env, save_cmd=False).stdout.strip() + target_arch = get_target_arch(args.is64) # Should return the same ISA. + assert ISA == target_arch, f"{ISA} vs {target_arch}" if not USE_JVM: FLAGS += f" {ANDROID_FLAGS}" |