Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 1 | # Copyright 2017, The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | import os |
Igor Murashkin | fecb4ef | 2017-02-09 10:42:23 -0800 | [diff] [blame] | 16 | import re |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 17 | import tempfile |
| 18 | import subprocess |
| 19 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 20 | _env = dict(os.environ) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 21 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 22 | def _getEnvBoolean(var, default): |
| 23 | val = _env.get(var) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 24 | if val: |
| 25 | if val == "True" or val == "true": |
| 26 | return True |
| 27 | if val == "False" or val == "false": |
| 28 | return False |
| 29 | return default |
| 30 | |
Igor Murashkin | fecb4ef | 2017-02-09 10:42:23 -0800 | [diff] [blame] | 31 | _DUMP_MANY_VARS_LIST = ['HOST_2ND_ARCH_PREFIX', |
| 32 | 'TARGET_2ND_ARCH', |
| 33 | 'TARGET_ARCH', |
| 34 | 'HOST_PREFER_32_BIT', |
Shubham Ajmera | c33c087 | 2017-07-20 18:41:52 -0700 | [diff] [blame] | 35 | 'HOST_OUT_EXECUTABLES', |
Colin Cross | e0ef0a8 | 2017-07-27 21:29:18 +0000 | [diff] [blame^] | 36 | 'ANDROID_JAVA_TOOLCHAIN', |
| 37 | 'ANDROID_COMPILE_WITH_JACK'] |
Igor Murashkin | fecb4ef | 2017-02-09 10:42:23 -0800 | [diff] [blame] | 38 | _DUMP_MANY_VARS = None # To be set to a dictionary with above list being the keys, |
| 39 | # and the build variable being the value. |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 40 | def _dump_many_vars(var_name): |
Igor Murashkin | fecb4ef | 2017-02-09 10:42:23 -0800 | [diff] [blame] | 41 | """ |
| 42 | Reach into the Android build system to dump many build vars simultaneously. |
| 43 | Since the make system is so slow, we want to avoid calling into build frequently. |
| 44 | """ |
| 45 | global _DUMP_MANY_VARS |
| 46 | global _DUMP_MANY_VARS_LIST |
| 47 | |
| 48 | # Look up var from cache. |
| 49 | if _DUMP_MANY_VARS: |
| 50 | return _DUMP_MANY_VARS[var_name] |
| 51 | |
| 52 | all_vars=" ".join(_DUMP_MANY_VARS_LIST) |
| 53 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 54 | # The command is taken from build/envsetup.sh to fetch build variables. |
Igor Murashkin | fecb4ef | 2017-02-09 10:42:23 -0800 | [diff] [blame] | 55 | command = ("CALLED_FROM_SETUP=true " # Enable the 'dump-many-vars' make target. |
| 56 | "BUILD_SYSTEM=build/core " # Set up lookup path for make includes. |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 57 | "make --no-print-directory -C \"%s\" -f build/core/config.mk " |
Igor Murashkin | fecb4ef | 2017-02-09 10:42:23 -0800 | [diff] [blame] | 58 | "dump-many-vars DUMP_MANY_VARS=\"%s\"") % (ANDROID_BUILD_TOP, all_vars) |
| 59 | |
Shubham Ajmera | fe79349 | 2017-03-16 13:31:35 -0700 | [diff] [blame] | 60 | config = subprocess.Popen(command, |
| 61 | stdout=subprocess.PIPE, |
| 62 | universal_newlines=True, |
Igor Murashkin | fecb4ef | 2017-02-09 10:42:23 -0800 | [diff] [blame] | 63 | shell=True).communicate()[0] # read until EOF, select stdin |
| 64 | # Prints out something like: |
| 65 | # TARGET_ARCH='arm64' |
| 66 | # HOST_ARCH='x86_64' |
| 67 | _DUMP_MANY_VARS = {} |
| 68 | for line in config.split("\n"): |
| 69 | # Split out "$key='$value'" via regex. |
| 70 | match = re.search("([^=]+)='([^']*)", line) |
| 71 | if not match: |
| 72 | continue |
| 73 | key = match.group(1) |
| 74 | value = match.group(2) |
| 75 | _DUMP_MANY_VARS[key] = value |
| 76 | |
| 77 | return _DUMP_MANY_VARS[var_name] |
| 78 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 79 | def _get_build_var(var_name): |
| 80 | return _dump_many_vars(var_name) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 81 | |
Colin Cross | e0ef0a8 | 2017-07-27 21:29:18 +0000 | [diff] [blame^] | 82 | def _get_build_var_boolean(var, default): |
| 83 | val = _get_build_var(var) |
| 84 | if val: |
| 85 | if val == "True" or val == "true": |
| 86 | return True |
| 87 | if val == "False" or val == "false": |
| 88 | return False |
| 89 | return default |
| 90 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 91 | def get_env(key): |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 92 | return _env.get(key) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 93 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 94 | def _get_android_build_top(): |
| 95 | path_to_top = _env.get('ANDROID_BUILD_TOP') |
| 96 | if not path_to_top: |
| 97 | # nothing set. try to guess it based on the relative path of this env.py file. |
| 98 | this_file_path = os.path.realpath(__file__) |
| 99 | path_to_top = os.path.join(os.path.dirname(this_file_path), '../../../') |
| 100 | path_to_top = os.path.realpath(path_to_top) |
| 101 | |
| 102 | if not os.path.exists(os.path.join(path_to_top, 'build/envsetup.sh')): |
| 103 | raise AssertionError("env.py must be located inside an android source tree") |
| 104 | |
| 105 | return path_to_top |
| 106 | |
| 107 | ANDROID_BUILD_TOP = _get_android_build_top() |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 108 | |
Igor Murashkin | 8889a89 | 2017-04-24 16:09:15 -0700 | [diff] [blame] | 109 | # Compiling with jack? Possible values in (True, False, 'default') |
Colin Cross | e0ef0a8 | 2017-07-27 21:29:18 +0000 | [diff] [blame^] | 110 | ANDROID_COMPILE_WITH_JACK = _get_build_var_boolean('ANDROID_COMPILE_WITH_JACK', 'default') |
Igor Murashkin | 8889a89 | 2017-04-24 16:09:15 -0700 | [diff] [blame] | 111 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 112 | # Directory used for temporary test files on the host. |
| 113 | ART_HOST_TEST_DIR = tempfile.mkdtemp(prefix = 'test-art-') |
| 114 | |
| 115 | # Keep going after encountering a test failure? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 116 | ART_TEST_KEEP_GOING = _getEnvBoolean('ART_TEST_KEEP_GOING', True) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 117 | |
| 118 | # Do you want all tests, even those that are time consuming? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 119 | ART_TEST_FULL = _getEnvBoolean('ART_TEST_FULL', False) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 120 | |
| 121 | # Do you want interpreter tests run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 122 | ART_TEST_INTERPRETER = _getEnvBoolean('ART_TEST_INTERPRETER', ART_TEST_FULL) |
| 123 | ART_TEST_INTERPRETER_ACCESS_CHECKS = _getEnvBoolean('ART_TEST_INTERPRETER_ACCESS_CHECKS', |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 124 | ART_TEST_FULL) |
| 125 | |
| 126 | # Do you want JIT tests run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 127 | ART_TEST_JIT = _getEnvBoolean('ART_TEST_JIT', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 128 | |
| 129 | # Do you want optimizing compiler tests run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 130 | ART_TEST_OPTIMIZING = _getEnvBoolean('ART_TEST_OPTIMIZING', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 131 | |
| 132 | # Do you want to test the optimizing compiler with graph coloring register allocation? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 133 | ART_TEST_OPTIMIZING_GRAPH_COLOR = _getEnvBoolean('ART_TEST_OPTIMIZING_GRAPH_COLOR', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 134 | |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 135 | # Do you want to do run-tests with profiles? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 136 | ART_TEST_SPEED_PROFILE = _getEnvBoolean('ART_TEST_SPEED_PROFILE', ART_TEST_FULL) |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 137 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 138 | # Do we want to test PIC-compiled tests ("apps")? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 139 | ART_TEST_PIC_TEST = _getEnvBoolean('ART_TEST_PIC_TEST', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 140 | # Do you want tracing tests run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 141 | ART_TEST_TRACE = _getEnvBoolean('ART_TEST_TRACE', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 142 | |
| 143 | # Do you want tracing tests (streaming mode) run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 144 | ART_TEST_TRACE_STREAM = _getEnvBoolean('ART_TEST_TRACE_STREAM', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 145 | |
| 146 | # Do you want tests with GC verification enabled run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 147 | ART_TEST_GC_VERIFY = _getEnvBoolean('ART_TEST_GC_VERIFY', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 148 | |
| 149 | # Do you want tests with the GC stress mode enabled run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 150 | ART_TEST_GC_STRESS = _getEnvBoolean('ART_TEST_GC_STRESS', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 151 | |
| 152 | # Do you want tests with the JNI forcecopy mode enabled run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 153 | ART_TEST_JNI_FORCECOPY = _getEnvBoolean('ART_TEST_JNI_FORCECOPY', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 154 | |
| 155 | # Do you want run-tests with relocation disabled run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 156 | ART_TEST_RUN_TEST_RELOCATE = _getEnvBoolean('ART_TEST_RUN_TEST_RELOCATE', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 157 | |
| 158 | # Do you want run-tests with prebuilding? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 159 | ART_TEST_RUN_TEST_PREBUILD = _getEnvBoolean('ART_TEST_RUN_TEST_PREBUILD', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 160 | |
| 161 | # Do you want run-tests with no prebuilding enabled run? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 162 | ART_TEST_RUN_TEST_NO_PREBUILD = _getEnvBoolean('ART_TEST_RUN_TEST_NO_PREBUILD', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 163 | |
| 164 | # Do you want run-tests with a pregenerated core.art? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 165 | ART_TEST_RUN_TEST_IMAGE = _getEnvBoolean('ART_TEST_RUN_TEST_IMAGE', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 166 | |
| 167 | # Do you want run-tests without a pregenerated core.art? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 168 | ART_TEST_RUN_TEST_NO_IMAGE = _getEnvBoolean('ART_TEST_RUN_TEST_NO_IMAGE', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 169 | |
| 170 | # Do you want run-tests with relocation enabled but patchoat failing? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 171 | ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT = _getEnvBoolean('ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT', |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 172 | ART_TEST_FULL) |
| 173 | |
| 174 | # Do you want run-tests without a dex2oat? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 175 | ART_TEST_RUN_TEST_NO_DEX2OAT = _getEnvBoolean('ART_TEST_RUN_TEST_NO_DEX2OAT', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 176 | |
| 177 | # Do you want run-tests with libartd.so? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 178 | ART_TEST_RUN_TEST_DEBUG = _getEnvBoolean('ART_TEST_RUN_TEST_DEBUG', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 179 | |
| 180 | # Do you want run-tests with libart.so? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 181 | ART_TEST_RUN_TEST_NDEBUG = _getEnvBoolean('ART_TEST_RUN_TEST_NDEBUG', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 182 | |
| 183 | # Do you want failed tests to have their artifacts cleaned up? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 184 | ART_TEST_RUN_TEST_ALWAYS_CLEAN = _getEnvBoolean('ART_TEST_RUN_TEST_ALWAYS_CLEAN', True) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 185 | |
| 186 | # Do you want run-tests with the --debuggable flag |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 187 | ART_TEST_RUN_TEST_DEBUGGABLE = _getEnvBoolean('ART_TEST_RUN_TEST_DEBUGGABLE', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 188 | |
| 189 | # Do you want to test multi-part boot-image functionality? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 190 | ART_TEST_RUN_TEST_MULTI_IMAGE = _getEnvBoolean('ART_TEST_RUN_TEST_MULTI_IMAGE', ART_TEST_FULL) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 191 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 192 | ART_TEST_DEBUG_GC = _getEnvBoolean('ART_TEST_DEBUG_GC', False) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 193 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 194 | ART_TEST_BISECTION = _getEnvBoolean('ART_TEST_BISECTION', False) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 195 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 196 | DEX2OAT_HOST_INSTRUCTION_SET_FEATURES = _env.get('DEX2OAT_HOST_INSTRUCTION_SET_FEATURES') |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 197 | |
| 198 | # Do you want run-tests with the host/target's second arch? |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 199 | ART_TEST_RUN_TEST_2ND_ARCH = _getEnvBoolean('ART_TEST_RUN_TEST_2ND_ARCH', True) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 200 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 201 | HOST_2ND_ARCH_PREFIX = _get_build_var('HOST_2ND_ARCH_PREFIX') |
| 202 | HOST_2ND_ARCH_PREFIX_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES = _env.get( |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 203 | HOST_2ND_ARCH_PREFIX + 'DEX2OAT_HOST_INSTRUCTION_SET_FEATURES') |
| 204 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 205 | ART_TEST_ANDROID_ROOT = _env.get('ART_TEST_ANDROID_ROOT') |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 206 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 207 | ART_TEST_WITH_STRACE = _getEnvBoolean('ART_TEST_DEBUG_GC', False) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 208 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 209 | EXTRA_DISABLED_TESTS = set(_env.get("ART_TEST_RUN_TEST_SKIP", "").split()) |
Alex Light | bc319b2 | 2017-02-17 14:21:33 -0800 | [diff] [blame] | 210 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 211 | ART_TEST_RUN_TEST_BUILD = _getEnvBoolean('ART_TEST_RUN_TEST_BUILD', False) |
Alex Light | 9b6b13e | 2017-02-22 11:46:50 -0800 | [diff] [blame] | 212 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 213 | TARGET_2ND_ARCH = _get_build_var('TARGET_2ND_ARCH') |
| 214 | TARGET_ARCH = _get_build_var('TARGET_ARCH') |
| 215 | |
| 216 | # Note: ART_2ND_PHONY_TEST_TARGET_SUFFIX is 2ND_ART_PHONY_TEST_TARGET_SUFFIX in .mk files |
| 217 | # Note: ART_2ND_PHONY_TEST_HOST_SUFFIX is 2ND_ART_PHONY_HOST_TARGET_SUFFIX in .mk files |
| 218 | # Python does not let us have variable names starting with a digit, so it has differ. |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 219 | |
| 220 | ART_TEST_RUN_TEST_JVMTI_STRESS = _getEnvBoolean('ART_TEST_RUN_TEST_JVMTI_STRESS', ART_TEST_FULL) |
| 221 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 222 | if TARGET_2ND_ARCH: |
| 223 | if "64" in TARGET_ARCH: |
| 224 | ART_PHONY_TEST_TARGET_SUFFIX = "64" |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 225 | ART_2ND_PHONY_TEST_TARGET_SUFFIX = "32" |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 226 | else: |
| 227 | ART_PHONY_TEST_TARGET_SUFFIX = "32" |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 228 | ART_2ND_PHONY_TEST_TARGET_SUFFIX = "" |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 229 | else: |
| 230 | if "64" in TARGET_ARCH: |
| 231 | ART_PHONY_TEST_TARGET_SUFFIX = "64" |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 232 | ART_2ND_PHONY_TEST_TARGET_SUFFIX = "" |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 233 | else: |
| 234 | ART_PHONY_TEST_TARGET_SUFFIX = "32" |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 235 | ART_2ND_PHONY_TEST_TARGET_SUFFIX = "" |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 236 | |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 237 | HOST_PREFER_32_BIT = _get_build_var('HOST_PREFER_32_BIT') |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 238 | if HOST_PREFER_32_BIT == "true": |
| 239 | ART_PHONY_TEST_HOST_SUFFIX = "32" |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 240 | ART_2ND_PHONY_TEST_HOST_SUFFIX = "" |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 241 | else: |
| 242 | ART_PHONY_TEST_HOST_SUFFIX = "64" |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 243 | ART_2ND_PHONY_TEST_HOST_SUFFIX = "32" |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 244 | |
Alex Light | 699c255 | 2017-02-08 10:09:31 -0800 | [diff] [blame] | 245 | HOST_OUT_EXECUTABLES = os.path.join(ANDROID_BUILD_TOP, |
Igor Murashkin | 6b61c80 | 2017-04-03 14:33:22 -0700 | [diff] [blame] | 246 | _get_build_var("HOST_OUT_EXECUTABLES")) |
Igor Murashkin | 7dc46cf | 2017-07-19 13:48:31 -0700 | [diff] [blame] | 247 | |
| 248 | # Set up default values for $JACK, $DX, $SMALI, etc to the $HOST_OUT_EXECUTABLES/$name path. |
| 249 | for tool in ['jack', 'dx', 'smali', 'jasmin', 'dxmerger']: |
| 250 | binary = tool if tool != 'dxmerger' else 'dexmerger' |
| 251 | os.environ.setdefault(tool.upper(), HOST_OUT_EXECUTABLES + '/' + binary) |
Shubham Ajmera | c33c087 | 2017-07-20 18:41:52 -0700 | [diff] [blame] | 252 | |
| 253 | ANDROID_JAVA_TOOLCHAIN = os.path.join(ANDROID_BUILD_TOP, |
| 254 | _get_build_var('ANDROID_JAVA_TOOLCHAIN')) |
| 255 | |
| 256 | # include platform prebuilt java, javac, etc in $PATH. |
| 257 | os.environ['PATH'] = ANDROID_JAVA_TOOLCHAIN + ':' + os.environ['PATH'] |