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) |
| 17 | |
| 18 | include art/build/Android.common_test.mk |
| 19 | |
| 20 | # List of all tests of the form 003-omnibus-opcodes. |
| 21 | TEST_ART_RUN_TESTS := $(wildcard $(LOCAL_PATH)/[0-9]*) |
| 22 | TEST_ART_RUN_TESTS := $(subst $(LOCAL_PATH)/,, $(TEST_ART_RUN_TESTS)) |
| 23 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 24 | ######################################################################## |
| 25 | # The art-run-tests module, used to build all run-tests into an image. |
Alex Light | 9dcc457 | 2014-08-14 14:16:26 -0700 | [diff] [blame] | 26 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 27 | # The path where build only targets will be output, e.g. |
| 28 | # out/target/product/generic_x86_64/obj/PACKAGING/art-run-tests_intermediates/DATA |
| 29 | art_run_tests_dir := $(call intermediates-dir-for,PACKAGING,art-run-tests)/DATA |
| 30 | |
| 31 | # A generated list of prerequisites that call 'run-test --build-only', the actual prerequisite is |
| 32 | # an empty file touched in the intermediate directory. |
| 33 | TEST_ART_RUN_TEST_BUILD_RULES := |
| 34 | |
| 35 | # Helper to create individual build targets for tests. Must be called with $(eval). |
| 36 | # $(1): the test number |
| 37 | define define-build-art-run-test |
| 38 | dmart_target := $(art_run_tests_dir)/art-run-tests/$(1)/touch |
Andreas Gampe | 8fda9f2 | 2014-10-03 16:15:37 -0700 | [diff] [blame] | 39 | $$(dmart_target): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $(HOST_OUT_EXECUTABLES)/smali $(HOST_OUT_EXECUTABLES)/dexmerger |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 40 | $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@) |
| 41 | $(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \ |
Andreas Gampe | 8fda9f2 | 2014-10-03 16:15:37 -0700 | [diff] [blame] | 42 | SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \ |
| 43 | DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 44 | $(LOCAL_PATH)/run-test --build-only --output-path $$(abspath $$(dir $$@)) $(1) |
| 45 | $(hide) touch $$@ |
| 46 | |
| 47 | TEST_ART_RUN_TEST_BUILD_RULES += $$(dmart_target) |
| 48 | dmart_target := |
| 49 | endef |
Ian Rogers | bf66bce | 2014-06-24 23:15:34 -0700 | [diff] [blame] | 50 | $(foreach test, $(TEST_ART_RUN_TESTS), $(eval $(call define-build-art-run-test,$(test)))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 51 | |
| 52 | include $(CLEAR_VARS) |
| 53 | LOCAL_MODULE_TAGS := tests |
| 54 | LOCAL_MODULE := art-run-tests |
Andreas Gampe | 8fda9f2 | 2014-10-03 16:15:37 -0700 | [diff] [blame] | 55 | LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES) smali dexmerger |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 56 | # The build system use this flag to pick up files generated by declare-make-art-run-test. |
| 57 | LOCAL_PICKUP_FILES := $(art_run_tests_dir) |
| 58 | |
| 59 | include $(BUILD_PHONY_PACKAGE) |
| 60 | |
| 61 | # Clear temp vars. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 62 | art_run_tests_dir := |
| 63 | define-build-art-run-test := |
Ian Rogers | 8a14b75 | 2014-07-18 15:06:53 -0700 | [diff] [blame] | 64 | TEST_ART_RUN_TEST_BUILD_RULES := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 65 | |
| 66 | ######################################################################## |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 67 | # General rules to build and run a run-test. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 68 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 69 | # Test rule names or of the form: |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 70 | # test-art-{1: host or target}-run-test-{2: prebuild no-prebuild no-dex2oat}- |
| 71 | # {3: interpreter default optimizing}-{4: relocate no-relocate relocate-no-patchoat}- |
| 72 | # {5: trace or no-trace}-{6: gcstress gcverify cms}-{7: forcecopy checkjni jni}- |
| 73 | # {8: no-image or image}-{9: test name}{10: 32 or 64} |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 74 | TARGET_TYPES := host target |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 75 | PREBUILD_TYPES := prebuild |
| 76 | ifeq ($(ART_TEST_RUN_TEST_NO_PREBUILD),true) |
| 77 | PREBUILD_TYPES += no-prebuild |
| 78 | endif |
| 79 | ifeq ($(ART_TEST_RUN_TEST_NO_DEX2OAT),true) |
| 80 | PREBUILD_TYPES += no-dex2oat |
| 81 | endif |
| 82 | COMPILER_TYPES := |
| 83 | ifeq ($(ART_TEST_DEFAULT_COMPILER),true) |
| 84 | COMPILER_TYPES += default |
| 85 | endif |
| 86 | ifeq ($(ART_TEST_INTERPRETER),true) |
| 87 | COMPILER_TYPES += interpreter |
| 88 | endif |
| 89 | ifeq ($(ART_TEST_OPTIMIZING),true) |
| 90 | COMPILER_TYPES += optimizing |
| 91 | endif |
| 92 | RELOCATE_TYPES := relocate |
| 93 | ifeq ($(ART_TEST_RUN_TEST_NO_RELOCATE),true) |
| 94 | RELOCATE_TYPES += no-relocate |
| 95 | endif |
| 96 | ifeq ($(ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT),true) |
| 97 | RELOCATE_TYPES := relocate-no-patchoat |
| 98 | endif |
| 99 | TRACE_TYPES := no-trace |
| 100 | ifeq ($(ART_TEST_TRACE),true) |
| 101 | TRACE_TYPES += trace |
| 102 | endif |
| 103 | GC_TYPES := cms |
Alex Light | 992f1e7 | 2014-08-27 16:08:57 -0700 | [diff] [blame] | 104 | ifeq ($(ART_TEST_GC_STRESS),true) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 105 | GC_TYPES += gcstress |
| 106 | endif |
Alex Light | 992f1e7 | 2014-08-27 16:08:57 -0700 | [diff] [blame] | 107 | ifeq ($(ART_TEST_GC_VERIFY),true) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 108 | GC_TYPES += gcverify |
| 109 | endif |
| 110 | JNI_TYPES := checkjni |
| 111 | ifeq ($(ART_TEST_JNI_FORCECOPY),true) |
| 112 | JNI_TYPES += forcecopy |
| 113 | endif |
| 114 | IMAGE_TYPES := image |
| 115 | ifeq ($(ART_TEST_RUN_TEST_NO_IMAGE),true) |
| 116 | IMAGE_TYPES += no-image |
| 117 | endif |
| 118 | ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX) $(2ND_ART_PHONY_TEST_TARGET_SUFFIX) |
| 119 | ADDRESS_SIZES_HOST := $(ART_PHONY_TEST_HOST_SUFFIX) $(2ND_ART_PHONY_TEST_HOST_SUFFIX) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 120 | ALL_ADDRESS_SIZES := 64 32 |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 121 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 122 | # List all run test names with number arguments agreeing with the comment above. |
| 123 | define all-run-test-names |
| 124 | $(foreach target, $(1), \ |
| 125 | $(foreach prebuild, $(2), \ |
| 126 | $(foreach compiler, $(3), \ |
| 127 | $(foreach relocate, $(4), \ |
| 128 | $(foreach trace, $(5), \ |
| 129 | $(foreach gc, $(6), \ |
| 130 | $(foreach jni, $(7), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 131 | $(foreach image, $(8), \ |
| 132 | $(foreach test, $(9), \ |
| 133 | $(foreach address_size, $(10), \ |
| 134 | test-art-$(target)-run-test-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(image)-$(test)$(address_size) \ |
| 135 | )))))))))) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 136 | endef # all-run-test-names |
| 137 | |
| 138 | # To generate a full list or tests: |
| 139 | # $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \ |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 140 | # $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \ |
| 141 | # $(TEST_ART_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 142 | |
| 143 | # Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE |
| 144 | define name-to-var |
| 145 | $(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_') |
| 146 | endef # name-to-var |
| 147 | |
| 148 | # Tests that are timing sensitive and flaky on heavily loaded systems. |
| 149 | TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \ |
| 150 | 053-wait-some \ |
| 151 | 055-enum-performance |
| 152 | |
| 153 | # disable timing sensitive tests on "dist" builds. |
| 154 | ifdef dist_goal |
| 155 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES), \ |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 156 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 157 | $(IMAGE_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 158 | endif |
| 159 | |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 160 | TEST_ART_TIMING_SENSITIVE_RUN_TESTS := |
| 161 | |
Nicolas Geoffray | 3d56be8 | 2014-09-30 15:05:13 +0100 | [diff] [blame] | 162 | TEST_ART_BROKEN_RUN_TESTS := \ |
| 163 | 004-ThreadStress |
| 164 | |
| 165 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES), \ |
| 166 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 167 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
| 168 | |
| 169 | TEST_ART_BROKEN_RUN_TESTS := |
| 170 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 171 | # Note 116-nodex2oat is not broken per-se it just doesn't (and isn't meant to) work with --prebuild. |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 172 | TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \ |
| 173 | 116-nodex2oat |
| 174 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 175 | ifneq (,$(filter prebuild,$(PREBUILD_TYPES))) |
| 176 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),prebuild, \ |
| 177 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 178 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
| 179 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 180 | |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 181 | TEST_ART_BROKEN_PREBUILD_RUN_TESTS := |
| 182 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 183 | TEST_ART_BROKEN_NO_PREBUILD_TESTS := \ |
| 184 | 117-nopatchoat |
| 185 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 186 | ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES))) |
| 187 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),no-prebuild, \ |
| 188 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 189 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES)) |
| 190 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 191 | |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 192 | TEST_ART_BROKEN_NO_PREBUILD_TESTS := |
| 193 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 194 | # Note 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without |
| 195 | # --prebuild --relocate |
| 196 | TEST_ART_BROKEN_NO_RELOCATE_TESTS := \ |
| 197 | 117-nopatchoat |
| 198 | |
| 199 | ifneq (,$(filter no-relocate,$(RELOCATE_TYPES))) |
| 200 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES), \ |
| 201 | $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 202 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES)) |
| 203 | endif |
| 204 | |
| 205 | TEST_ART_BROKEN_NO_RELOCATE_TESTS := |
| 206 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 207 | # Tests that are broken with GC stress. |
| 208 | TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := \ |
Ian Rogers | 58920cc | 2014-10-10 12:39:31 -0700 | [diff] [blame] | 209 | 004-SignalTest \ |
| 210 | 114-ParallelGC |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 211 | |
| 212 | ifneq (,$(filter gcstress,$(GC_TYPES))) |
| 213 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES), \ |
| 214 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \ |
| 215 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
| 216 | endif |
| 217 | |
| 218 | TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := |
| 219 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 220 | # 115-native-bridge setup is complicated. Need to implement it correctly for the target. |
| 221 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(PREBUILD_TYPES),$(COMPILER_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 222 | $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),115-native-bridge, \ |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 223 | $(ALL_ADDRESS_SIZES)) |
| 224 | |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 225 | # All these tests check that we have sane behavior if we don't have a patchoat or dex2oat. |
| 226 | # Therefore we shouldn't run them in situations where we actually don't have these since they |
| 227 | # explicitly test for them. These all also assume we have an image. |
| 228 | TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \ |
| 229 | 116-nodex2oat \ |
| 230 | 117-nopatchoat \ |
| 231 | 118-noimage-dex2oat \ |
| 232 | 119-noimage-patchoat |
| 233 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 234 | ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES))) |
| 235 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),no-dex2oat, \ |
| 236 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \ |
| 237 | $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES)) |
| 238 | endif |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 239 | |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 240 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 241 | ifneq (,$(filter no-image,$(IMAGE_TYPES))) |
| 242 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES), \ |
| 243 | $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \ |
| 244 | $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES)) |
| 245 | endif |
| 246 | |
| 247 | ifneq (,$(filter relocate-no-patchoat,$(RELOCATE_TYPES))) |
| 248 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES), \ |
| 249 | $(COMPILER_TYPES), relocate-no-patchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 250 | $(IMAGE_TYPES),$(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES)) |
| 251 | endif |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 252 | |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 253 | TEST_ART_BROKEN_FALLBACK_RUN_TESTS := |
| 254 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 255 | # Clear variables ahead of appending to them when defining tests. |
| 256 | $(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=)) |
| 257 | $(foreach target, $(TARGET_TYPES), \ |
| 258 | $(foreach prebuild, $(PREBUILD_TYPES), \ |
| 259 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=))) |
| 260 | $(foreach target, $(TARGET_TYPES), \ |
| 261 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 262 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=))) |
| 263 | $(foreach target, $(TARGET_TYPES), \ |
| 264 | $(foreach relocate, $(RELOCATE_TYPES), \ |
| 265 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=))) |
| 266 | $(foreach target, $(TARGET_TYPES), \ |
| 267 | $(foreach trace, $(TRACE_TYPES), \ |
| 268 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=))) |
| 269 | $(foreach target, $(TARGET_TYPES), \ |
| 270 | $(foreach gc, $(GC_TYPES), \ |
| 271 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=))) |
| 272 | $(foreach target, $(TARGET_TYPES), \ |
| 273 | $(foreach jni, $(JNI_TYPES), \ |
| 274 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=))) |
| 275 | $(foreach target, $(TARGET_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 276 | $(foreach image, $(IMAGE_TYPES), \ |
| 277 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=))) |
| 278 | $(foreach target, $(TARGET_TYPES), \ |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 279 | $(foreach test, $(TEST_ART_RUN_TESTS), \ |
| 280 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=))) |
| 281 | $(foreach target, $(TARGET_TYPES), \ |
| 282 | $(foreach address_size, $(ALL_ADDRESS_SIZES), \ |
| 283 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 284 | |
| 285 | # We need dex2oat and dalvikvm on the target as well as the core image. |
| 286 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUT) $(2ND_TARGET_CORE_IMG_OUT) |
| 287 | |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 288 | # Also need libarttest. |
| 289 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so |
| 290 | ifdef TARGET_2ND_ARCH |
| 291 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so |
| 292 | endif |
| 293 | |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 294 | # Also need libnativebridgetest. |
| 295 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so |
| 296 | ifdef TARGET_2ND_ARCH |
| 297 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so |
| 298 | endif |
| 299 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 300 | # All tests require the host executables and the core images. |
| 301 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \ |
| 302 | $(ART_HOST_EXECUTABLES) \ |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 303 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 304 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \ |
Nicolas Geoffray | 4d1231d | 2014-07-01 10:46:31 +0100 | [diff] [blame] | 305 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Brian Carlstrom | 519e3d0 | 2014-06-25 00:57:36 -0700 | [diff] [blame] | 306 | $(HOST_CORE_IMG_OUT) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 307 | |
| 308 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 309 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \ |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 310 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 311 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \ |
Nicolas Geoffray | 4d1231d | 2014-07-01 10:46:31 +0100 | [diff] [blame] | 312 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 313 | $(2ND_HOST_CORE_IMG_OUT) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 314 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 315 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 316 | # Create a rule to build and run a tests following the form: |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 317 | # test-art-{1: host or target}-run-test-{2: prebuild no-prebuild no-dex2oat}- |
| 318 | # {3: interpreter default optimizing}-{4: relocate no-relocate relocate-no-patchoat}- |
| 319 | # {5: trace or no-trace}-{6: gcstress gcverify cms}-{7: forcecopy checkjni jni}- |
| 320 | # {8: no-image image}-{9: test name}{10: 32 or 64} |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 321 | define define-test-art-run-test |
Nicolas Geoffray | 611e1db | 2014-10-09 17:34:45 +0100 | [diff] [blame] | 322 | run_test_options := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 323 | prereq_rule := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 324 | test_groups := |
| 325 | uc_host_or_target := |
Alex Light | bfac14a | 2014-07-30 09:41:21 -0700 | [diff] [blame] | 326 | ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true) |
| 327 | run_test_options += --always-clean |
| 328 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 329 | ifeq ($(1),host) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 330 | uc_host_or_target := HOST |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 331 | test_groups := ART_RUN_TEST_HOST_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 332 | run_test_options += --host |
| 333 | prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) |
| 334 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 335 | ifeq ($(1),target) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 336 | uc_host_or_target := TARGET |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 337 | test_groups := ART_RUN_TEST_TARGET_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 338 | prereq_rule := test-art-target-sync |
| 339 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 340 | $$(error found $(1) expected $(TARGET_TYPES)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 341 | endif |
| 342 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 343 | ifeq ($(2),prebuild) |
| 344 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES |
| 345 | run_test_options += --prebuild |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 346 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 347 | ifeq ($(2),no-prebuild) |
| 348 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES |
| 349 | run_test_options += --no-prebuild |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 350 | else |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 351 | ifeq ($(2),no-dex2oat) |
| 352 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES |
| 353 | run_test_options += --no-prebuild --no-dex2oat |
| 354 | else |
| 355 | $$(error found $(2) expected $(PREBUILD_TYPES)) |
| 356 | endif |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 357 | endif |
| 358 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 359 | ifeq ($(3),optimizing) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 360 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 361 | run_test_options += -Xcompiler-option --compiler-backend=Optimizing |
| 362 | else |
| 363 | ifeq ($(3),interpreter) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 364 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 365 | run_test_options += --interpreter |
| 366 | else |
| 367 | ifeq ($(3),default) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 368 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 369 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 370 | $$(error found $(3) expected $(COMPILER_TYPES)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 371 | endif |
| 372 | endif |
| 373 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 374 | ifeq ($(4),relocate) |
| 375 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES |
| 376 | run_test_options += --relocate |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 377 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 378 | ifeq ($(4),no-relocate) |
| 379 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES |
| 380 | run_test_options += --no-relocate |
| 381 | else |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 382 | ifeq ($(4),relocate-no-patchoat) |
| 383 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES |
| 384 | run_test_options += --relocate --no-patchoat |
| 385 | else |
| 386 | $$(error found $(4) expected $(RELOCATE_TYPES)) |
| 387 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 388 | endif |
| 389 | endif |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 390 | ifeq ($(5),trace) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 391 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 392 | run_test_options += --trace |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 393 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 394 | ifeq ($(5),no-trace) |
| 395 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES |
Ian Rogers | 701aa64 | 2014-07-18 11:38:13 -0700 | [diff] [blame] | 396 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 397 | $$(error found $(5) expected $(TRACE_TYPES)) |
| 398 | endif |
| 399 | endif |
| 400 | ifeq ($(6),gcverify) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 401 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 402 | run_test_options += --gcverify |
| 403 | else |
| 404 | ifeq ($(6),gcstress) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 405 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 406 | run_test_options += --gcstress |
| 407 | else |
| 408 | ifeq ($(6),cms) |
| 409 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES |
Ian Rogers | 8a14b75 | 2014-07-18 15:06:53 -0700 | [diff] [blame] | 410 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 411 | $$(error found $(6) expected $(GC_TYPES)) |
Ian Rogers | 701aa64 | 2014-07-18 11:38:13 -0700 | [diff] [blame] | 412 | endif |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 413 | endif |
| 414 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 415 | ifeq ($(7),forcecopy) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 416 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 417 | run_test_options += --runtime-option -Xjniopts:forcecopy |
| 418 | ifneq ($$(ART_TEST_JNI_FORCECOPY),true) |
| 419 | skip_test := true |
| 420 | endif |
| 421 | else |
| 422 | ifeq ($(7),checkjni) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 423 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 424 | run_test_options += --runtime-option -Xcheck:jni |
| 425 | else |
| 426 | ifeq ($(7),jni) |
| 427 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES |
| 428 | else |
| 429 | $$(error found $(7) expected $(JNI_TYPES)) |
| 430 | endif |
| 431 | endif |
| 432 | endif |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 433 | ifeq ($(8),no-image) |
| 434 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES |
| 435 | run_test_options += --no-image |
| 436 | else |
| 437 | ifeq ($(8),image) |
| 438 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES |
| 439 | else |
| 440 | $$(error found $(8) expected $(IMAGE_TYPES)) |
| 441 | endif |
| 442 | endif |
| 443 | # $(9) is the test name |
| 444 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(9))_RULES |
| 445 | ifeq ($(10),64) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 446 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES |
| 447 | run_test_options += --64 |
| 448 | else |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 449 | ifeq ($(10),32) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 450 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES |
| 451 | else |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 452 | $$(error found $(10) expected $(ALL_ADDRESS_SIZES)) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 453 | endif |
| 454 | endif |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 455 | run_test_rule_name := test-art-$(1)-run-test-$(2)-$(3)-$(4)-$(5)-$(6)-$(7)-$(8)-$(9)$(10) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 456 | run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \ |
Ian Rogers | 5242c0a | 2014-07-18 11:02:19 -0700 | [diff] [blame] | 457 | $$(run_test_options) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 458 | $$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options) |
| 459 | .PHONY: $$(run_test_rule_name) |
Andreas Gampe | 8fda9f2 | 2014-10-03 16:15:37 -0700 | [diff] [blame] | 460 | $$(run_test_rule_name): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $(HOST_OUT_EXECUTABLES)/smali $(HOST_OUT_EXECUTABLES)/dexmerger $$(prereq_rule) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 461 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
| 462 | DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \ |
Andreas Gampe | 8fda9f2 | 2014-10-03 16:15:37 -0700 | [diff] [blame] | 463 | SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \ |
| 464 | DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 465 | art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(9) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 466 | && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@) |
| 467 | $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \ |
| 468 | echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \ |
| 469 | rm -r $(ART_HOST_TEST_DIR)) || true |
| 470 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 471 | $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 472 | |
| 473 | # Clear locally defined variables. |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 474 | uc_host_or_target := |
| 475 | test_groups := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 476 | run_test_options := |
| 477 | run_test_rule_name := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 478 | prereq_rule := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 479 | endef # define-test-art-run-test |
| 480 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 481 | $(foreach target, $(TARGET_TYPES), \ |
| 482 | $(foreach test, $(TEST_ART_RUN_TESTS), \ |
| 483 | $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \ |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 484 | $(foreach prebuild, $(PREBUILD_TYPES), \ |
| 485 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 486 | $(foreach relocate, $(RELOCATE_TYPES), \ |
| 487 | $(foreach trace, $(TRACE_TYPES), \ |
| 488 | $(foreach gc, $(GC_TYPES), \ |
| 489 | $(foreach jni, $(JNI_TYPES), \ |
| 490 | $(foreach image, $(IMAGE_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 491 | $(eval $(call define-test-art-run-test,$(target),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(test),$(address_size))) \ |
| 492 | )))))))))) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 493 | define-test-art-run-test := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 494 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 495 | # Define a phony rule whose purpose is to test its prerequisites. |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 496 | # $(1): host or target |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 497 | # $(2): list of prerequisites |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 498 | define define-test-art-run-test-group |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 499 | .PHONY: $(1) |
| 500 | $(1): $(2) |
| 501 | $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 502 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 503 | endef # define-test-art-run-test-group |
| 504 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 505 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 506 | $(foreach target, $(TARGET_TYPES), $(eval \ |
| 507 | $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES)))) |
| 508 | $(foreach target, $(TARGET_TYPES), \ |
| 509 | $(foreach prebuild, $(PREBUILD_TYPES), $(eval \ |
| 510 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(prebuild),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES))))) |
| 511 | $(foreach target, $(TARGET_TYPES), \ |
| 512 | $(foreach compiler, $(COMPILER_TYPES), $(eval \ |
| 513 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(compiler),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES))))) |
| 514 | $(foreach target, $(TARGET_TYPES), \ |
| 515 | $(foreach relocate, $(RELOCATE_TYPES), $(eval \ |
| 516 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(relocate),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES))))) |
| 517 | $(foreach target, $(TARGET_TYPES), \ |
| 518 | $(foreach trace, $(TRACE_TYPES), $(eval \ |
| 519 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(trace),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES))))) |
| 520 | $(foreach target, $(TARGET_TYPES), \ |
| 521 | $(foreach gc, $(GC_TYPES), $(eval \ |
| 522 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(gc),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES))))) |
| 523 | $(foreach target, $(TARGET_TYPES), \ |
| 524 | $(foreach jni, $(JNI_TYPES), $(eval \ |
| 525 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(jni),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES))))) |
| 526 | $(foreach target, $(TARGET_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 527 | $(foreach image, $(IMAGE_TYPES), $(eval \ |
| 528 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(image),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES))))) |
| 529 | $(foreach target, $(TARGET_TYPES), \ |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 530 | $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \ |
| 531 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(test),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES))))) |
| 532 | $(foreach target, $(TARGET_TYPES), \ |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 533 | $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \ |
Ian Rogers | a3cf6ce | 2014-10-02 16:35:52 -0700 | [diff] [blame] | 534 | $(call define-test-art-run-test-group,test-art-$(target)-run-test$(address_size),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(address_size)_RULES))))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 535 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 536 | # Clear variables now we're finished with them. |
| 537 | $(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=)) |
| 538 | $(foreach target, $(TARGET_TYPES), \ |
| 539 | $(foreach prebuild, $(PREBUILD_TYPES), \ |
| 540 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=))) |
| 541 | $(foreach target, $(TARGET_TYPES), \ |
| 542 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 543 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=))) |
| 544 | $(foreach target, $(TARGET_TYPES), \ |
| 545 | $(foreach relocate, $(RELOCATE_TYPES), \ |
| 546 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=))) |
| 547 | $(foreach target, $(TARGET_TYPES), \ |
| 548 | $(foreach trace, $(TRACE_TYPES), \ |
| 549 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=))) |
| 550 | $(foreach target, $(TARGET_TYPES), \ |
| 551 | $(foreach gc, $(GC_TYPES), \ |
| 552 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=))) |
| 553 | $(foreach target, $(TARGET_TYPES), \ |
| 554 | $(foreach jni, $(JNI_TYPES), \ |
| 555 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=))) |
| 556 | $(foreach target, $(TARGET_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 557 | $(foreach image, $(IMAGE_TYPES), \ |
| 558 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=))) |
| 559 | $(foreach target, $(TARGET_TYPES), \ |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 560 | $(foreach test, $(TEST_ART_RUN_TESTS), \ |
| 561 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=))) |
| 562 | $(foreach target, $(TARGET_TYPES), \ |
| 563 | $(foreach address_size, $(ALL_ADDRESS_SIZES), \ |
| 564 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 565 | define-test-art-run-test-group := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 566 | TARGET_TYPES := |
| 567 | PREBUILD_TYPES := |
| 568 | COMPILER_TYPES := |
| 569 | RELOCATE_TYPES := |
| 570 | TRACE_TYPES := |
| 571 | GC_TYPES := |
| 572 | JNI_TYPES := |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 573 | IMAGE_TYPES := |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 574 | ADDRESS_SIZES_TARGET := |
| 575 | ADDRESS_SIZES_HOST := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 576 | ALL_ADDRESS_SIZES := |
Ian Rogers | 9fcaa4b | 2014-08-26 19:59:52 -0700 | [diff] [blame] | 577 | |
| 578 | include $(LOCAL_PATH)/Android.libarttest.mk |
| 579 | include art/test/Android.libnativebridgetest.mk |