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 |
Ian Rogers | abbf242 | 2014-10-15 11:57:01 -0700 | [diff] [blame] | 55 | LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES) |
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 |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 118 | RUN_TYPES := |
| 119 | ifeq ($(ART_TEST_RUN_TEST_DEBUG),true) |
| 120 | RUN_TYPES += debug |
| 121 | endif |
| 122 | ifeq ($(ART_TEST_RUN_TEST_NDEBUG),true) |
| 123 | RUN_TYPES += ndebug |
| 124 | endif |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 125 | ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX) $(2ND_ART_PHONY_TEST_TARGET_SUFFIX) |
| 126 | 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] | 127 | ALL_ADDRESS_SIZES := 64 32 |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 128 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 129 | # List all run test names with number arguments agreeing with the comment above. |
| 130 | define all-run-test-names |
| 131 | $(foreach target, $(1), \ |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 132 | $(foreach run-type, $(2), \ |
| 133 | $(foreach prebuild, $(3), \ |
| 134 | $(foreach compiler, $(4), \ |
| 135 | $(foreach relocate, $(5), \ |
| 136 | $(foreach trace, $(6), \ |
| 137 | $(foreach gc, $(7), \ |
| 138 | $(foreach jni, $(8), \ |
| 139 | $(foreach image, $(9), \ |
| 140 | $(foreach test, $(10), \ |
| 141 | $(foreach address_size, $(11), \ |
| 142 | test-art-$(target)-run-test-$(run-type)-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(image)-$(test)$(address_size) \ |
| 143 | ))))))))))) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 144 | endef # all-run-test-names |
| 145 | |
| 146 | # To generate a full list or tests: |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 147 | # $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \ |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 148 | # $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \ |
| 149 | # $(TEST_ART_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 150 | |
| 151 | # Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE |
| 152 | define name-to-var |
| 153 | $(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_') |
| 154 | endef # name-to-var |
| 155 | |
| 156 | # Tests that are timing sensitive and flaky on heavily loaded systems. |
| 157 | TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \ |
| 158 | 053-wait-some \ |
| 159 | 055-enum-performance |
| 160 | |
| 161 | # disable timing sensitive tests on "dist" builds. |
| 162 | ifdef dist_goal |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 163 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \ |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 164 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 165 | $(IMAGE_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 166 | endif |
| 167 | |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 168 | TEST_ART_TIMING_SENSITIVE_RUN_TESTS := |
| 169 | |
Nicolas Geoffray | 3d56be8 | 2014-09-30 15:05:13 +0100 | [diff] [blame] | 170 | TEST_ART_BROKEN_RUN_TESTS := \ |
| 171 | 004-ThreadStress |
| 172 | |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 173 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \ |
Nicolas Geoffray | 3d56be8 | 2014-09-30 15:05:13 +0100 | [diff] [blame] | 174 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 175 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
| 176 | |
| 177 | TEST_ART_BROKEN_RUN_TESTS := |
| 178 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 179 | # 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] | 180 | TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \ |
| 181 | 116-nodex2oat |
| 182 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 183 | ifneq (,$(filter prebuild,$(PREBUILD_TYPES))) |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 184 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),prebuild, \ |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 185 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 186 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
| 187 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 188 | |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 189 | TEST_ART_BROKEN_PREBUILD_RUN_TESTS := |
| 190 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 191 | TEST_ART_BROKEN_NO_PREBUILD_TESTS := \ |
| 192 | 117-nopatchoat |
| 193 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 194 | ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES))) |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 195 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-prebuild, \ |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 196 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 197 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES)) |
| 198 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 199 | |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 200 | TEST_ART_BROKEN_NO_PREBUILD_TESTS := |
| 201 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 202 | # Note 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without |
| 203 | # --prebuild --relocate |
| 204 | TEST_ART_BROKEN_NO_RELOCATE_TESTS := \ |
| 205 | 117-nopatchoat |
| 206 | |
| 207 | ifneq (,$(filter no-relocate,$(RELOCATE_TYPES))) |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 208 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \ |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 209 | $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 210 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES)) |
| 211 | endif |
| 212 | |
| 213 | TEST_ART_BROKEN_NO_RELOCATE_TESTS := |
| 214 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 215 | # Tests that are broken with GC stress. |
| 216 | TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := \ |
Ian Rogers | 58920cc | 2014-10-10 12:39:31 -0700 | [diff] [blame] | 217 | 004-SignalTest \ |
| 218 | 114-ParallelGC |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 219 | |
| 220 | ifneq (,$(filter gcstress,$(GC_TYPES))) |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 221 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \ |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 222 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \ |
| 223 | $(IMAGE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES)) |
| 224 | endif |
| 225 | |
| 226 | TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := |
| 227 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 228 | # 115-native-bridge setup is complicated. Need to implement it correctly for the target. |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 229 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 230 | $(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] | 231 | $(ALL_ADDRESS_SIZES)) |
| 232 | |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 233 | # All these tests check that we have sane behavior if we don't have a patchoat or dex2oat. |
| 234 | # Therefore we shouldn't run them in situations where we actually don't have these since they |
| 235 | # explicitly test for them. These all also assume we have an image. |
| 236 | TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \ |
| 237 | 116-nodex2oat \ |
| 238 | 117-nopatchoat \ |
| 239 | 118-noimage-dex2oat \ |
| 240 | 119-noimage-patchoat |
| 241 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 242 | ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES))) |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 243 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \ |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 244 | $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \ |
| 245 | $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES)) |
| 246 | endif |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 247 | |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 248 | |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 249 | ifneq (,$(filter no-image,$(IMAGE_TYPES))) |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 250 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \ |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 251 | $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \ |
| 252 | $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES)) |
| 253 | endif |
| 254 | |
| 255 | ifneq (,$(filter relocate-no-patchoat,$(RELOCATE_TYPES))) |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 256 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \ |
Ian Rogers | 40e1912 | 2014-09-02 15:59:28 -0700 | [diff] [blame] | 257 | $(COMPILER_TYPES), relocate-no-patchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 258 | $(IMAGE_TYPES),$(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES)) |
| 259 | endif |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 260 | |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 261 | TEST_ART_BROKEN_FALLBACK_RUN_TESTS := |
| 262 | |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 263 | # The following tests use libarttest.so, which is linked against libartd.so, so will |
| 264 | # not work when libart.so is the one loaded. |
| 265 | # TODO: Find a way to run these tests in ndebug mode. |
| 266 | TEST_ART_BROKEN_NDEBUG_TESTS := \ |
| 267 | 004-JniTest \ |
| 268 | 004-ReferenceMap \ |
| 269 | 004-SignalTest \ |
| 270 | 004-StackWalk \ |
| 271 | 004-UnsafeTest \ |
| 272 | 115-native-bridge \ |
| 273 | 116-nodex2oat \ |
| 274 | 117-nopatchoat \ |
| 275 | 118-noimage-dex2oat \ |
| 276 | 119-noimage-patchoat \ |
| 277 | |
| 278 | ifneq (,$(filter ndebug,$(RUN_TYPES))) |
| 279 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \ |
| 280 | $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \ |
| 281 | $(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES)) |
| 282 | endif |
| 283 | |
| 284 | TEST_ART_BROKEN_NDEBUG_TESTS := |
| 285 | |
Nicolas Geoffray | a3d05a4 | 2014-10-20 17:41:32 +0100 | [diff] [blame] | 286 | # Known broken tests for the default compiler (Quick). |
| 287 | TEST_ART_BROKEN_DEFAULT_RUN_TESTS := \ |
| 288 | 412-new-array |
| 289 | |
| 290 | ifneq (,$(filter default,$(COMPILER_TYPES))) |
| 291 | ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \ |
Nicolas Geoffray | 83cae42 | 2014-10-22 15:08:03 +0100 | [diff] [blame^] | 292 | default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ |
| 293 | $(IMAGE_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES)) |
Nicolas Geoffray | a3d05a4 | 2014-10-20 17:41:32 +0100 | [diff] [blame] | 294 | endif |
| 295 | |
| 296 | TEST_ART_BROKEN_DEFAULT_RUN_TESTS := |
| 297 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 298 | # Clear variables ahead of appending to them when defining tests. |
| 299 | $(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=)) |
| 300 | $(foreach target, $(TARGET_TYPES), \ |
| 301 | $(foreach prebuild, $(PREBUILD_TYPES), \ |
| 302 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=))) |
| 303 | $(foreach target, $(TARGET_TYPES), \ |
| 304 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 305 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=))) |
| 306 | $(foreach target, $(TARGET_TYPES), \ |
| 307 | $(foreach relocate, $(RELOCATE_TYPES), \ |
| 308 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=))) |
| 309 | $(foreach target, $(TARGET_TYPES), \ |
| 310 | $(foreach trace, $(TRACE_TYPES), \ |
| 311 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=))) |
| 312 | $(foreach target, $(TARGET_TYPES), \ |
| 313 | $(foreach gc, $(GC_TYPES), \ |
| 314 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=))) |
| 315 | $(foreach target, $(TARGET_TYPES), \ |
| 316 | $(foreach jni, $(JNI_TYPES), \ |
| 317 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=))) |
| 318 | $(foreach target, $(TARGET_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 319 | $(foreach image, $(IMAGE_TYPES), \ |
| 320 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=))) |
| 321 | $(foreach target, $(TARGET_TYPES), \ |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 322 | $(foreach test, $(TEST_ART_RUN_TESTS), \ |
| 323 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=))) |
| 324 | $(foreach target, $(TARGET_TYPES), \ |
| 325 | $(foreach address_size, $(ALL_ADDRESS_SIZES), \ |
| 326 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=))) |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 327 | $(foreach target, $(TARGET_TYPES), \ |
| 328 | $(foreach run_type, $(RUN_TYPES), \ |
| 329 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 330 | |
| 331 | # We need dex2oat and dalvikvm on the target as well as the core image. |
| 332 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUT) $(2ND_TARGET_CORE_IMG_OUT) |
| 333 | |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 334 | # Also need libarttest. |
| 335 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so |
| 336 | ifdef TARGET_2ND_ARCH |
| 337 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so |
| 338 | endif |
| 339 | |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 340 | # Also need libnativebridgetest. |
| 341 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so |
| 342 | ifdef TARGET_2ND_ARCH |
| 343 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so |
| 344 | endif |
| 345 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 346 | # All tests require the host executables and the core images. |
| 347 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \ |
| 348 | $(ART_HOST_EXECUTABLES) \ |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 349 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 350 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \ |
Nicolas Geoffray | 4d1231d | 2014-07-01 10:46:31 +0100 | [diff] [blame] | 351 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Brian Carlstrom | 519e3d0 | 2014-06-25 00:57:36 -0700 | [diff] [blame] | 352 | $(HOST_CORE_IMG_OUT) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 353 | |
| 354 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 355 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \ |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 356 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 357 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \ |
Nicolas Geoffray | 4d1231d | 2014-07-01 10:46:31 +0100 | [diff] [blame] | 358 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 359 | $(2ND_HOST_CORE_IMG_OUT) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 360 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 361 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 362 | # Create a rule to build and run a tests following the form: |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 363 | # test-art-{1: host or target}-run-test-{2:debug ndebug}-{3: prebuild no-prebuild no-dex2oat}- |
| 364 | # {4: interpreter default optimizing}-{5: relocate no-relocate relocate-no-patchoat}- |
| 365 | # {6: trace or no-trace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}- |
| 366 | # {9: no-image image}-{10: test name}{11: 32 or 64} |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 367 | define define-test-art-run-test |
Nicolas Geoffray | 611e1db | 2014-10-09 17:34:45 +0100 | [diff] [blame] | 368 | run_test_options := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 369 | prereq_rule := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 370 | test_groups := |
| 371 | uc_host_or_target := |
Alex Light | bfac14a | 2014-07-30 09:41:21 -0700 | [diff] [blame] | 372 | ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true) |
| 373 | run_test_options += --always-clean |
| 374 | endif |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 375 | ifeq ($(1),host) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 376 | uc_host_or_target := HOST |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 377 | test_groups := ART_RUN_TEST_HOST_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 378 | run_test_options += --host |
| 379 | prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) |
| 380 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 381 | ifeq ($(1),target) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 382 | uc_host_or_target := TARGET |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 383 | test_groups := ART_RUN_TEST_TARGET_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 384 | prereq_rule := test-art-target-sync |
| 385 | else |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 386 | $$(error found $(1) expected $(TARGET_TYPES)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 387 | endif |
| 388 | endif |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 389 | ifeq ($(2),debug) |
| 390 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES |
| 391 | else |
| 392 | ifeq ($(2),ndebug) |
| 393 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES |
| 394 | run_test_options += -O |
| 395 | else |
| 396 | $$(error found $(2) expected $(RUN_TYPES)) |
| 397 | endif |
| 398 | endif |
| 399 | ifeq ($(3),prebuild) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 400 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES |
| 401 | run_test_options += --prebuild |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 402 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 403 | ifeq ($(3),no-prebuild) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 404 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES |
| 405 | run_test_options += --no-prebuild |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 406 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 407 | ifeq ($(3),no-dex2oat) |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 408 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES |
| 409 | run_test_options += --no-prebuild --no-dex2oat |
| 410 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 411 | $$(error found $(3) expected $(PREBUILD_TYPES)) |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 412 | endif |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 413 | endif |
| 414 | endif |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 415 | ifeq ($(4),optimizing) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 416 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 417 | run_test_options += -Xcompiler-option --compiler-backend=Optimizing |
| 418 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 419 | ifeq ($(4),interpreter) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 420 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 421 | run_test_options += --interpreter |
| 422 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 423 | ifeq ($(4),default) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 424 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 425 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 426 | $$(error found $(4) expected $(COMPILER_TYPES)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 427 | endif |
| 428 | endif |
| 429 | endif |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 430 | ifeq ($(5),relocate) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 431 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES |
| 432 | run_test_options += --relocate |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 433 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 434 | ifeq ($(5),no-relocate) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 435 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES |
| 436 | run_test_options += --no-relocate |
| 437 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 438 | ifeq ($(5),relocate-no-patchoat) |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 439 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES |
| 440 | run_test_options += --relocate --no-patchoat |
| 441 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 442 | $$(error found $(5) expected $(RELOCATE_TYPES)) |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 443 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 444 | endif |
| 445 | endif |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 446 | ifeq ($(6),trace) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 447 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 448 | run_test_options += --trace |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 449 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 450 | ifeq ($(6),no-trace) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 451 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES |
Ian Rogers | 701aa64 | 2014-07-18 11:38:13 -0700 | [diff] [blame] | 452 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 453 | $$(error found $(6) expected $(TRACE_TYPES)) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 454 | endif |
| 455 | endif |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 456 | ifeq ($(7),gcverify) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 457 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 458 | run_test_options += --gcverify |
| 459 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 460 | ifeq ($(7),gcstress) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 461 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 462 | run_test_options += --gcstress |
| 463 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 464 | ifeq ($(7),cms) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 465 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES |
Ian Rogers | 8a14b75 | 2014-07-18 15:06:53 -0700 | [diff] [blame] | 466 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 467 | $$(error found $(7) expected $(GC_TYPES)) |
Ian Rogers | 701aa64 | 2014-07-18 11:38:13 -0700 | [diff] [blame] | 468 | endif |
Ian Rogers | 716e4f8 | 2014-07-16 11:18:03 -0700 | [diff] [blame] | 469 | endif |
| 470 | endif |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 471 | ifeq ($(8),forcecopy) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 472 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 473 | run_test_options += --runtime-option -Xjniopts:forcecopy |
| 474 | ifneq ($$(ART_TEST_JNI_FORCECOPY),true) |
| 475 | skip_test := true |
| 476 | endif |
| 477 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 478 | ifeq ($(8),checkjni) |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 479 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 480 | run_test_options += --runtime-option -Xcheck:jni |
| 481 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 482 | ifeq ($(8),jni) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 483 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES |
| 484 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 485 | $$(error found $(8) expected $(JNI_TYPES)) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 486 | endif |
| 487 | endif |
| 488 | endif |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 489 | ifeq ($(9),no-image) |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 490 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES |
| 491 | run_test_options += --no-image |
| 492 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 493 | ifeq ($(9),image) |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 494 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES |
| 495 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 496 | $$(error found $(9) expected $(IMAGE_TYPES)) |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 497 | endif |
| 498 | endif |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 499 | # $(10) is the test name |
Nicolas Geoffray | f38b7dc | 2014-10-21 16:33:27 +0100 | [diff] [blame] | 500 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(10))_RULES |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 501 | ifeq ($(11),64) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 502 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES |
| 503 | run_test_options += --64 |
| 504 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 505 | ifeq ($(11),32) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 506 | test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES |
| 507 | else |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 508 | $$(error found $(11) expected $(ALL_ADDRESS_SIZES)) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 509 | endif |
| 510 | endif |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 511 | run_test_rule_name := test-art-$(1)-run-test-$(2)-$(3)-$(4)-$(5)-$(6)-$(7)-$(8)-$(9)-$(10)$(11) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 512 | 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] | 513 | $$(run_test_options) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 514 | $$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options) |
| 515 | .PHONY: $$(run_test_rule_name) |
Andreas Gampe | 8fda9f2 | 2014-10-03 16:15:37 -0700 | [diff] [blame] | 516 | $$(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] | 517 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
| 518 | DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \ |
Andreas Gampe | 8fda9f2 | 2014-10-03 16:15:37 -0700 | [diff] [blame] | 519 | SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \ |
| 520 | DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \ |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 521 | art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(10) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 522 | && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@) |
| 523 | $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \ |
| 524 | echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \ |
| 525 | rm -r $(ART_HOST_TEST_DIR)) || true |
| 526 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 527 | $$(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] | 528 | |
| 529 | # Clear locally defined variables. |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 530 | uc_host_or_target := |
| 531 | test_groups := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 532 | run_test_options := |
| 533 | run_test_rule_name := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 534 | prereq_rule := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 535 | endef # define-test-art-run-test |
| 536 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 537 | $(foreach target, $(TARGET_TYPES), \ |
| 538 | $(foreach test, $(TEST_ART_RUN_TESTS), \ |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 539 | $(foreach run_type, $(RUN_TYPES), \ |
| 540 | $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \ |
| 541 | $(foreach prebuild, $(PREBUILD_TYPES), \ |
| 542 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 543 | $(foreach relocate, $(RELOCATE_TYPES), \ |
| 544 | $(foreach trace, $(TRACE_TYPES), \ |
| 545 | $(foreach gc, $(GC_TYPES), \ |
| 546 | $(foreach jni, $(JNI_TYPES), \ |
| 547 | $(foreach image, $(IMAGE_TYPES), \ |
| 548 | $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(test),$(address_size))) \ |
| 549 | ))))))))))) |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 550 | define-test-art-run-test := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 551 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 552 | # Define a phony rule whose purpose is to test its prerequisites. |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 553 | # $(1): host or target |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 554 | # $(2): list of prerequisites |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 555 | define define-test-art-run-test-group |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 556 | .PHONY: $(1) |
| 557 | $(1): $(2) |
| 558 | $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 559 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 560 | endef # define-test-art-run-test-group |
| 561 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 562 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 563 | $(foreach target, $(TARGET_TYPES), $(eval \ |
| 564 | $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES)))) |
| 565 | $(foreach target, $(TARGET_TYPES), \ |
| 566 | $(foreach prebuild, $(PREBUILD_TYPES), $(eval \ |
| 567 | $(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))))) |
| 568 | $(foreach target, $(TARGET_TYPES), \ |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 569 | $(foreach run-type, $(RUN_TYPES), $(eval \ |
| 570 | $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(run-type),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run-type))_RULES))))) |
| 571 | $(foreach target, $(TARGET_TYPES), \ |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 572 | $(foreach compiler, $(COMPILER_TYPES), $(eval \ |
| 573 | $(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))))) |
| 574 | $(foreach target, $(TARGET_TYPES), \ |
| 575 | $(foreach relocate, $(RELOCATE_TYPES), $(eval \ |
| 576 | $(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))))) |
| 577 | $(foreach target, $(TARGET_TYPES), \ |
| 578 | $(foreach trace, $(TRACE_TYPES), $(eval \ |
| 579 | $(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))))) |
| 580 | $(foreach target, $(TARGET_TYPES), \ |
| 581 | $(foreach gc, $(GC_TYPES), $(eval \ |
| 582 | $(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))))) |
| 583 | $(foreach target, $(TARGET_TYPES), \ |
| 584 | $(foreach jni, $(JNI_TYPES), $(eval \ |
| 585 | $(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))))) |
| 586 | $(foreach target, $(TARGET_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 587 | $(foreach image, $(IMAGE_TYPES), $(eval \ |
| 588 | $(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))))) |
| 589 | $(foreach target, $(TARGET_TYPES), \ |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 590 | $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \ |
| 591 | $(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))))) |
| 592 | $(foreach target, $(TARGET_TYPES), \ |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 593 | $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \ |
Ian Rogers | a3cf6ce | 2014-10-02 16:35:52 -0700 | [diff] [blame] | 594 | $(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] | 595 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 596 | # Clear variables now we're finished with them. |
| 597 | $(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=)) |
| 598 | $(foreach target, $(TARGET_TYPES), \ |
| 599 | $(foreach prebuild, $(PREBUILD_TYPES), \ |
| 600 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=))) |
| 601 | $(foreach target, $(TARGET_TYPES), \ |
| 602 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 603 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=))) |
| 604 | $(foreach target, $(TARGET_TYPES), \ |
| 605 | $(foreach relocate, $(RELOCATE_TYPES), \ |
| 606 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=))) |
| 607 | $(foreach target, $(TARGET_TYPES), \ |
| 608 | $(foreach trace, $(TRACE_TYPES), \ |
| 609 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=))) |
| 610 | $(foreach target, $(TARGET_TYPES), \ |
| 611 | $(foreach gc, $(GC_TYPES), \ |
| 612 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=))) |
| 613 | $(foreach target, $(TARGET_TYPES), \ |
| 614 | $(foreach jni, $(JNI_TYPES), \ |
| 615 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=))) |
| 616 | $(foreach target, $(TARGET_TYPES), \ |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 617 | $(foreach image, $(IMAGE_TYPES), \ |
| 618 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=))) |
| 619 | $(foreach target, $(TARGET_TYPES), \ |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 620 | $(foreach test, $(TEST_ART_RUN_TESTS), \ |
| 621 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=))) |
| 622 | $(foreach target, $(TARGET_TYPES), \ |
| 623 | $(foreach address_size, $(ALL_ADDRESS_SIZES), \ |
| 624 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=))) |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 625 | $(foreach target, $(TARGET_TYPES), \ |
| 626 | $(foreach run_type, $(RUN_TYPES), \ |
| 627 | $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 628 | define-test-art-run-test-group := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 629 | TARGET_TYPES := |
| 630 | PREBUILD_TYPES := |
| 631 | COMPILER_TYPES := |
| 632 | RELOCATE_TYPES := |
| 633 | TRACE_TYPES := |
| 634 | GC_TYPES := |
| 635 | JNI_TYPES := |
Alex Light | 03a112d | 2014-08-25 13:25:56 -0700 | [diff] [blame] | 636 | IMAGE_TYPES := |
Ian Rogers | 86df3ac | 2014-08-27 10:54:11 -0700 | [diff] [blame] | 637 | ADDRESS_SIZES_TARGET := |
| 638 | ADDRESS_SIZES_HOST := |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 639 | ALL_ADDRESS_SIZES := |
Nicolas Geoffray | bd2c63c | 2014-10-16 18:04:12 +0100 | [diff] [blame] | 640 | RUN_TYPES := |
Ian Rogers | 9fcaa4b | 2014-08-26 19:59:52 -0700 | [diff] [blame] | 641 | |
| 642 | include $(LOCAL_PATH)/Android.libarttest.mk |
| 643 | include art/test/Android.libnativebridgetest.mk |