blob: 6c2ce6256a09432bc4e91b2ebafe410c336c1ce0 [file] [log] [blame]
Ian Rogersafd9acc2014-06-17 08:21:54 -07001# 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
16LOCAL_PATH := $(call my-dir)
17
18include art/build/Android.common_test.mk
19
20# List of all tests of the form 003-omnibus-opcodes.
21TEST_ART_RUN_TESTS := $(wildcard $(LOCAL_PATH)/[0-9]*)
22TEST_ART_RUN_TESTS := $(subst $(LOCAL_PATH)/,, $(TEST_ART_RUN_TESTS))
23
Ian Rogersf5c44b32014-08-19 16:52:36 -070024########################################################################
25# The art-run-tests module, used to build all run-tests into an image.
Alex Light9dcc4572014-08-14 14:16:26 -070026
Ian Rogersafd9acc2014-06-17 08:21:54 -070027# 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
29art_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.
33TEST_ART_RUN_TEST_BUILD_RULES :=
34
Nicolas Geoffray07f2bc12015-05-29 13:40:25 +010035# Dependencies for actually running a run-test.
36TEST_ART_RUN_TEST_DEPENDENCIES := $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $(HOST_OUT_EXECUTABLES)/smali $(HOST_OUT_EXECUTABLES)/dexmerger
37
Ian Rogersafd9acc2014-06-17 08:21:54 -070038# Helper to create individual build targets for tests. Must be called with $(eval).
39# $(1): the test number
40define define-build-art-run-test
41 dmart_target := $(art_run_tests_dir)/art-run-tests/$(1)/touch
Nicolas Geoffray07f2bc12015-05-29 13:40:25 +010042$$(dmart_target): $(TEST_ART_RUN_TEST_DEPENDENCIES)
Ian Rogersafd9acc2014-06-17 08:21:54 -070043 $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@)
44 $(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -070045 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
46 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Ian Rogersafd9acc2014-06-17 08:21:54 -070047 $(LOCAL_PATH)/run-test --build-only --output-path $$(abspath $$(dir $$@)) $(1)
48 $(hide) touch $$@
49
50 TEST_ART_RUN_TEST_BUILD_RULES += $$(dmart_target)
51 dmart_target :=
52endef
Ian Rogersbf66bce2014-06-24 23:15:34 -070053$(foreach test, $(TEST_ART_RUN_TESTS), $(eval $(call define-build-art-run-test,$(test))))
Ian Rogersafd9acc2014-06-17 08:21:54 -070054
55include $(CLEAR_VARS)
56LOCAL_MODULE_TAGS := tests
57LOCAL_MODULE := art-run-tests
Ian Rogersabbf2422014-10-15 11:57:01 -070058LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES)
Ian Rogersafd9acc2014-06-17 08:21:54 -070059# The build system use this flag to pick up files generated by declare-make-art-run-test.
60LOCAL_PICKUP_FILES := $(art_run_tests_dir)
61
62include $(BUILD_PHONY_PACKAGE)
63
64# Clear temp vars.
Ian Rogersafd9acc2014-06-17 08:21:54 -070065art_run_tests_dir :=
66define-build-art-run-test :=
Ian Rogers8a14b752014-07-18 15:06:53 -070067TEST_ART_RUN_TEST_BUILD_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -070068
69########################################################################
Ian Rogersf5c44b32014-08-19 16:52:36 -070070# General rules to build and run a run-test.
Ian Rogersafd9acc2014-06-17 08:21:54 -070071
Ian Rogersf5c44b32014-08-19 16:52:36 -070072TARGET_TYPES := host target
Nicolas Geoffray41bb3312014-10-24 13:49:08 +010073PREBUILD_TYPES :=
74ifeq ($(ART_TEST_RUN_TEST_PREBUILD),true)
75 PREBUILD_TYPES += prebuild
76endif
Ian Rogers86df3ac2014-08-27 10:54:11 -070077ifeq ($(ART_TEST_RUN_TEST_NO_PREBUILD),true)
78 PREBUILD_TYPES += no-prebuild
79endif
80ifeq ($(ART_TEST_RUN_TEST_NO_DEX2OAT),true)
81 PREBUILD_TYPES += no-dex2oat
82endif
83COMPILER_TYPES :=
84ifeq ($(ART_TEST_DEFAULT_COMPILER),true)
85 COMPILER_TYPES += default
86endif
87ifeq ($(ART_TEST_INTERPRETER),true)
88 COMPILER_TYPES += interpreter
89endif
Mathieu Chartiere5f13e52015-02-24 09:37:21 -080090ifeq ($(ART_TEST_JIT),true)
91 COMPILER_TYPES += jit
92endif
Ian Rogers86df3ac2014-08-27 10:54:11 -070093ifeq ($(ART_TEST_OPTIMIZING),true)
94 COMPILER_TYPES += optimizing
95endif
96RELOCATE_TYPES := relocate
97ifeq ($(ART_TEST_RUN_TEST_NO_RELOCATE),true)
98 RELOCATE_TYPES += no-relocate
99endif
100ifeq ($(ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT),true)
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700101 RELOCATE_TYPES += relocate-npatchoat
Ian Rogers86df3ac2014-08-27 10:54:11 -0700102endif
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700103TRACE_TYPES := ntrace
Ian Rogers86df3ac2014-08-27 10:54:11 -0700104ifeq ($(ART_TEST_TRACE),true)
105 TRACE_TYPES += trace
106endif
Andreas Gampe7526d782015-06-22 22:53:45 -0700107ifeq ($(ART_TEST_TRACE_STREAM),true)
108 TRACE_TYPES += stream
109endif
Ian Rogers86df3ac2014-08-27 10:54:11 -0700110GC_TYPES := cms
Alex Light992f1e72014-08-27 16:08:57 -0700111ifeq ($(ART_TEST_GC_STRESS),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700112 GC_TYPES += gcstress
113endif
Alex Light992f1e72014-08-27 16:08:57 -0700114ifeq ($(ART_TEST_GC_VERIFY),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700115 GC_TYPES += gcverify
116endif
117JNI_TYPES := checkjni
118ifeq ($(ART_TEST_JNI_FORCECOPY),true)
119 JNI_TYPES += forcecopy
120endif
121IMAGE_TYPES := image
122ifeq ($(ART_TEST_RUN_TEST_NO_IMAGE),true)
123 IMAGE_TYPES += no-image
124endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700125ifeq ($(ART_TEST_PIC_IMAGE),true)
126 IMAGE_TYPES += picimage
127endif
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700128PICTEST_TYPES := npictest
Andreas Gampec23c9c92014-10-28 14:47:25 -0700129ifeq ($(ART_TEST_PIC_TEST),true)
130 PICTEST_TYPES += pictest
131endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100132RUN_TYPES :=
133ifeq ($(ART_TEST_RUN_TEST_DEBUG),true)
134 RUN_TYPES += debug
135endif
136ifeq ($(ART_TEST_RUN_TEST_NDEBUG),true)
137 RUN_TYPES += ndebug
138endif
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700139DEBUGGABLE_TYPES := ndebuggable
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000140ifeq ($(ART_TEST_RUN_TEST_DEBUGGABLE),true)
141DEBUGGABLE_TYPES += debuggable
142endif
Nicolas Geoffray41bb3312014-10-24 13:49:08 +0100143ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX)
144ADDRESS_SIZES_HOST := $(ART_PHONY_TEST_HOST_SUFFIX)
145ifeq ($(ART_TEST_RUN_TEST_2ND_ARCH),true)
146 ADDRESS_SIZES_TARGET += $(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
147 ADDRESS_SIZES_HOST += $(2ND_ART_PHONY_TEST_HOST_SUFFIX)
148endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700149ALL_ADDRESS_SIZES := 64 32
Ian Rogers86df3ac2014-08-27 10:54:11 -0700150
Ian Rogersf5c44b32014-08-19 16:52:36 -0700151# List all run test names with number arguments agreeing with the comment above.
152define all-run-test-names
153 $(foreach target, $(1), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100154 $(foreach run-type, $(2), \
155 $(foreach prebuild, $(3), \
156 $(foreach compiler, $(4), \
157 $(foreach relocate, $(5), \
158 $(foreach trace, $(6), \
159 $(foreach gc, $(7), \
160 $(foreach jni, $(8), \
161 $(foreach image, $(9), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700162 $(foreach pictest, $(10), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000163 $(foreach debuggable, $(11), \
164 $(foreach test, $(12), \
165 $(foreach address_size, $(13), \
166 test-art-$(target)-run-test-$(run-type)-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(image)-$(pictest)-$(debuggable)-$(test)$(address_size) \
167 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700168endef # all-run-test-names
169
170# To generate a full list or tests:
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100171# $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700172# $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000173# $(DEBUGGABLE_TYPES) $(TEST_ART_RUN_TESTS), $(ALL_ADDRESS_SIZES)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700174
175# Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE
176define name-to-var
177$(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
178endef # name-to-var
179
180# Tests that are timing sensitive and flaky on heavily loaded systems.
181TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \
182 053-wait-some \
Mathieu Chartiere4a91bb2015-01-28 13:11:44 -0800183 055-enum-performance \
184 133-static-invoke-super
Ian Rogersf5c44b32014-08-19 16:52:36 -0700185
186 # disable timing sensitive tests on "dist" builds.
187ifdef dist_goal
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100188 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700189 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000190 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700191endif
192
Ian Rogers86df3ac2014-08-27 10:54:11 -0700193TEST_ART_TIMING_SENSITIVE_RUN_TESTS :=
194
Ian Rogers40e19122014-09-02 15:59:28 -0700195# Note 116-nodex2oat is not broken per-se it just doesn't (and isn't meant to) work with --prebuild.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700196TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \
Andreas Gampe3ad5d5e2015-02-03 18:26:55 -0800197 116-nodex2oat \
Jean Christophe Beyler24e04aa2014-09-12 12:03:25 -0700198 118-noimage-dex2oat \
199 134-nodex2oat-nofallback
Ian Rogersf5c44b32014-08-19 16:52:36 -0700200
Ian Rogers40e19122014-09-02 15:59:28 -0700201ifneq (,$(filter prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100202 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700203 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000204 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700205endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700206
Ian Rogers86df3ac2014-08-27 10:54:11 -0700207TEST_ART_BROKEN_PREBUILD_RUN_TESTS :=
208
Ian Rogersf5c44b32014-08-19 16:52:36 -0700209TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
210 117-nopatchoat
211
Ian Rogers40e19122014-09-02 15:59:28 -0700212ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100213 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700214 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000215 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700216endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700217
Ian Rogers86df3ac2014-08-27 10:54:11 -0700218TEST_ART_BROKEN_NO_PREBUILD_TESTS :=
219
Ian Rogers40e19122014-09-02 15:59:28 -0700220# Note 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without
221# --prebuild --relocate
222TEST_ART_BROKEN_NO_RELOCATE_TESTS := \
Andreas Gampe3ad5d5e2015-02-03 18:26:55 -0800223 117-nopatchoat \
224 118-noimage-dex2oat \
225 119-noimage-patchoat
Ian Rogers40e19122014-09-02 15:59:28 -0700226
227ifneq (,$(filter no-relocate,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100228 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700229 $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000230 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700231endif
232
233TEST_ART_BROKEN_NO_RELOCATE_TESTS :=
234
Man Cao1ed11b92015-06-11 22:47:35 -0700235# Tests that are broken with GC stress.
Man Cao42c3c332015-06-23 16:38:25 -0700236TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
Man Cao1ed11b92015-06-11 22:47:35 -0700237
238ifneq (,$(filter gcstress,$(GC_TYPES)))
239 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
240 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
241 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
242endif
243
244TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
Ian Rogers40e19122014-09-02 15:59:28 -0700245
Ian Rogersf5c44b32014-08-19 16:52:36 -0700246# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100247ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000248 $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), 115-native-bridge, \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700249 $(ALL_ADDRESS_SIZES))
250
Andreas Gampe3a913092015-01-10 00:26:17 -0800251# 130-hprof dumps the heap and runs hprof-conv to check whether the file is somewhat readable. This
252# is only possible on the host.
253# TODO: Turn off all the other combinations, this is more about testing actual ART code. A gtest is
254# very hard to write here, as (for a complete test) JDWP must be set up.
255ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
256 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000257 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),130-hprof,$(ALL_ADDRESS_SIZES))
Andreas Gampe3a913092015-01-10 00:26:17 -0800258
Andreas Gampe94329d32015-04-24 20:22:06 -0700259# 131 is an old test. The functionality has been implemented at an earlier stage and is checked
260# in tests 138.
261ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
262 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
263 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),131-structural-change,$(ALL_ADDRESS_SIZES))
264
Andreas Gampe69b5d8f2015-06-03 15:43:16 -0700265# 138-duplicate-classes-check. Turned off temporarily, b/21333911.
266ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
267 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
268 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),138-duplicate-classes-check,$(ALL_ADDRESS_SIZES))
269
Alex Light03a112d2014-08-25 13:25:56 -0700270# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
271# Therefore we shouldn't run them in situations where we actually don't have these since they
272# explicitly test for them. These all also assume we have an image.
273TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
274 116-nodex2oat \
275 117-nopatchoat \
276 118-noimage-dex2oat \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700277 119-noimage-patchoat \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700278 137-cfi \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700279 138-duplicate-classes-check2
280
281# This test fails without an image.
282TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS := \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700283 137-cfi \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700284 138-duplicate-classes-check
Alex Light03a112d2014-08-25 13:25:56 -0700285
Ian Rogers40e19122014-09-02 15:59:28 -0700286ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100287 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
Ian Rogers40e19122014-09-02 15:59:28 -0700288 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000289 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700290endif
Alex Light03a112d2014-08-25 13:25:56 -0700291
Alex Light03a112d2014-08-25 13:25:56 -0700292
Ian Rogers40e19122014-09-02 15:59:28 -0700293ifneq (,$(filter no-image,$(IMAGE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100294 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700295 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000296 $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700297 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
298 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
299 $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700300endif
301
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700302ifneq (,$(filter relocate-npatchoat,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100303 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700304 $(COMPILER_TYPES), relocate-npatchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000305 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700306endif
Alex Light03a112d2014-08-25 13:25:56 -0700307
Ian Rogers86df3ac2014-08-27 10:54:11 -0700308TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
309
Andreas Gampee1bbed22015-05-20 13:55:00 -0700310# 137:
311# This test unrolls and expects managed frames, but tracing means we run the interpreter.
312# 802:
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800313# This test dynamically enables tracing to force a deoptimization. This makes the test meaningless
314# when already tracing, and writes an error message that we do not want to check for.
315TEST_ART_BROKEN_TRACING_RUN_TESTS := \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700316 137-cfi \
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800317 802-deoptimization
318
Andreas Gampe7526d782015-06-22 22:53:45 -0700319ifneq (,$(filter trace stream,$(TRACE_TYPES)))
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800320 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Andreas Gampe7526d782015-06-22 22:53:45 -0700321 $(COMPILER_TYPES),$(RELOCATE_TYPES),trace stream,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000322 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800323endif
324
325TEST_ART_BROKEN_TRACING_RUN_TESTS :=
326
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100327# The following tests use libarttest.so, which is linked against libartd.so, so will
328# not work when libart.so is the one loaded.
329# TODO: Find a way to run these tests in ndebug mode.
330TEST_ART_BROKEN_NDEBUG_TESTS := \
331 004-JniTest \
332 004-ReferenceMap \
333 004-SignalTest \
334 004-StackWalk \
335 004-UnsafeTest \
Nicolas Geoffray64dea7e2014-11-07 14:32:42 +0000336 051-thread \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100337 115-native-bridge \
338 116-nodex2oat \
339 117-nopatchoat \
340 118-noimage-dex2oat \
341 119-noimage-patchoat \
Nicolas Geoffray8c9200a2015-01-15 08:42:47 +0000342 131-structural-change \
Andreas Gampe73810102015-04-22 18:57:06 -0700343 137-cfi \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700344 139-register-natives \
Nicolas Geoffrayd845fd02015-03-03 12:43:45 +0000345 454-get-vreg \
346 455-set-vreg \
Nicolas Geoffray64d69ab2015-03-10 19:26:24 +0000347 457-regs \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +0000348 461-get-reference-vreg \
Nicolas Geoffrayd8126be2015-03-27 10:22:41 +0000349 466-get-live-vreg \
Nicolas Geoffray32c9ea52015-06-12 14:52:33 +0100350 497-inlining-and-class-loader \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100351
352ifneq (,$(filter ndebug,$(RUN_TYPES)))
353 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
354 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000355 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100356endif
357
358TEST_ART_BROKEN_NDEBUG_TESTS :=
359
Andreas Gampee1bbed22015-05-20 13:55:00 -0700360# Known broken tests for the interpreter.
361# CFI unwinding expects managed frames.
362TEST_ART_BROKEN_INTERPRETER_RUN_TESTS := \
363 137-cfi
364
365ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
366 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
367 interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
368 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_INTERPRETER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
369endif
370
371TEST_ART_BROKEN_INTERPRETER_RUN_TESTS :=
372
Andreas Gampeaab9f732015-05-20 14:50:06 -0700373# Known broken tests for the JIT.
374# CFI unwinding expects managed frames, and the test does not iterate enough to even compile. JIT
375# also uses Generic JNI instead of the JNI compiler.
376TEST_ART_BROKEN_JIT_RUN_TESTS := \
377 137-cfi
378
379ifneq (,$(filter jit,$(COMPILER_TYPES)))
380 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
381 jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
382 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_JIT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
383endif
384
385TEST_ART_BROKEN_JIT_RUN_TESTS :=
386
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100387# Known broken tests for the default compiler (Quick).
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000388TEST_ART_BROKEN_DEFAULT_RUN_TESTS := \
Vladimir Marko07785bb2015-06-15 18:52:54 +0100389 457-regs
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100390
391ifneq (,$(filter default,$(COMPILER_TYPES)))
392 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Nicolas Geoffray83cae422014-10-22 15:08:03 +0100393 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000394 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100395endif
396
397TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
398
Alexandre Rames5319def2014-10-23 10:03:10 +0100399# Known broken tests for the arm64 optimizing compiler backend.
Serban Constantinescu02d81cc2015-01-05 16:08:49 +0000400TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100401
402ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
403 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
404 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000405 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS),64)
Alexandre Rames5319def2014-10-23 10:03:10 +0100406endif
407
408TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
409
Alexey Frunze4dda3372015-06-01 18:31:49 -0700410# Known broken tests for the MIPS64 optimizing compiler backend in 64-bit mode. b/21555893
411TEST_ART_BROKEN_OPTIMIZING_MIPS64_64BIT_RUN_TESTS := \
412 004-SignalTest \
413 018-stack-overflow \
414 107-int-math2 \
415 449-checker-bce
416
417ifeq ($(TARGET_ARCH),mips64)
418 ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
419 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
420 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
421 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_MIPS64_64BIT_RUN_TESTS),64)
422 endif
423endif
424
425TEST_ART_BROKEN_OPTIMIZING_MIPS64_64BIT_RUN_TESTS :=
426
427# Known broken tests for the MIPS64 optimizing compiler backend in 32-bit mode. b/21555893
428TEST_ART_BROKEN_OPTIMIZING_MIPS64_32BIT_RUN_TESTS := \
429 496-checker-inlining-and-class-loader
430
431ifeq ($(TARGET_ARCH),mips64)
432 ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
433 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
434 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
435 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_MIPS64_32BIT_RUN_TESTS),32)
436 endif
437endif
438
439TEST_ART_BROKEN_OPTIMIZING_MIPS64_32BIT_RUN_TESTS :=
440
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100441# Known broken tests for the optimizing compiler.
Nicolas Geoffrayaa8dd2f2015-01-23 17:48:28 +0000442TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100443
444ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
445 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
446 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000447 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100448endif
449
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000450# If ART_USE_OPTIMIZING_COMPILER is set to true, then the default core.art has been
451# compiled with the optimizing compiler.
452ifeq ($(ART_USE_OPTIMIZING_COMPILER),true)
453 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
454 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000455 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000456endif
457
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100458TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
459
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000460# Tests that should fail when the optimizing compiler compiles them non-debuggable.
461TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS := \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +0000462 454-get-vreg \
463 455-set-vreg \
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000464 457-regs \
465
466ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
467 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
468 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700469 $(IMAGE_TYPES),$(PICTEST_TYPES),ndebuggable,$(TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000470endif
471
472TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
473
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000474# Tests that should fail when the optimizing compiler compiles them debuggable.
475TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS := \
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000476
477ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
478 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
479 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
480 $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
481endif
482
483TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
484
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700485# Tests that should fail in the read barrier configuration.
Andreas Gampee1bbed22015-05-20 13:55:00 -0700486# 137: Read barrier forces interpreter. Cannot run this with the interpreter.
487TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS := \
488 137-cfi
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700489
490ifeq ($(ART_USE_READ_BARRIER),true)
491 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
492 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
493 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
494endif
495
496TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100497
Andreas Gampe44372192015-05-21 10:01:42 -0700498# Tests that should fail in the heap poisoning configuration.
499# 137: Heap poisoning forces interpreter. Cannot run this with the interpreter.
500TEST_ART_BROKEN_HEAP_POISONING_RUN_TESTS := \
501 137-cfi
502
503ifeq ($(ART_HEAP_POISONING),true)
504 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
505 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
506 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
507endif
508
509TEST_ART_BROKEN_HEAP_POISONING_RUN_TESTS :=
510
Ian Rogersf5c44b32014-08-19 16:52:36 -0700511# Clear variables ahead of appending to them when defining tests.
512$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
513$(foreach target, $(TARGET_TYPES), \
514 $(foreach prebuild, $(PREBUILD_TYPES), \
515 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
516$(foreach target, $(TARGET_TYPES), \
517 $(foreach compiler, $(COMPILER_TYPES), \
518 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
519$(foreach target, $(TARGET_TYPES), \
520 $(foreach relocate, $(RELOCATE_TYPES), \
521 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
522$(foreach target, $(TARGET_TYPES), \
523 $(foreach trace, $(TRACE_TYPES), \
524 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
525$(foreach target, $(TARGET_TYPES), \
526 $(foreach gc, $(GC_TYPES), \
527 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
528$(foreach target, $(TARGET_TYPES), \
529 $(foreach jni, $(JNI_TYPES), \
530 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
531$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700532 $(foreach image, $(IMAGE_TYPES), \
533 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
534$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700535 $(foreach test, $(TEST_ART_RUN_TESTS), \
536 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
537$(foreach target, $(TARGET_TYPES), \
538 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
539 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100540$(foreach target, $(TARGET_TYPES), \
541 $(foreach run_type, $(RUN_TYPES), \
542 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000543$(foreach target, $(TARGET_TYPES), \
544 $(foreach debuggable_type, $(DEBUGGABLE_TYPES), \
545 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700546
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700547# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
548# only once).
549TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700550
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700551# Also need libarttest.
552TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
553ifdef TARGET_2ND_ARCH
554TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
555endif
556
Andreas Gampe855564b2014-07-25 02:32:19 -0700557# Also need libnativebridgetest.
558TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
559ifdef TARGET_2ND_ARCH
560TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
561endif
562
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700563# All tests require the host executables. The tests also depend on the core images, but on
564# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700565ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
566 $(ART_HOST_EXECUTABLES) \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700567 $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700568 $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700569 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700570
571ifneq ($(HOST_PREFER_32_BIT),true)
572ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700573 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700574 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700575 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700576endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700577
Ian Rogersf5c44b32014-08-19 16:52:36 -0700578# Create a rule to build and run a tests following the form:
Calin Juravle9228b2a2014-10-22 15:54:34 +0100579# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700580# {4: interpreter default optimizing jit}-{5: relocate nrelocate relocate-npatchoat}-
581# {6: trace or ntrace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
582# {9: no-image image picimage}-{10: pictest npictest}-
583# {11: ndebuggable debuggable}-{12: test name}{13: 32 or 64}
Ian Rogersafd9acc2014-06-17 08:21:54 -0700584define define-test-art-run-test
Nicolas Geoffray611e1db2014-10-09 17:34:45 +0100585 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700586 prereq_rule :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700587 test_groups :=
588 uc_host_or_target :=
Alex Lightbfac14a2014-07-30 09:41:21 -0700589 ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
590 run_test_options += --always-clean
591 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700592 ifeq ($(1),host)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700593 uc_host_or_target := HOST
Ian Rogersf5c44b32014-08-19 16:52:36 -0700594 test_groups := ART_RUN_TEST_HOST_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700595 run_test_options += --host
596 prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
597 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700598 ifeq ($(1),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700599 uc_host_or_target := TARGET
Ian Rogersf5c44b32014-08-19 16:52:36 -0700600 test_groups := ART_RUN_TEST_TARGET_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700601 prereq_rule := test-art-target-sync
602 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700603 $$(error found $(1) expected $(TARGET_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700604 endif
605 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100606 ifeq ($(2),debug)
607 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
608 else
609 ifeq ($(2),ndebug)
610 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
611 run_test_options += -O
612 else
613 $$(error found $(2) expected $(RUN_TYPES))
614 endif
615 endif
616 ifeq ($(3),prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700617 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
618 run_test_options += --prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700619 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100620 ifeq ($(3),no-prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700621 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
622 run_test_options += --no-prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700623 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100624 ifeq ($(3),no-dex2oat)
Alex Light03a112d2014-08-25 13:25:56 -0700625 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
626 run_test_options += --no-prebuild --no-dex2oat
627 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100628 $$(error found $(3) expected $(PREBUILD_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700629 endif
Alex Lighta59dd802014-07-02 16:28:08 -0700630 endif
631 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100632 ifeq ($(4),optimizing)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700633 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700634 run_test_options += --optimizing
Ian Rogersafd9acc2014-06-17 08:21:54 -0700635 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100636 ifeq ($(4),interpreter)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700637 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700638 run_test_options += --interpreter
639 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100640 ifeq ($(4),default)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700641 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
Nicolas Geoffrayc9338b92014-12-03 13:36:10 +0000642 run_test_options += --quick
Ian Rogersafd9acc2014-06-17 08:21:54 -0700643 else
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800644 ifeq ($(4),jit)
Mathieu Chartier3fc1b122015-02-26 10:58:08 -0800645 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JIT_RULES
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800646 run_test_options += --jit
647 else
648 $$(error found $(4) expected $(COMPILER_TYPES))
649 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700650 endif
651 endif
652 endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700653
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100654 ifeq ($(5),relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700655 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
656 run_test_options += --relocate
Ian Rogersafd9acc2014-06-17 08:21:54 -0700657 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100658 ifeq ($(5),no-relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700659 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
660 run_test_options += --no-relocate
661 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700662 ifeq ($(5),relocate-npatchoat)
Alex Light03a112d2014-08-25 13:25:56 -0700663 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
664 run_test_options += --relocate --no-patchoat
665 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100666 $$(error found $(5) expected $(RELOCATE_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700667 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700668 endif
669 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100670 ifeq ($(6),trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700671 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
Ian Rogers716e4f82014-07-16 11:18:03 -0700672 run_test_options += --trace
Ian Rogers716e4f82014-07-16 11:18:03 -0700673 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700674 ifeq ($(6),ntrace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700675 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
Ian Rogers701aa642014-07-18 11:38:13 -0700676 else
Andreas Gampe7526d782015-06-22 22:53:45 -0700677 ifeq ($(6),stream)
678 # Group streaming under normal tracing rules.
679 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
680 run_test_options += --trace --stream
681 else
682 $$(error found $(6) expected $(TRACE_TYPES))
683 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700684 endif
685 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100686 ifeq ($(7),gcverify)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700687 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700688 run_test_options += --gcverify
689 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100690 ifeq ($(7),gcstress)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700691 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700692 run_test_options += --gcstress
693 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100694 ifeq ($(7),cms)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700695 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
Ian Rogers8a14b752014-07-18 15:06:53 -0700696 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100697 $$(error found $(7) expected $(GC_TYPES))
Ian Rogers701aa642014-07-18 11:38:13 -0700698 endif
Ian Rogers716e4f82014-07-16 11:18:03 -0700699 endif
700 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100701 ifeq ($(8),forcecopy)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700702 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700703 run_test_options += --runtime-option -Xjniopts:forcecopy
704 ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
705 skip_test := true
706 endif
707 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100708 ifeq ($(8),checkjni)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700709 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700710 run_test_options += --runtime-option -Xcheck:jni
711 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100712 ifeq ($(8),jni)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700713 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
714 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100715 $$(error found $(8) expected $(JNI_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700716 endif
717 endif
718 endif
Mathieu Chartiere2a12c02015-02-27 13:21:15 -0800719 ifeq ($(4),jit)
720 # Use interpreter image for JIT.
721 image_suffix := interpreter
722 else
723 image_suffix := $(4)
724 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100725 ifeq ($(9),no-image)
Alex Light03a112d2014-08-25 13:25:56 -0700726 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
727 run_test_options += --no-image
Andreas Gampebf03e842014-10-29 20:46:17 -0700728 # Add the core dependency. This is required for pre-building.
729 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000730 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700731 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000732 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700733 endif
Alex Light03a112d2014-08-25 13:25:56 -0700734 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100735 ifeq ($(9),image)
Alex Light03a112d2014-08-25 13:25:56 -0700736 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
Andreas Gampec23c9c92014-10-28 14:47:25 -0700737 # Add the core dependency.
738 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000739 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700740 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000741 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700742 endif
Alex Light03a112d2014-08-25 13:25:56 -0700743 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700744 ifeq ($(9),picimage)
745 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
746 run_test_options += --pic-image
747 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000748 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700749 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000750 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700751 endif
752 else
753 $$(error found $(9) expected $(IMAGE_TYPES))
754 endif
Alex Light03a112d2014-08-25 13:25:56 -0700755 endif
756 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700757 ifeq ($(10),pictest)
758 run_test_options += --pic-test
759 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700760 ifeq ($(10),npictest)
Andreas Gampec23c9c92014-10-28 14:47:25 -0700761 # Nothing to be done.
762 else
763 $$(error found $(10) expected $(PICTEST_TYPES))
764 endif
765 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000766 ifeq ($(11),debuggable)
767 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUGGABLE_RULES
768 run_test_options += --debuggable
769 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700770 ifeq ($(11),ndebuggable)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000771 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NONDEBUGGABLE_RULES
772 # Nothing to be done.
773 else
774 $$(error found $(11) expected $(DEBUGGABLE_TYPES))
775 endif
776 endif
777 # $(12) is the test name.
778 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(12))_RULES
779 ifeq ($(13),64)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700780 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
781 run_test_options += --64
782 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000783 ifeq ($(13),32)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700784 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
785 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000786 $$(error found $(13) expected $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700787 endif
788 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000789 run_test_rule_name := test-art-$(1)-run-test-$(2)-$(3)-$(4)-$(5)-$(6)-$(7)-$(8)-$(9)-$(10)-$(11)-$(12)$(13)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700790 run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
Ian Rogers5242c0a2014-07-18 11:02:19 -0700791 $$(run_test_options)
Nicolas Geoffrayc8f23fc2014-10-28 17:59:47 +0000792 ifneq ($(ART_TEST_ANDROID_ROOT),)
793 run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
794 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700795$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
796.PHONY: $$(run_test_rule_name)
Andreas Gampe3a913092015-01-10 00:26:17 -0800797$$(run_test_rule_name): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $(HOST_OUT_EXECUTABLES)/smali $(HOST_OUT_EXECUTABLES)/dexmerger $(HOST_OUT_EXECUTABLES)/hprof-conv $$(prereq_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700798 $(hide) $$(call ART_TEST_SKIP,$$@) && \
799 DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700800 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
801 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000802 art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(12) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700803 && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
804 $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
805 echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
806 rm -r $(ART_HOST_TEST_DIR)) || true
807
Ian Rogersf5c44b32014-08-19 16:52:36 -0700808 $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700809
810 # Clear locally defined variables.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700811 uc_host_or_target :=
812 test_groups :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700813 run_test_options :=
814 run_test_rule_name :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700815 prereq_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700816endef # define-test-art-run-test
817
Ian Rogersf5c44b32014-08-19 16:52:36 -0700818$(foreach target, $(TARGET_TYPES), \
819 $(foreach test, $(TEST_ART_RUN_TESTS), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100820 $(foreach run_type, $(RUN_TYPES), \
821 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
822 $(foreach prebuild, $(PREBUILD_TYPES), \
823 $(foreach compiler, $(COMPILER_TYPES), \
824 $(foreach relocate, $(RELOCATE_TYPES), \
825 $(foreach trace, $(TRACE_TYPES), \
826 $(foreach gc, $(GC_TYPES), \
827 $(foreach jni, $(JNI_TYPES), \
828 $(foreach image, $(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700829 $(foreach pictest, $(PICTEST_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000830 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
831 $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(debuggable),$(test),$(address_size))) \
832 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700833define-test-art-run-test :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700834
Ian Rogersafd9acc2014-06-17 08:21:54 -0700835# Define a phony rule whose purpose is to test its prerequisites.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700836# $(1): host or target
Ian Rogersafd9acc2014-06-17 08:21:54 -0700837# $(2): list of prerequisites
Ian Rogersf5c44b32014-08-19 16:52:36 -0700838define define-test-art-run-test-group
Ian Rogersafd9acc2014-06-17 08:21:54 -0700839.PHONY: $(1)
840$(1): $(2)
841 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
842
Ian Rogersafd9acc2014-06-17 08:21:54 -0700843endef # define-test-art-run-test-group
844
Ian Rogersafd9acc2014-06-17 08:21:54 -0700845
Ian Rogersf5c44b32014-08-19 16:52:36 -0700846$(foreach target, $(TARGET_TYPES), $(eval \
847 $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
848$(foreach target, $(TARGET_TYPES), \
849 $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
850 $(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)))))
851$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100852 $(foreach run-type, $(RUN_TYPES), $(eval \
853 $(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)))))
854$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700855 $(foreach compiler, $(COMPILER_TYPES), $(eval \
856 $(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)))))
857$(foreach target, $(TARGET_TYPES), \
858 $(foreach relocate, $(RELOCATE_TYPES), $(eval \
859 $(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)))))
860$(foreach target, $(TARGET_TYPES), \
861 $(foreach trace, $(TRACE_TYPES), $(eval \
862 $(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)))))
863$(foreach target, $(TARGET_TYPES), \
864 $(foreach gc, $(GC_TYPES), $(eval \
865 $(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)))))
866$(foreach target, $(TARGET_TYPES), \
867 $(foreach jni, $(JNI_TYPES), $(eval \
868 $(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)))))
869$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000870 $(foreach debuggable, $(DEBUGGABLE_TYPES), $(eval \
871 $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(debuggable),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES)))))
872$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700873 $(foreach image, $(IMAGE_TYPES), $(eval \
874 $(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)))))
875$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700876 $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
877 $(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)))))
878$(foreach target, $(TARGET_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700879 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
Ian Rogersa3cf6ce2014-10-02 16:35:52 -0700880 $(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 Rogersafd9acc2014-06-17 08:21:54 -0700881
Ian Rogersf5c44b32014-08-19 16:52:36 -0700882# Clear variables now we're finished with them.
883$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
884$(foreach target, $(TARGET_TYPES), \
885 $(foreach prebuild, $(PREBUILD_TYPES), \
886 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
887$(foreach target, $(TARGET_TYPES), \
888 $(foreach compiler, $(COMPILER_TYPES), \
889 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
890$(foreach target, $(TARGET_TYPES), \
891 $(foreach relocate, $(RELOCATE_TYPES), \
892 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
893$(foreach target, $(TARGET_TYPES), \
894 $(foreach trace, $(TRACE_TYPES), \
895 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
896$(foreach target, $(TARGET_TYPES), \
897 $(foreach gc, $(GC_TYPES), \
898 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
899$(foreach target, $(TARGET_TYPES), \
900 $(foreach jni, $(JNI_TYPES), \
901 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
902$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000903 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
904 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES :=)))
905$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700906 $(foreach image, $(IMAGE_TYPES), \
907 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
908$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700909 $(foreach test, $(TEST_ART_RUN_TESTS), \
910 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
911$(foreach target, $(TARGET_TYPES), \
912 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
913 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100914$(foreach target, $(TARGET_TYPES), \
915 $(foreach run_type, $(RUN_TYPES), \
916 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700917define-test-art-run-test-group :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700918TARGET_TYPES :=
919PREBUILD_TYPES :=
920COMPILER_TYPES :=
921RELOCATE_TYPES :=
922TRACE_TYPES :=
923GC_TYPES :=
924JNI_TYPES :=
Alex Light03a112d2014-08-25 13:25:56 -0700925IMAGE_TYPES :=
Ian Rogers86df3ac2014-08-27 10:54:11 -0700926ADDRESS_SIZES_TARGET :=
927ADDRESS_SIZES_HOST :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700928ALL_ADDRESS_SIZES :=
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100929RUN_TYPES :=
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000930DEBUGGABLE_TYPES :=
Ian Rogers9fcaa4b2014-08-26 19:59:52 -0700931
932include $(LOCAL_PATH)/Android.libarttest.mk
933include art/test/Android.libnativebridgetest.mk