Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 1 | # Copyright (C) 2011 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 | |
| 16 | LOCAL_PATH := $(call my-dir) |
Shubham Ajmera | 6f3d590 | 2017-02-06 06:39:11 +0000 | [diff] [blame] | 17 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 18 | include art/build/Android.common_test.mk |
| 19 | |
Nicolas Geoffray | 07f2bc1 | 2015-05-29 13:40:25 +0100 | [diff] [blame] | 20 | # Dependencies for actually running a run-test. |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 21 | TEST_ART_RUN_TEST_DEPENDENCIES := \ |
| 22 | $(DX) \ |
| 23 | $(HOST_OUT_EXECUTABLES)/jasmin \ |
| 24 | $(HOST_OUT_EXECUTABLES)/smali \ |
Sebastien Hertz | 2b763c3 | 2016-03-31 09:22:50 +0200 | [diff] [blame] | 25 | $(HOST_OUT_EXECUTABLES)/dexmerger \ |
| 26 | $(JACK) |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 27 | |
Shubham Ajmera | 6f3d590 | 2017-02-06 06:39:11 +0000 | [diff] [blame] | 28 | # Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 29 | define name-to-var |
| 30 | $(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_') |
| 31 | endef # name-to-var |
| 32 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 33 | # We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync |
| 34 | # only once). |
| 35 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 36 | |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 37 | # Also need libartagent. |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 38 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libartagent) |
| 39 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libartagentd) |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 40 | ifdef TARGET_2ND_ARCH |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 41 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libartagent) |
| 42 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libartagentd) |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 43 | endif |
| 44 | |
Alex Light | 49948e9 | 2016-08-11 15:35:28 -0700 | [diff] [blame] | 45 | # Also need libtiagent. |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 46 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtiagent) |
| 47 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtiagentd) |
Alex Light | 49948e9 | 2016-08-11 15:35:28 -0700 | [diff] [blame] | 48 | ifdef TARGET_2ND_ARCH |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 49 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtiagent) |
| 50 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtiagentd) |
Alex Light | 49948e9 | 2016-08-11 15:35:28 -0700 | [diff] [blame] | 51 | endif |
| 52 | |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 53 | # Also need libtistress. |
| 54 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtistress) |
| 55 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtistressd) |
| 56 | ifdef TARGET_2ND_ARCH |
| 57 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtistress) |
| 58 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtistressd) |
| 59 | endif |
| 60 | |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 61 | # Also need libarttest. |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 62 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libarttest) |
| 63 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libarttestd) |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 64 | ifdef TARGET_2ND_ARCH |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 65 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libarttest) |
| 66 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libarttestd) |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 67 | endif |
| 68 | |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 69 | # Also need libnativebridgetest. |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 70 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libnativebridgetest) |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 71 | ifdef TARGET_2ND_ARCH |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 72 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libnativebridgetest) |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 73 | endif |
| 74 | |
Nicolas Geoffray | d026ee5 | 2016-11-23 10:47:02 +0000 | [diff] [blame] | 75 | # Also need libopenjdkjvmti. |
Nicolas Geoffray | ae02d2e | 2016-11-23 16:25:15 +0000 | [diff] [blame] | 76 | TEST_ART_TARGET_SYNC_DEPS += libopenjdkjvmti |
| 77 | TEST_ART_TARGET_SYNC_DEPS += libopenjdkjvmtid |
Nicolas Geoffray | d026ee5 | 2016-11-23 10:47:02 +0000 | [diff] [blame] | 78 | |
Nicolas Geoffray | 320ccca | 2017-03-01 10:03:08 +0000 | [diff] [blame] | 79 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar |
| 80 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar |
| 81 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/okhttp-testdex.jar |
| 82 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/bouncycastle-testdex.jar |
| 83 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/conscrypt-testdex.jar |
| 84 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 85 | # All tests require the host executables. The tests also depend on the core images, but on |
| 86 | # specific version depending on the compiler. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 87 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \ |
| 88 | $(ART_HOST_EXECUTABLES) \ |
Nicolas Geoffray | a6fbe39 | 2017-03-25 14:05:28 +0000 | [diff] [blame] | 89 | $(HOST_OUT_EXECUTABLES)/hprof-conv \ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 90 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagent) \ |
| 91 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagentd) \ |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 92 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistress) \ |
| 93 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistressd) \ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 94 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagent) \ |
| 95 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagentd) \ |
| 96 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttest) \ |
| 97 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttestd) \ |
| 98 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetest) \ |
Narayan Kamath | 67ef2c9 | 2015-11-16 10:17:35 +0000 | [diff] [blame] | 99 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 10edbb1 | 2016-01-06 17:59:49 -0800 | [diff] [blame] | 100 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | f2c5dbd | 2016-11-17 22:50:33 -0800 | [diff] [blame] | 101 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \ |
| 102 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \ |
| 103 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \ |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 104 | |
| 105 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 106 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \ |
Andreas Gampe | 0ccd1e2 | 2017-04-12 21:53:55 -0700 | [diff] [blame] | 107 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagent) \ |
| 108 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagentd) \ |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 109 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistress) \ |
| 110 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistressd) \ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 111 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagent) \ |
| 112 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagentd) \ |
| 113 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttest) \ |
| 114 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttestd) \ |
| 115 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetest) \ |
Narayan Kamath | 67ef2c9 | 2015-11-16 10:17:35 +0000 | [diff] [blame] | 116 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 10edbb1 | 2016-01-06 17:59:49 -0800 | [diff] [blame] | 117 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | f2c5dbd | 2016-11-17 22:50:33 -0800 | [diff] [blame] | 118 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \ |
| 119 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \ |
| 120 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \ |
| 121 | |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 122 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 123 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 124 | # Host executables. |
| 125 | host_prereq_rules := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) |
| 126 | |
Colin Cross | b6f707c | 2017-04-10 19:04:59 -0700 | [diff] [blame] | 127 | ifeq ($(ANDROID_COMPILE_WITH_JACK),true) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 128 | # Classpath for Jack compilation for host. |
| 129 | host_prereq_rules += $(HOST_JACK_CLASSPATH_DEPENDENCIES) |
Colin Cross | b6f707c | 2017-04-10 19:04:59 -0700 | [diff] [blame] | 130 | endif |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 131 | |
| 132 | # Required for dx, jasmin, smali, dexmerger, jack. |
| 133 | host_prereq_rules += $(TEST_ART_RUN_TEST_DEPENDENCIES) |
| 134 | |
Colin Cross | b6f707c | 2017-04-10 19:04:59 -0700 | [diff] [blame] | 135 | ifeq ($(ANDROID_COMPILE_WITH_JACK),true) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 136 | # Classpath for Jack compilation for target. |
| 137 | target_prereq_rules := $(TARGET_JACK_CLASSPATH_DEPENDENCIES) |
Colin Cross | b6f707c | 2017-04-10 19:04:59 -0700 | [diff] [blame] | 138 | endif |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 139 | |
| 140 | # Sync test files to the target, depends upon all things that must be pushed |
| 141 | #to the target. |
| 142 | target_prereq_rules += test-art-target-sync |
| 143 | |
| 144 | define core-image-dependencies |
| 145 | image_suffix := $(3) |
| 146 | ifeq ($(3),regalloc_gc) |
| 147 | image_suffix:=optimizing |
| 148 | else |
| 149 | ifeq ($(3),jit) |
| 150 | image_suffix:=interpreter |
| 151 | endif |
| 152 | endif |
| 153 | ifeq ($(2),no-image) |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 154 | $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_$(4)) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 155 | else |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 156 | ifeq ($(2),picimage) |
| 157 | $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_$(4)) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 158 | else |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 159 | ifeq ($(2),multipicimage) |
| 160 | $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_multi_$(4)) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 161 | endif |
| 162 | endif |
| 163 | endif |
| 164 | endef |
| 165 | |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 166 | TARGET_TYPES := host target |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 167 | COMPILER_TYPES := jit interpreter optimizing regalloc_gc jit interp-ac speed-profile |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 168 | IMAGE_TYPES := picimage no-image multipicimage |
| 169 | ALL_ADDRESS_SIZES := 64 32 |
Shubham Ajmera | 07a8c70 | 2017-02-16 19:50:12 +0000 | [diff] [blame] | 170 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 171 | # Add core image dependencies required for given target - HOST or TARGET, |
| 172 | # IMAGE_TYPE, COMPILER_TYPE and ADDRESS_SIZE to the prereq_rules. |
| 173 | $(foreach target, $(TARGET_TYPES), \ |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 174 | $(foreach image, $(IMAGE_TYPES), \ |
| 175 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 176 | $(foreach address_size, $(ALL_ADDRESS_SIZES), $(eval \ |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 177 | $(call core-image-dependencies,$(target),$(image),$(compiler),$(address_size))))))) |
| 178 | |
| 179 | test-art-host-run-test-dependencies : $(host_prereq_rules) |
| 180 | test-art-target-run-test-dependencies : $(target_prereq_rules) |
| 181 | test-art-run-test-dependencies : test-art-host-run-test-dependencies test-art-target-run-test-dependencies |
| 182 | |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 183 | # Create a rule to build and run a test group of the following form: |
| 184 | # test-art-{1: host target}-run-test |
| 185 | define define-test-art-host-or-target-run-test-group |
| 186 | build_target := test-art-$(1)-run-test |
| 187 | .PHONY: $$(build_target) |
| 188 | |
| 189 | $$(build_target) : args := --$(1) --verbose |
| 190 | $$(build_target) : test-art-$(1)-run-test-dependencies |
| 191 | ./art/test/testrunner/testrunner.py $$(args) |
| 192 | build_target := |
| 193 | args := |
| 194 | endef # define-test-art-host-or-target-run-test-group |
| 195 | |
| 196 | $(foreach target, $(TARGET_TYPES), $(eval \ |
| 197 | $(call define-test-art-host-or-target-run-test-group,$(target)))) |
| 198 | |
| 199 | test-art-run-test : test-art-host-run-test test-art-target-run-test |
| 200 | |
| 201 | host_prereq_rules := |
| 202 | target_prereq_rules := |
| 203 | core-image-dependencies := |
| 204 | name-to-var := |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 205 | define-test-art-host-or-target-run-test-group := |
| 206 | TARGET_TYPES := |
| 207 | COMPILER_TYPES := |
| 208 | IMAGE_TYPES := |
| 209 | ALL_ADDRESS_SIZES := |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 210 | LOCAL_PATH := |