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 |
| 39 | $$(dmart_target): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin |
| 40 | $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@) |
| 41 | $(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \ |
| 42 | $(LOCAL_PATH)/run-test --build-only --output-path $$(abspath $$(dir $$@)) $(1) |
| 43 | $(hide) touch $$@ |
| 44 | |
| 45 | TEST_ART_RUN_TEST_BUILD_RULES += $$(dmart_target) |
| 46 | dmart_target := |
| 47 | endef |
Ian Rogers | bf66bce | 2014-06-24 23:15:34 -0700 | [diff] [blame] | 48 | $(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] | 49 | |
| 50 | include $(CLEAR_VARS) |
| 51 | LOCAL_MODULE_TAGS := tests |
| 52 | LOCAL_MODULE := art-run-tests |
| 53 | LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES) |
| 54 | # The build system use this flag to pick up files generated by declare-make-art-run-test. |
| 55 | LOCAL_PICKUP_FILES := $(art_run_tests_dir) |
| 56 | |
| 57 | include $(BUILD_PHONY_PACKAGE) |
| 58 | |
| 59 | # Clear temp vars. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 60 | art_run_tests_dir := |
| 61 | define-build-art-run-test := |
Ian Rogers | 8a14b75 | 2014-07-18 15:06:53 -0700 | [diff] [blame] | 62 | TEST_ART_RUN_TEST_BUILD_RULES := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 63 | |
| 64 | ######################################################################## |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 65 | # General rules to build and run a run-test. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 66 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 67 | # Test rule names or of the form: |
| 68 | # test-art-{1: host or target}-run-test-{2: prebuild or no-prebuild}- |
| 69 | # {3: interpreter default optimizing}-{4: relocate or no-relocate}-{5: trace or no-trace}- |
| 70 | # {6: gcstress gcverify cms}-{7: forcecopy checkjni jni}-{8: test name}{9: 32 or 64} |
| 71 | TARGET_TYPES := host target |
| 72 | PREBUILD_TYPES := prebuild no-prebuild |
| 73 | COMPILER_TYPES := default interpreter optimizing |
| 74 | RELOCATE_TYPES := relocate no-relocate |
| 75 | TRACE_TYPES := trace no-trace |
| 76 | GC_TYPES := gcstress gcverify cms |
| 77 | JNI_TYPES := jni checkjni forcecopy |
| 78 | ALL_ADDRESS_SIZES := 64 32 |
| 79 | # List all run test names with number arguments agreeing with the comment above. |
| 80 | define all-run-test-names |
| 81 | $(foreach target, $(1), \ |
| 82 | $(foreach prebuild, $(2), \ |
| 83 | $(foreach compiler, $(3), \ |
| 84 | $(foreach relocate, $(4), \ |
| 85 | $(foreach trace, $(5), \ |
| 86 | $(foreach gc, $(6), \ |
| 87 | $(foreach jni, $(7), \ |
| 88 | $(foreach test, $(8), \ |
| 89 | $(foreach address_size, $(9), \ |
| 90 | test-art-$(target)-run-test-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(test)$(address_size) \ |
| 91 | ))))))))) |
| 92 | endef # all-run-test-names |
| 93 | |
| 94 | # To generate a full list or tests: |
| 95 | # $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \ |
| 96 | # $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(TEST_ART_RUN_TESTS), \ |
| 97 | # $(ALL_ADDRESS_SIZES)) |
| 98 | |
| 99 | # Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE |
| 100 | define name-to-var |
| 101 | $(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_') |
| 102 | endef # name-to-var |
| 103 | |
| 104 | # Tests that are timing sensitive and flaky on heavily loaded systems. |
| 105 | TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \ |
| 106 | 053-wait-some \ |
| 107 | 055-enum-performance |
| 108 | |
| 109 | # disable timing sensitive tests on "dist" builds. |
| 110 | ifdef dist_goal |
| 111 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES), \ |
| 112 | $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 113 | $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
| 114 | endif |
| 115 | |
| 116 | # NB 116-nodex2oat is not broken per-se it just doesn't (and isn't meant to) work with --prebuild. |
| 117 | TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \ |
| 118 | 116-nodex2oat |
| 119 | |
| 120 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),prebuild, \ |
| 121 | $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 122 | $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
| 123 | |
| 124 | # NB 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without --prebuild --relocate |
| 125 | TEST_ART_BROKEN_NO_RELOCATE_TESTS := \ |
| 126 | 117-nopatchoat |
| 127 | |
| 128 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES), \ |
| 129 | $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 130 | $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES)) |
| 131 | |
| 132 | TEST_ART_BROKEN_NO_PREBUILD_TESTS := \ |
| 133 | 117-nopatchoat |
| 134 | |
| 135 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),no-prebuild, \ |
| 136 | $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 137 | $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES)) |
| 138 | |
| 139 | # Tests that are broken with tracing. |
| 140 | TEST_ART_BROKEN_TRACE_RUN_TESTS := \ |
| 141 | 004-SignalTest \ |
| 142 | 018-stack-overflow \ |
| 143 | 097-duplicate-method \ |
| 144 | 107-int-math2 |
| 145 | |
| 146 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(PREBUILD_TYPES), \ |
| 147 | $(COMPILER_TYPES), $(RELOCATE_TYPES),trace,$(GC_TYPES),$(JNI_TYPES), \ |
| 148 | $(TEST_ART_BROKEN_TRACE_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
| 149 | |
| 150 | TEST_ART_BROKEN_TRACE_RUN_TESTS := |
| 151 | |
| 152 | # 115-native-bridge setup is complicated. Need to implement it correctly for the target. |
| 153 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(PREBUILD_TYPES),$(COMPILER_TYPES), \ |
| 154 | $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),115-native-bridge, \ |
| 155 | $(ALL_ADDRESS_SIZES)) |
| 156 | |
| 157 | # Clear variables ahead of appending to them when defining tests. |
| 158 | $(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=)) |
| 159 | $(foreach target, $(TARGET_TYPES), \ |
| 160 | $(foreach prebuild, $(PREBUILD_TYPES), \ |
| 161 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=))) |
| 162 | $(foreach target, $(TARGET_TYPES), \ |
| 163 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 164 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=))) |
| 165 | $(foreach target, $(TARGET_TYPES), \ |
| 166 | $(foreach relocate, $(RELOCATE_TYPES), \ |
| 167 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=))) |
| 168 | $(foreach target, $(TARGET_TYPES), \ |
| 169 | $(foreach trace, $(TRACE_TYPES), \ |
| 170 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=))) |
| 171 | $(foreach target, $(TARGET_TYPES), \ |
| 172 | $(foreach gc, $(GC_TYPES), \ |
| 173 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=))) |
| 174 | $(foreach target, $(TARGET_TYPES), \ |
| 175 | $(foreach jni, $(JNI_TYPES), \ |
| 176 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=))) |
| 177 | $(foreach target, $(TARGET_TYPES), \ |
| 178 | $(foreach test, $(TEST_ART_RUN_TESTS), \ |
| 179 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=))) |
| 180 | $(foreach target, $(TARGET_TYPES), \ |
| 181 | $(foreach address_size, $(ALL_ADDRESS_SIZES), \ |
| 182 | $(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] | 183 | |
| 184 | # We need dex2oat and dalvikvm on the target as well as the core image. |
| 185 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUT) $(2ND_TARGET_CORE_IMG_OUT) |
| 186 | |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 187 | # Also need libarttest. |
| 188 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so |
| 189 | ifdef TARGET_2ND_ARCH |
| 190 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so |
| 191 | endif |
| 192 | |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 193 | # Also need libnativebridgetest. |
| 194 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so |
| 195 | ifdef TARGET_2ND_ARCH |
| 196 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so |
| 197 | endif |
| 198 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 199 | # All tests require the host executables and the core images. |
| 200 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \ |
| 201 | $(ART_HOST_EXECUTABLES) \ |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 202 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 203 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \ |
Nicolas Geoffray | 4d1231d | 2014-07-01 10:46:31 +0100 | [diff] [blame] | 204 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Brian Carlstrom | 519e3d0 | 2014-06-25 00:57:36 -0700 | [diff] [blame] | 205 | $(HOST_CORE_IMG_OUT) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 206 | |
| 207 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 208 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \ |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 209 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 210 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \ |
Nicolas Geoffray | 4d1231d | 2014-07-01 10:46:31 +0100 | [diff] [blame] | 211 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 212 | $(2ND_HOST_CORE_IMG_OUT) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 213 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 214 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 215 | # Create a rule to build and run a tests following the form: |
| 216 | # test-art-{1: host or target}-run-test-{2: prebuild or no-prebuild}- |
| 217 | # {3: interpreter default optimizing}-{4: relocate or no-relocate}-{5: trace or no-trace}- |
| 218 | # {6: gcstress gcverify cms}-{7: forcecopy checkjni jni}-{8: test name}{9: 32 or 64} |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 219 | define define-test-art-run-test |
| 220 | run_test_options := $(addprefix --runtime-option ,$(DALVIKVM_FLAGS)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 221 | prereq_rule := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 222 | test_groups := |
| 223 | uc_host_or_target := |
Alex Light | bfac14a | 2014-07-30 09:41:21 -0700 | [diff] [blame] | 224 | ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true) |
| 225 | run_test_options += --always-clean |
| 226 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 227 | ifeq ($(1),host) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 228 | uc_host_or_target := HOST |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 229 | test_groups := ART_RUN_TEST_HOST_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 230 | run_test_options += --host |
| 231 | prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) |
| 232 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 233 | ifeq ($(1),target) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 234 | uc_host_or_target := TARGET |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 235 | test_groups := ART_RUN_TEST_TARGET_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 236 | prereq_rule := test-art-target-sync |
| 237 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 238 | $$(error found $(1) expected $(TARGET_TYPES)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 239 | endif |
| 240 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 241 | ifeq ($(2),prebuild) |
| 242 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES |
| 243 | run_test_options += --prebuild |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 244 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 245 | ifeq ($(2),no-prebuild) |
| 246 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES |
| 247 | run_test_options += --no-prebuild |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 248 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 249 | $$(error found $(2) expected $(PREBUILD_TYPES)) |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 250 | endif |
| 251 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 252 | ifeq ($(3),optimizing) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 253 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 254 | run_test_options += -Xcompiler-option --compiler-backend=Optimizing |
| 255 | else |
| 256 | ifeq ($(3),interpreter) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 257 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 258 | run_test_options += --interpreter |
| 259 | else |
| 260 | ifeq ($(3),default) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 261 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 262 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 263 | $$(error found $(3) expected $(COMPILER_TYPES)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 264 | endif |
| 265 | endif |
| 266 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 267 | ifeq ($(4),relocate) |
| 268 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES |
| 269 | run_test_options += --relocate |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 270 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 271 | ifeq ($(4),no-relocate) |
| 272 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES |
| 273 | run_test_options += --no-relocate |
| 274 | else |
| 275 | $$(error found $(4) expected $(RELOCATE_TYPES)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 276 | endif |
| 277 | endif |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 278 | ifeq ($(5),trace) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 279 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 280 | run_test_options += --trace |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 281 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 282 | ifeq ($(5),no-trace) |
| 283 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES |
Ian Rogers | 701aa64 | 2014-07-18 11:38:13 -0700 | [diff] [blame] | 284 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 285 | $$(error found $(5) expected $(TRACE_TYPES)) |
| 286 | endif |
| 287 | endif |
| 288 | ifeq ($(6),gcverify) |
| 289 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GC_VERIFY_RULES |
| 290 | run_test_options += --gcverify |
| 291 | else |
| 292 | ifeq ($(6),gcstress) |
| 293 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GC_STRESS_RULES |
| 294 | run_test_options += --gcstress |
| 295 | else |
| 296 | ifeq ($(6),cms) |
| 297 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES |
Ian Rogers | 8a14b75 | 2014-07-18 15:06:53 -0700 | [diff] [blame] | 298 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 299 | $$(error found $(6) expected $(GC_TYPES)) |
Ian Rogers | 701aa64 | 2014-07-18 11:38:13 -0700 | [diff] [blame] | 300 | endif |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 301 | endif |
| 302 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 303 | ifeq ($(7),forcecopy) |
| 304 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCE_COPY_RULES |
| 305 | run_test_options += --runtime-option -Xjniopts:forcecopy |
| 306 | ifneq ($$(ART_TEST_JNI_FORCECOPY),true) |
| 307 | skip_test := true |
| 308 | endif |
| 309 | else |
| 310 | ifeq ($(7),checkjni) |
| 311 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECK_JNI_RULES |
| 312 | run_test_options += --runtime-option -Xcheck:jni |
| 313 | else |
| 314 | ifeq ($(7),jni) |
| 315 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES |
| 316 | else |
| 317 | $$(error found $(7) expected $(JNI_TYPES)) |
| 318 | endif |
| 319 | endif |
| 320 | endif |
| 321 | # $(8) is the test name |
| 322 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(8))_RULES |
| 323 | ifeq ($(9),64) |
| 324 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES |
| 325 | run_test_options += --64 |
| 326 | else |
| 327 | ifeq ($(9),32) |
| 328 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES |
| 329 | else |
| 330 | $$(error found $(9) expected $(ALL_ADDRESS_SIZES)) |
| 331 | endif |
| 332 | endif |
| 333 | run_test_rule_name := test-art-$(1)-run-test-$(2)-$(3)-$(4)-$(5)-$(6)-$(7)-$(8)$(9) |
| 334 | 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] | 335 | $$(run_test_options) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 336 | $$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options) |
| 337 | .PHONY: $$(run_test_rule_name) |
| 338 | $$(run_test_rule_name): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $$(prereq_rule) |
| 339 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
| 340 | DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \ |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 341 | art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(8) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 342 | && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@) |
| 343 | $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \ |
| 344 | echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \ |
| 345 | rm -r $(ART_HOST_TEST_DIR)) || true |
| 346 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 347 | $$(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] | 348 | |
| 349 | # Clear locally defined variables. |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 350 | uc_host_or_target := |
| 351 | test_groups := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 352 | run_test_options := |
| 353 | run_test_rule_name := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 354 | prereq_rule := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 355 | endef # define-test-art-run-test |
| 356 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 357 | test_prebuild_types := prebuild |
| 358 | ifeq ($(ART_TEST_RUN_TEST_NO_PREBUILD),true) |
| 359 | test_prebuild_types += no-prebuild |
| 360 | endif |
| 361 | test_compiler_types := |
| 362 | ifeq ($(ART_TEST_DEFAULT_COMPILER),true) |
| 363 | test_compiler_types += default |
| 364 | endif |
| 365 | ifeq ($(ART_TEST_INTERPRETER),true) |
| 366 | test_compiler_types += interpreter |
| 367 | endif |
| 368 | ifeq ($(ART_TEST_OPTIMIZING),true) |
| 369 | test_compiler_types += optimizing |
| 370 | endif |
| 371 | test_relocate_types := relocate |
| 372 | ifeq ($(ART_TEST_RUN_TEST_NO_RELOCATE),true) |
| 373 | test_relocate_types += no-relocate |
| 374 | endif |
| 375 | test_trace_types := no-trace |
| 376 | ifeq ($(ART_TEST_TRACE),true) |
| 377 | test_trace_types += trace |
| 378 | endif |
| 379 | test_gc_types := cms |
| 380 | ifeq ($(ART_TEST_GCSTRESS),true) |
| 381 | test_gc_types += gcstress |
| 382 | endif |
| 383 | ifeq ($(ART_TEST_GCVERIFY),true) |
| 384 | test_gc_types += gcverify |
| 385 | endif |
| 386 | test_jni_types := checkjni |
| 387 | ifeq ($(ART_TEST_JNI_FORCECOPY),true) |
| 388 | test_jni_types += forcecopy |
| 389 | endif |
| 390 | |
| 391 | ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX) $(2ND_ART_PHONY_TEST_TARGET_SUFFIX) |
| 392 | ADDRESS_SIZES_HOST := $(ART_PHONY_TEST_HOST_SUFFIX) $(2ND_ART_PHONY_TEST_HOST_SUFFIX) |
| 393 | |
| 394 | $(foreach target, $(TARGET_TYPES), \ |
| 395 | $(foreach test, $(TEST_ART_RUN_TESTS), \ |
| 396 | $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \ |
| 397 | $(foreach prebuild, $(test_prebuild_types), \ |
| 398 | $(foreach compiler, $(test_compiler_types), \ |
| 399 | $(foreach relocate, $(test_relocate_types), \ |
| 400 | $(foreach trace, $(test_trace_types), \ |
| 401 | $(foreach gc, $(test_gc_types), \ |
| 402 | $(foreach jni, $(test_jni_types), \ |
| 403 | $(eval $(call define-test-art-run-test,$(target),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(test),$(address_size))) \ |
| 404 | ))))))))) |
| 405 | define-test-art-run-test := |
| 406 | test_prebuild_types := |
| 407 | test_compiler_types := |
| 408 | test_relocate_types := |
| 409 | test_trace_types := |
| 410 | test_gc_types := |
| 411 | test_jni_types := |
| 412 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES := |
| 413 | ADDRESS_SIZES_TARGET := |
| 414 | ADDRESS_SIZES_HOST := |
| 415 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 416 | # Define a phony rule whose purpose is to test its prerequisites. |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 417 | # $(1): host or target |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 418 | # $(2): list of prerequisites |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 419 | define define-test-art-run-test-group |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 420 | .PHONY: $(1) |
| 421 | $(1): $(2) |
| 422 | $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 423 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 424 | endef # define-test-art-run-test-group |
| 425 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 426 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 427 | $(foreach target, $(TARGET_TYPES), $(eval \ |
| 428 | $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES)))) |
| 429 | $(foreach target, $(TARGET_TYPES), \ |
| 430 | $(foreach prebuild, $(PREBUILD_TYPES), $(eval \ |
| 431 | $(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))))) |
| 432 | $(foreach target, $(TARGET_TYPES), \ |
| 433 | $(foreach compiler, $(COMPILER_TYPES), $(eval \ |
| 434 | $(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))))) |
| 435 | $(foreach target, $(TARGET_TYPES), \ |
| 436 | $(foreach relocate, $(RELOCATE_TYPES), $(eval \ |
| 437 | $(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))))) |
| 438 | $(foreach target, $(TARGET_TYPES), \ |
| 439 | $(foreach trace, $(TRACE_TYPES), $(eval \ |
| 440 | $(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))))) |
| 441 | $(foreach target, $(TARGET_TYPES), \ |
| 442 | $(foreach gc, $(GC_TYPES), $(eval \ |
| 443 | $(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))))) |
| 444 | $(foreach target, $(TARGET_TYPES), \ |
| 445 | $(foreach jni, $(JNI_TYPES), $(eval \ |
| 446 | $(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))))) |
| 447 | $(foreach target, $(TARGET_TYPES), \ |
| 448 | $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \ |
| 449 | $(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))))) |
| 450 | $(foreach target, $(TARGET_TYPES), \ |
| 451 | $(foreach address_size, $(ALL_ADDRESS_SIZES), $(eval \ |
| 452 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(address_size),$(ART_RUN_TEST_$(address_size)_RULES))))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 453 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 454 | # Clear variables now we're finished with them. |
| 455 | $(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=)) |
| 456 | $(foreach target, $(TARGET_TYPES), \ |
| 457 | $(foreach prebuild, $(PREBUILD_TYPES), \ |
| 458 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=))) |
| 459 | $(foreach target, $(TARGET_TYPES), \ |
| 460 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 461 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=))) |
| 462 | $(foreach target, $(TARGET_TYPES), \ |
| 463 | $(foreach relocate, $(RELOCATE_TYPES), \ |
| 464 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=))) |
| 465 | $(foreach target, $(TARGET_TYPES), \ |
| 466 | $(foreach trace, $(TRACE_TYPES), \ |
| 467 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=))) |
| 468 | $(foreach target, $(TARGET_TYPES), \ |
| 469 | $(foreach gc, $(GC_TYPES), \ |
| 470 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=))) |
| 471 | $(foreach target, $(TARGET_TYPES), \ |
| 472 | $(foreach jni, $(JNI_TYPES), \ |
| 473 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=))) |
| 474 | $(foreach target, $(TARGET_TYPES), \ |
| 475 | $(foreach test, $(TEST_ART_RUN_TESTS), \ |
| 476 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=))) |
| 477 | $(foreach target, $(TARGET_TYPES), \ |
| 478 | $(foreach address_size, $(ALL_ADDRESS_SIZES), \ |
| 479 | $(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] | 480 | define-test-art-run-test-group := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 481 | TARGET_TYPES := |
| 482 | PREBUILD_TYPES := |
| 483 | COMPILER_TYPES := |
| 484 | RELOCATE_TYPES := |
| 485 | TRACE_TYPES := |
| 486 | GC_TYPES := |
| 487 | JNI_TYPES := |
| 488 | ALL_ADDRESS_SIZES := |