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