blob: c18bb5caedd5b41b76e2f0da486dfd043f34e557 [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.
Sebastien Hertz19ac0272015-02-24 17:39:50 +010036TEST_ART_RUN_TEST_DEPENDENCIES := \
37 $(DX) \
38 $(HOST_OUT_EXECUTABLES)/jasmin \
39 $(HOST_OUT_EXECUTABLES)/smali \
40 $(HOST_OUT_EXECUTABLES)/dexmerger
41
42ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
43 TEST_ART_RUN_TEST_DEPENDENCIES += \
44 $(JACK_JAR) \
45 $(JACK_LAUNCHER_JAR) \
46 $(JILL_JAR)
47endif
Nicolas Geoffray07f2bc12015-05-29 13:40:25 +010048
Ian Rogersafd9acc2014-06-17 08:21:54 -070049# Helper to create individual build targets for tests. Must be called with $(eval).
50# $(1): the test number
51define define-build-art-run-test
52 dmart_target := $(art_run_tests_dir)/art-run-tests/$(1)/touch
Sebastien Hertz19ac0272015-02-24 17:39:50 +010053 run_test_options = --build-only
54 ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
55 run_test_options += --build-with-jack
56 else
57 run_test_options += --build-with-javac-dx
58 endif
59$$(dmart_target): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
Nicolas Geoffray07f2bc12015-05-29 13:40:25 +010060$$(dmart_target): $(TEST_ART_RUN_TEST_DEPENDENCIES)
Ian Rogersafd9acc2014-06-17 08:21:54 -070061 $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@)
62 $(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -070063 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
64 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Sebastien Hertz19ac0272015-02-24 17:39:50 +010065 JACK=$(abspath $(JACK)) \
66 JACK_VM_COMMAND="$(JACK_VM) $(DEFAULT_JACK_VM_ARGS) $(JAVA_TMPDIR_ARG) -jar $(abspath $(JACK_LAUNCHER_JAR)) " \
67 JACK_CLASSPATH=$(TARGET_JACK_CLASSPATH) \
68 JACK_JAR=$(abspath $(JACK_JAR)) \
69 JILL_JAR=$(abspath $(JILL_JAR)) \
70 $(LOCAL_PATH)/run-test $$(PRIVATE_RUN_TEST_OPTIONS) --output-path $$(abspath $$(dir $$@)) $(1)
Ian Rogersafd9acc2014-06-17 08:21:54 -070071 $(hide) touch $$@
72
73 TEST_ART_RUN_TEST_BUILD_RULES += $$(dmart_target)
74 dmart_target :=
Sebastien Hertz19ac0272015-02-24 17:39:50 +010075 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -070076endef
Ian Rogersbf66bce2014-06-24 23:15:34 -070077$(foreach test, $(TEST_ART_RUN_TESTS), $(eval $(call define-build-art-run-test,$(test))))
Ian Rogersafd9acc2014-06-17 08:21:54 -070078
79include $(CLEAR_VARS)
80LOCAL_MODULE_TAGS := tests
81LOCAL_MODULE := art-run-tests
Ian Rogersabbf2422014-10-15 11:57:01 -070082LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES)
Ian Rogersafd9acc2014-06-17 08:21:54 -070083# The build system use this flag to pick up files generated by declare-make-art-run-test.
84LOCAL_PICKUP_FILES := $(art_run_tests_dir)
85
86include $(BUILD_PHONY_PACKAGE)
87
88# Clear temp vars.
Ian Rogersafd9acc2014-06-17 08:21:54 -070089art_run_tests_dir :=
90define-build-art-run-test :=
Ian Rogers8a14b752014-07-18 15:06:53 -070091TEST_ART_RUN_TEST_BUILD_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -070092
93########################################################################
Ian Rogersf5c44b32014-08-19 16:52:36 -070094# General rules to build and run a run-test.
Ian Rogersafd9acc2014-06-17 08:21:54 -070095
Ian Rogersf5c44b32014-08-19 16:52:36 -070096TARGET_TYPES := host target
Nicolas Geoffray41bb3312014-10-24 13:49:08 +010097PREBUILD_TYPES :=
98ifeq ($(ART_TEST_RUN_TEST_PREBUILD),true)
99 PREBUILD_TYPES += prebuild
100endif
Ian Rogers86df3ac2014-08-27 10:54:11 -0700101ifeq ($(ART_TEST_RUN_TEST_NO_PREBUILD),true)
102 PREBUILD_TYPES += no-prebuild
103endif
104ifeq ($(ART_TEST_RUN_TEST_NO_DEX2OAT),true)
105 PREBUILD_TYPES += no-dex2oat
106endif
107COMPILER_TYPES :=
108ifeq ($(ART_TEST_DEFAULT_COMPILER),true)
109 COMPILER_TYPES += default
110endif
111ifeq ($(ART_TEST_INTERPRETER),true)
112 COMPILER_TYPES += interpreter
113endif
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800114ifeq ($(ART_TEST_JIT),true)
115 COMPILER_TYPES += jit
116endif
Ian Rogers86df3ac2014-08-27 10:54:11 -0700117ifeq ($(ART_TEST_OPTIMIZING),true)
118 COMPILER_TYPES += optimizing
119endif
120RELOCATE_TYPES := relocate
121ifeq ($(ART_TEST_RUN_TEST_NO_RELOCATE),true)
122 RELOCATE_TYPES += no-relocate
123endif
124ifeq ($(ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT),true)
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700125 RELOCATE_TYPES += relocate-npatchoat
Ian Rogers86df3ac2014-08-27 10:54:11 -0700126endif
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700127TRACE_TYPES := ntrace
Ian Rogers86df3ac2014-08-27 10:54:11 -0700128ifeq ($(ART_TEST_TRACE),true)
129 TRACE_TYPES += trace
130endif
Andreas Gampe7526d782015-06-22 22:53:45 -0700131ifeq ($(ART_TEST_TRACE_STREAM),true)
132 TRACE_TYPES += stream
133endif
Ian Rogers86df3ac2014-08-27 10:54:11 -0700134GC_TYPES := cms
Alex Light992f1e72014-08-27 16:08:57 -0700135ifeq ($(ART_TEST_GC_STRESS),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700136 GC_TYPES += gcstress
137endif
Alex Light992f1e72014-08-27 16:08:57 -0700138ifeq ($(ART_TEST_GC_VERIFY),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700139 GC_TYPES += gcverify
140endif
141JNI_TYPES := checkjni
142ifeq ($(ART_TEST_JNI_FORCECOPY),true)
143 JNI_TYPES += forcecopy
144endif
145IMAGE_TYPES := image
146ifeq ($(ART_TEST_RUN_TEST_NO_IMAGE),true)
147 IMAGE_TYPES += no-image
148endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700149ifeq ($(ART_TEST_PIC_IMAGE),true)
150 IMAGE_TYPES += picimage
151endif
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700152PICTEST_TYPES := npictest
Andreas Gampec23c9c92014-10-28 14:47:25 -0700153ifeq ($(ART_TEST_PIC_TEST),true)
154 PICTEST_TYPES += pictest
155endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100156RUN_TYPES :=
157ifeq ($(ART_TEST_RUN_TEST_DEBUG),true)
158 RUN_TYPES += debug
159endif
160ifeq ($(ART_TEST_RUN_TEST_NDEBUG),true)
161 RUN_TYPES += ndebug
162endif
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700163DEBUGGABLE_TYPES := ndebuggable
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000164ifeq ($(ART_TEST_RUN_TEST_DEBUGGABLE),true)
165DEBUGGABLE_TYPES += debuggable
166endif
Nicolas Geoffray41bb3312014-10-24 13:49:08 +0100167ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX)
168ADDRESS_SIZES_HOST := $(ART_PHONY_TEST_HOST_SUFFIX)
169ifeq ($(ART_TEST_RUN_TEST_2ND_ARCH),true)
170 ADDRESS_SIZES_TARGET += $(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
171 ADDRESS_SIZES_HOST += $(2ND_ART_PHONY_TEST_HOST_SUFFIX)
172endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700173ALL_ADDRESS_SIZES := 64 32
Ian Rogers86df3ac2014-08-27 10:54:11 -0700174
Ian Rogersf5c44b32014-08-19 16:52:36 -0700175# List all run test names with number arguments agreeing with the comment above.
176define all-run-test-names
177 $(foreach target, $(1), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100178 $(foreach run-type, $(2), \
179 $(foreach prebuild, $(3), \
180 $(foreach compiler, $(4), \
181 $(foreach relocate, $(5), \
182 $(foreach trace, $(6), \
183 $(foreach gc, $(7), \
184 $(foreach jni, $(8), \
185 $(foreach image, $(9), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700186 $(foreach pictest, $(10), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000187 $(foreach debuggable, $(11), \
188 $(foreach test, $(12), \
189 $(foreach address_size, $(13), \
190 test-art-$(target)-run-test-$(run-type)-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(image)-$(pictest)-$(debuggable)-$(test)$(address_size) \
191 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700192endef # all-run-test-names
193
194# To generate a full list or tests:
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100195# $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700196# $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000197# $(DEBUGGABLE_TYPES) $(TEST_ART_RUN_TESTS), $(ALL_ADDRESS_SIZES)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700198
199# Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE
200define name-to-var
201$(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
202endef # name-to-var
203
204# Tests that are timing sensitive and flaky on heavily loaded systems.
205TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \
206 053-wait-some \
Mathieu Chartiere4a91bb2015-01-28 13:11:44 -0800207 055-enum-performance \
208 133-static-invoke-super
Ian Rogersf5c44b32014-08-19 16:52:36 -0700209
210 # disable timing sensitive tests on "dist" builds.
211ifdef dist_goal
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100212 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700213 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000214 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700215endif
216
Ian Rogers86df3ac2014-08-27 10:54:11 -0700217TEST_ART_TIMING_SENSITIVE_RUN_TESTS :=
218
Ian Rogers40e19122014-09-02 15:59:28 -0700219# 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 -0700220TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \
Andreas Gampe3ad5d5e2015-02-03 18:26:55 -0800221 116-nodex2oat \
Jean Christophe Beyler24e04aa2014-09-12 12:03:25 -0700222 118-noimage-dex2oat \
223 134-nodex2oat-nofallback
Ian Rogersf5c44b32014-08-19 16:52:36 -0700224
Ian Rogers40e19122014-09-02 15:59:28 -0700225ifneq (,$(filter prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100226 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700227 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000228 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700229endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700230
Ian Rogers86df3ac2014-08-27 10:54:11 -0700231TEST_ART_BROKEN_PREBUILD_RUN_TESTS :=
232
Ian Rogersf5c44b32014-08-19 16:52:36 -0700233TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
234 117-nopatchoat
235
Ian Rogers40e19122014-09-02 15:59:28 -0700236ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100237 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700238 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000239 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700240endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700241
Ian Rogers86df3ac2014-08-27 10:54:11 -0700242TEST_ART_BROKEN_NO_PREBUILD_TESTS :=
243
Ian Rogers40e19122014-09-02 15:59:28 -0700244# Note 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without
245# --prebuild --relocate
246TEST_ART_BROKEN_NO_RELOCATE_TESTS := \
Andreas Gampe3ad5d5e2015-02-03 18:26:55 -0800247 117-nopatchoat \
248 118-noimage-dex2oat \
249 119-noimage-patchoat
Ian Rogers40e19122014-09-02 15:59:28 -0700250
251ifneq (,$(filter no-relocate,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100252 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700253 $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000254 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700255endif
256
257TEST_ART_BROKEN_NO_RELOCATE_TESTS :=
258
Man Cao1ed11b92015-06-11 22:47:35 -0700259# Tests that are broken with GC stress.
Mathieu Chartiereb193622015-06-27 15:42:27 -0700260# 137-cfi needs to unwind a second forked process. We're using a primitive sleep to wait till we
261# hope the second process got into the expected state. The slowness of gcstress makes this bad.
262TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := \
263 137-cfi
Man Cao1ed11b92015-06-11 22:47:35 -0700264
265ifneq (,$(filter gcstress,$(GC_TYPES)))
266 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
267 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
268 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
269endif
270
271TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
Ian Rogers40e19122014-09-02 15:59:28 -0700272
Ian Rogersf5c44b32014-08-19 16:52:36 -0700273# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100274ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000275 $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), 115-native-bridge, \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700276 $(ALL_ADDRESS_SIZES))
277
Andreas Gampe3a913092015-01-10 00:26:17 -0800278# 130-hprof dumps the heap and runs hprof-conv to check whether the file is somewhat readable. This
279# is only possible on the host.
280# TODO: Turn off all the other combinations, this is more about testing actual ART code. A gtest is
281# very hard to write here, as (for a complete test) JDWP must be set up.
282ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
283 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000284 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),130-hprof,$(ALL_ADDRESS_SIZES))
Andreas Gampe3a913092015-01-10 00:26:17 -0800285
Andreas Gampe94329d32015-04-24 20:22:06 -0700286# 131 is an old test. The functionality has been implemented at an earlier stage and is checked
287# in tests 138.
288ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
289 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
290 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),131-structural-change,$(ALL_ADDRESS_SIZES))
291
Andreas Gampe69b5d8f2015-06-03 15:43:16 -0700292# 138-duplicate-classes-check. Turned off temporarily, b/21333911.
293ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
294 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
295 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),138-duplicate-classes-check,$(ALL_ADDRESS_SIZES))
296
Alex Light03a112d2014-08-25 13:25:56 -0700297# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
298# Therefore we shouldn't run them in situations where we actually don't have these since they
299# explicitly test for them. These all also assume we have an image.
300TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
301 116-nodex2oat \
302 117-nopatchoat \
303 118-noimage-dex2oat \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700304 119-noimage-patchoat \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700305 137-cfi \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700306 138-duplicate-classes-check2
307
308# This test fails without an image.
309TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS := \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700310 137-cfi \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700311 138-duplicate-classes-check
Alex Light03a112d2014-08-25 13:25:56 -0700312
Ian Rogers40e19122014-09-02 15:59:28 -0700313ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100314 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
Ian Rogers40e19122014-09-02 15:59:28 -0700315 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000316 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700317endif
Alex Light03a112d2014-08-25 13:25:56 -0700318
Alex Light03a112d2014-08-25 13:25:56 -0700319
Ian Rogers40e19122014-09-02 15:59:28 -0700320ifneq (,$(filter no-image,$(IMAGE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100321 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700322 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000323 $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700324 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
325 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
326 $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700327endif
328
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700329ifneq (,$(filter relocate-npatchoat,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100330 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700331 $(COMPILER_TYPES), relocate-npatchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000332 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700333endif
Alex Light03a112d2014-08-25 13:25:56 -0700334
Ian Rogers86df3ac2014-08-27 10:54:11 -0700335TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
336
Andreas Gampee1bbed22015-05-20 13:55:00 -0700337# 137:
338# This test unrolls and expects managed frames, but tracing means we run the interpreter.
339# 802:
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800340# This test dynamically enables tracing to force a deoptimization. This makes the test meaningless
341# when already tracing, and writes an error message that we do not want to check for.
342TEST_ART_BROKEN_TRACING_RUN_TESTS := \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700343 137-cfi \
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800344 802-deoptimization
345
Andreas Gampe7526d782015-06-22 22:53:45 -0700346ifneq (,$(filter trace stream,$(TRACE_TYPES)))
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800347 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Andreas Gampe7526d782015-06-22 22:53:45 -0700348 $(COMPILER_TYPES),$(RELOCATE_TYPES),trace stream,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000349 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800350endif
351
352TEST_ART_BROKEN_TRACING_RUN_TESTS :=
353
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100354# The following tests use libarttest.so, which is linked against libartd.so, so will
355# not work when libart.so is the one loaded.
356# TODO: Find a way to run these tests in ndebug mode.
357TEST_ART_BROKEN_NDEBUG_TESTS := \
358 004-JniTest \
359 004-ReferenceMap \
360 004-SignalTest \
361 004-StackWalk \
362 004-UnsafeTest \
Nicolas Geoffray64dea7e2014-11-07 14:32:42 +0000363 051-thread \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100364 115-native-bridge \
365 116-nodex2oat \
366 117-nopatchoat \
367 118-noimage-dex2oat \
368 119-noimage-patchoat \
Nicolas Geoffray8c9200a2015-01-15 08:42:47 +0000369 131-structural-change \
Andreas Gampe73810102015-04-22 18:57:06 -0700370 137-cfi \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700371 139-register-natives \
Nicolas Geoffrayd845fd02015-03-03 12:43:45 +0000372 454-get-vreg \
373 455-set-vreg \
Nicolas Geoffray64d69ab2015-03-10 19:26:24 +0000374 457-regs \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +0000375 461-get-reference-vreg \
Nicolas Geoffrayd8126be2015-03-27 10:22:41 +0000376 466-get-live-vreg \
Nicolas Geoffray32c9ea52015-06-12 14:52:33 +0100377 497-inlining-and-class-loader \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100378
379ifneq (,$(filter ndebug,$(RUN_TYPES)))
380 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
381 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000382 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100383endif
384
385TEST_ART_BROKEN_NDEBUG_TESTS :=
386
Andreas Gampee1bbed22015-05-20 13:55:00 -0700387# Known broken tests for the interpreter.
388# CFI unwinding expects managed frames.
389TEST_ART_BROKEN_INTERPRETER_RUN_TESTS := \
390 137-cfi
391
392ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
393 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
394 interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
395 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_INTERPRETER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
396endif
397
398TEST_ART_BROKEN_INTERPRETER_RUN_TESTS :=
399
Andreas Gampeaab9f732015-05-20 14:50:06 -0700400# Known broken tests for the JIT.
401# CFI unwinding expects managed frames, and the test does not iterate enough to even compile. JIT
402# also uses Generic JNI instead of the JNI compiler.
403TEST_ART_BROKEN_JIT_RUN_TESTS := \
404 137-cfi
405
406ifneq (,$(filter jit,$(COMPILER_TYPES)))
407 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
408 jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
409 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_JIT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
410endif
411
412TEST_ART_BROKEN_JIT_RUN_TESTS :=
413
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100414# Known broken tests for the default compiler (Quick).
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000415TEST_ART_BROKEN_DEFAULT_RUN_TESTS := \
Vladimir Marko07785bb2015-06-15 18:52:54 +0100416 457-regs
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100417
418ifneq (,$(filter default,$(COMPILER_TYPES)))
419 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Nicolas Geoffray83cae422014-10-22 15:08:03 +0100420 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000421 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100422endif
423
424TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
425
Alexandre Rames5319def2014-10-23 10:03:10 +0100426# Known broken tests for the arm64 optimizing compiler backend.
Serban Constantinescu02d81cc2015-01-05 16:08:49 +0000427TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100428
429ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
430 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
431 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000432 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS),64)
Alexandre Rames5319def2014-10-23 10:03:10 +0100433endif
434
435TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
436
Alexey Frunze4dda3372015-06-01 18:31:49 -0700437# Known broken tests for the MIPS64 optimizing compiler backend in 64-bit mode. b/21555893
438TEST_ART_BROKEN_OPTIMIZING_MIPS64_64BIT_RUN_TESTS := \
Alexey Frunze4dda3372015-06-01 18:31:49 -0700439 449-checker-bce
440
441ifeq ($(TARGET_ARCH),mips64)
442 ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
443 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
444 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
445 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_MIPS64_64BIT_RUN_TESTS),64)
446 endif
447endif
448
449TEST_ART_BROKEN_OPTIMIZING_MIPS64_64BIT_RUN_TESTS :=
450
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100451# Known broken tests for the optimizing compiler.
Nicolas Geoffrayaa8dd2f2015-01-23 17:48:28 +0000452TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100453
454ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
455 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
456 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000457 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100458endif
459
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000460# If ART_USE_OPTIMIZING_COMPILER is set to true, then the default core.art has been
461# compiled with the optimizing compiler.
462ifeq ($(ART_USE_OPTIMIZING_COMPILER),true)
463 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
464 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000465 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000466endif
467
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100468TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
469
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000470# Tests that should fail when the optimizing compiler compiles them non-debuggable.
471TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS := \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +0000472 454-get-vreg \
473 455-set-vreg \
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000474 457-regs \
475
476ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
477 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
478 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700479 $(IMAGE_TYPES),$(PICTEST_TYPES),ndebuggable,$(TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000480endif
481
482TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
483
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000484# Tests that should fail when the optimizing compiler compiles them debuggable.
485TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS := \
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000486
487ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
488 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
489 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
490 $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
491endif
492
493TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
494
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700495# Tests that should fail in the read barrier configuration.
Andreas Gampee1bbed22015-05-20 13:55:00 -0700496# 137: Read barrier forces interpreter. Cannot run this with the interpreter.
497TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS := \
498 137-cfi
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700499
500ifeq ($(ART_USE_READ_BARRIER),true)
501 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
502 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
503 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
504endif
505
506TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100507
Roland Levillain4d027112015-07-01 15:41:14 +0100508# Tests that should fail in the heap poisoning configuration with the default (Quick) compiler.
509# 137: Quick punts to the interpreter, and this test cannot run this with the interpreter.
510TEST_ART_BROKEN_DEFAULT_HEAP_POISONING_RUN_TESTS := \
511 137-cfi
512# Tests that should fail in the heap poisoning configuration with the Optimizing compiler.
513# 055-enum-performance: Exceeds run time limits due to heap poisoning instrumentation.
514TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS := \
515 055-enum-performance
516# Tests that should fail in the heap poisoning configuration with the interpreter.
517# 137: Cannot run this with the interpreter.
518TEST_ART_BROKEN_INTERPRETER_HEAP_POISONING_RUN_TESTS := \
Andreas Gampe44372192015-05-21 10:01:42 -0700519 137-cfi
520
521ifeq ($(ART_HEAP_POISONING),true)
Roland Levillain4d027112015-07-01 15:41:14 +0100522 ifneq (,$(filter default,$(COMPILER_TYPES)))
523 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
524 $(PREBUILD_TYPES),default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
525 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
526 $(TEST_ART_BROKEN_DEFAULT_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
527 endif
528
529 ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
530 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
531 $(PREBUILD_TYPES),optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
532 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
533 $(TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
534 endif
535
536 ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
537 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
538 $(PREBUILD_TYPES),interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
539 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
540 $(TEST_ART_BROKEN_INTERPRETER_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
541 endif
Andreas Gampe44372192015-05-21 10:01:42 -0700542endif
543
Roland Levillain4d027112015-07-01 15:41:14 +0100544TEST_ART_BROKEN_INTERPRETER_HEAP_POISONING_RUN_TESTS :=
545TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS :=
546TEST_ART_BROKEN_DEFAULT_HEAP_POISONING_RUN_TESTS :=
Andreas Gampe44372192015-05-21 10:01:42 -0700547
Ian Rogersf5c44b32014-08-19 16:52:36 -0700548# Clear variables ahead of appending to them when defining tests.
549$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
550$(foreach target, $(TARGET_TYPES), \
551 $(foreach prebuild, $(PREBUILD_TYPES), \
552 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
553$(foreach target, $(TARGET_TYPES), \
554 $(foreach compiler, $(COMPILER_TYPES), \
555 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
556$(foreach target, $(TARGET_TYPES), \
557 $(foreach relocate, $(RELOCATE_TYPES), \
558 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
559$(foreach target, $(TARGET_TYPES), \
560 $(foreach trace, $(TRACE_TYPES), \
561 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
562$(foreach target, $(TARGET_TYPES), \
563 $(foreach gc, $(GC_TYPES), \
564 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
565$(foreach target, $(TARGET_TYPES), \
566 $(foreach jni, $(JNI_TYPES), \
567 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
568$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700569 $(foreach image, $(IMAGE_TYPES), \
570 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
571$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700572 $(foreach test, $(TEST_ART_RUN_TESTS), \
573 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
574$(foreach target, $(TARGET_TYPES), \
575 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
576 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100577$(foreach target, $(TARGET_TYPES), \
578 $(foreach run_type, $(RUN_TYPES), \
579 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000580$(foreach target, $(TARGET_TYPES), \
581 $(foreach debuggable_type, $(DEBUGGABLE_TYPES), \
582 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700583
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700584# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
585# only once).
586TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700587
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700588# Also need libarttest.
589TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
590ifdef TARGET_2ND_ARCH
591TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
592endif
593
Andreas Gampe855564b2014-07-25 02:32:19 -0700594# Also need libnativebridgetest.
595TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
596ifdef TARGET_2ND_ARCH
597TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
598endif
599
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700600# All tests require the host executables. The tests also depend on the core images, but on
601# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700602ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
603 $(ART_HOST_EXECUTABLES) \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700604 $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700605 $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700606 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700607
608ifneq ($(HOST_PREFER_32_BIT),true)
609ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700610 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700611 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700612 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700613endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700614
Ian Rogersf5c44b32014-08-19 16:52:36 -0700615# Create a rule to build and run a tests following the form:
Calin Juravle9228b2a2014-10-22 15:54:34 +0100616# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700617# {4: interpreter default optimizing jit}-{5: relocate nrelocate relocate-npatchoat}-
618# {6: trace or ntrace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
619# {9: no-image image picimage}-{10: pictest npictest}-
620# {11: ndebuggable debuggable}-{12: test name}{13: 32 or 64}
Ian Rogersafd9acc2014-06-17 08:21:54 -0700621define define-test-art-run-test
Nicolas Geoffray611e1db2014-10-09 17:34:45 +0100622 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700623 prereq_rule :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700624 test_groups :=
625 uc_host_or_target :=
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100626 jack_classpath :=
627 ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
628 run_test_options += --build-with-jack
629 else
630 run_test_options += --build-with-javac-dx
631 endif
Alex Lightbfac14a2014-07-30 09:41:21 -0700632 ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
633 run_test_options += --always-clean
634 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700635 ifeq ($(1),host)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700636 uc_host_or_target := HOST
Ian Rogersf5c44b32014-08-19 16:52:36 -0700637 test_groups := ART_RUN_TEST_HOST_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700638 run_test_options += --host
639 prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100640 jack_classpath := $(HOST_JACK_CLASSPATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700641 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700642 ifeq ($(1),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700643 uc_host_or_target := TARGET
Ian Rogersf5c44b32014-08-19 16:52:36 -0700644 test_groups := ART_RUN_TEST_TARGET_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700645 prereq_rule := test-art-target-sync
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100646 jack_classpath := $(TARGET_JACK_CLASSPATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700647 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700648 $$(error found $(1) expected $(TARGET_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700649 endif
650 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100651 ifeq ($(2),debug)
652 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
653 else
654 ifeq ($(2),ndebug)
655 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
656 run_test_options += -O
657 else
658 $$(error found $(2) expected $(RUN_TYPES))
659 endif
660 endif
661 ifeq ($(3),prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700662 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
663 run_test_options += --prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700664 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100665 ifeq ($(3),no-prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700666 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
667 run_test_options += --no-prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700668 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100669 ifeq ($(3),no-dex2oat)
Alex Light03a112d2014-08-25 13:25:56 -0700670 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
671 run_test_options += --no-prebuild --no-dex2oat
672 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100673 $$(error found $(3) expected $(PREBUILD_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700674 endif
Alex Lighta59dd802014-07-02 16:28:08 -0700675 endif
676 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100677 ifeq ($(4),optimizing)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700678 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700679 run_test_options += --optimizing
Ian Rogersafd9acc2014-06-17 08:21:54 -0700680 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100681 ifeq ($(4),interpreter)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700682 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700683 run_test_options += --interpreter
684 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100685 ifeq ($(4),default)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700686 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
Nicolas Geoffrayc9338b92014-12-03 13:36:10 +0000687 run_test_options += --quick
Ian Rogersafd9acc2014-06-17 08:21:54 -0700688 else
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800689 ifeq ($(4),jit)
Mathieu Chartier3fc1b122015-02-26 10:58:08 -0800690 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JIT_RULES
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800691 run_test_options += --jit
692 else
693 $$(error found $(4) expected $(COMPILER_TYPES))
694 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700695 endif
696 endif
697 endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700698
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100699 ifeq ($(5),relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700700 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
701 run_test_options += --relocate
Ian Rogersafd9acc2014-06-17 08:21:54 -0700702 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100703 ifeq ($(5),no-relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700704 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
705 run_test_options += --no-relocate
706 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700707 ifeq ($(5),relocate-npatchoat)
Alex Light03a112d2014-08-25 13:25:56 -0700708 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
709 run_test_options += --relocate --no-patchoat
710 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100711 $$(error found $(5) expected $(RELOCATE_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700712 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700713 endif
714 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100715 ifeq ($(6),trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700716 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
Ian Rogers716e4f82014-07-16 11:18:03 -0700717 run_test_options += --trace
Ian Rogers716e4f82014-07-16 11:18:03 -0700718 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700719 ifeq ($(6),ntrace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700720 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
Ian Rogers701aa642014-07-18 11:38:13 -0700721 else
Andreas Gampe7526d782015-06-22 22:53:45 -0700722 ifeq ($(6),stream)
723 # Group streaming under normal tracing rules.
724 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
725 run_test_options += --trace --stream
726 else
727 $$(error found $(6) expected $(TRACE_TYPES))
728 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700729 endif
730 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100731 ifeq ($(7),gcverify)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700732 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700733 run_test_options += --gcverify
734 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100735 ifeq ($(7),gcstress)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700736 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700737 run_test_options += --gcstress
738 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100739 ifeq ($(7),cms)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700740 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
Ian Rogers8a14b752014-07-18 15:06:53 -0700741 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100742 $$(error found $(7) expected $(GC_TYPES))
Ian Rogers701aa642014-07-18 11:38:13 -0700743 endif
Ian Rogers716e4f82014-07-16 11:18:03 -0700744 endif
745 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100746 ifeq ($(8),forcecopy)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700747 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700748 run_test_options += --runtime-option -Xjniopts:forcecopy
749 ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
750 skip_test := true
751 endif
752 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100753 ifeq ($(8),checkjni)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700754 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700755 run_test_options += --runtime-option -Xcheck:jni
756 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100757 ifeq ($(8),jni)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700758 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
759 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100760 $$(error found $(8) expected $(JNI_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700761 endif
762 endif
763 endif
Mathieu Chartiere2a12c02015-02-27 13:21:15 -0800764 ifeq ($(4),jit)
765 # Use interpreter image for JIT.
766 image_suffix := interpreter
767 else
768 image_suffix := $(4)
769 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100770 ifeq ($(9),no-image)
Alex Light03a112d2014-08-25 13:25:56 -0700771 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
772 run_test_options += --no-image
Andreas Gampebf03e842014-10-29 20:46:17 -0700773 # Add the core dependency. This is required for pre-building.
774 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000775 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700776 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000777 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700778 endif
Alex Light03a112d2014-08-25 13:25:56 -0700779 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100780 ifeq ($(9),image)
Alex Light03a112d2014-08-25 13:25:56 -0700781 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
Andreas Gampec23c9c92014-10-28 14:47:25 -0700782 # Add the core dependency.
783 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000784 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700785 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000786 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700787 endif
Alex Light03a112d2014-08-25 13:25:56 -0700788 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700789 ifeq ($(9),picimage)
790 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
791 run_test_options += --pic-image
792 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000793 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700794 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000795 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700796 endif
797 else
798 $$(error found $(9) expected $(IMAGE_TYPES))
799 endif
Alex Light03a112d2014-08-25 13:25:56 -0700800 endif
801 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700802 ifeq ($(10),pictest)
803 run_test_options += --pic-test
804 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700805 ifeq ($(10),npictest)
Andreas Gampec23c9c92014-10-28 14:47:25 -0700806 # Nothing to be done.
807 else
808 $$(error found $(10) expected $(PICTEST_TYPES))
809 endif
810 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000811 ifeq ($(11),debuggable)
812 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUGGABLE_RULES
813 run_test_options += --debuggable
814 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700815 ifeq ($(11),ndebuggable)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000816 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NONDEBUGGABLE_RULES
817 # Nothing to be done.
818 else
819 $$(error found $(11) expected $(DEBUGGABLE_TYPES))
820 endif
821 endif
822 # $(12) is the test name.
823 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(12))_RULES
824 ifeq ($(13),64)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700825 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
826 run_test_options += --64
827 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000828 ifeq ($(13),32)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700829 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
830 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000831 $$(error found $(13) expected $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700832 endif
833 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000834 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 -0700835 run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
Ian Rogers5242c0a2014-07-18 11:02:19 -0700836 $$(run_test_options)
Nicolas Geoffrayc8f23fc2014-10-28 17:59:47 +0000837 ifneq ($(ART_TEST_ANDROID_ROOT),)
838 run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
839 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700840$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100841$$(run_test_rule_name): PRIVATE_JACK_CLASSPATH := $$(jack_classpath)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700842.PHONY: $$(run_test_rule_name)
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100843$$(run_test_rule_name): $(TEST_ART_RUN_TEST_DEPENDENCIES) $(HOST_OUT_EXECUTABLES)/hprof-conv $$(prereq_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700844 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100845 DX=$(abspath $(DX)) \
846 JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700847 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
848 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100849 JACK=$(abspath $(JACK)) \
850 JACK_VM_COMMAND="$(JACK_VM) $(DEFAULT_JACK_VM_ARGS) $(JAVA_TMPDIR_ARG) -jar $(abspath $(JACK_LAUNCHER_JAR)) " \
851 JACK_CLASSPATH=$$(PRIVATE_JACK_CLASSPATH) \
852 JACK_JAR=$(abspath $(JACK_JAR)) \
853 JILL_JAR=$(abspath $(JILL_JAR)) \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000854 art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(12) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700855 && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
856 $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
857 echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
858 rm -r $(ART_HOST_TEST_DIR)) || true
859
Ian Rogersf5c44b32014-08-19 16:52:36 -0700860 $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700861
862 # Clear locally defined variables.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700863 uc_host_or_target :=
864 test_groups :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700865 run_test_options :=
866 run_test_rule_name :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700867 prereq_rule :=
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100868 jack_classpath :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700869endef # define-test-art-run-test
870
Ian Rogersf5c44b32014-08-19 16:52:36 -0700871$(foreach target, $(TARGET_TYPES), \
872 $(foreach test, $(TEST_ART_RUN_TESTS), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100873 $(foreach run_type, $(RUN_TYPES), \
874 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
875 $(foreach prebuild, $(PREBUILD_TYPES), \
876 $(foreach compiler, $(COMPILER_TYPES), \
877 $(foreach relocate, $(RELOCATE_TYPES), \
878 $(foreach trace, $(TRACE_TYPES), \
879 $(foreach gc, $(GC_TYPES), \
880 $(foreach jni, $(JNI_TYPES), \
881 $(foreach image, $(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700882 $(foreach pictest, $(PICTEST_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000883 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
884 $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(debuggable),$(test),$(address_size))) \
885 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700886define-test-art-run-test :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700887
Ian Rogersafd9acc2014-06-17 08:21:54 -0700888# Define a phony rule whose purpose is to test its prerequisites.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700889# $(1): host or target
Ian Rogersafd9acc2014-06-17 08:21:54 -0700890# $(2): list of prerequisites
Ian Rogersf5c44b32014-08-19 16:52:36 -0700891define define-test-art-run-test-group
Ian Rogersafd9acc2014-06-17 08:21:54 -0700892.PHONY: $(1)
893$(1): $(2)
894 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
895
Ian Rogersafd9acc2014-06-17 08:21:54 -0700896endef # define-test-art-run-test-group
897
Ian Rogersafd9acc2014-06-17 08:21:54 -0700898
Ian Rogersf5c44b32014-08-19 16:52:36 -0700899$(foreach target, $(TARGET_TYPES), $(eval \
900 $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
901$(foreach target, $(TARGET_TYPES), \
902 $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
903 $(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)))))
904$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100905 $(foreach run-type, $(RUN_TYPES), $(eval \
906 $(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)))))
907$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700908 $(foreach compiler, $(COMPILER_TYPES), $(eval \
909 $(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)))))
910$(foreach target, $(TARGET_TYPES), \
911 $(foreach relocate, $(RELOCATE_TYPES), $(eval \
912 $(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)))))
913$(foreach target, $(TARGET_TYPES), \
914 $(foreach trace, $(TRACE_TYPES), $(eval \
915 $(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)))))
916$(foreach target, $(TARGET_TYPES), \
917 $(foreach gc, $(GC_TYPES), $(eval \
918 $(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)))))
919$(foreach target, $(TARGET_TYPES), \
920 $(foreach jni, $(JNI_TYPES), $(eval \
921 $(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)))))
922$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000923 $(foreach debuggable, $(DEBUGGABLE_TYPES), $(eval \
924 $(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)))))
925$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700926 $(foreach image, $(IMAGE_TYPES), $(eval \
927 $(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)))))
928$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700929 $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
930 $(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)))))
931$(foreach target, $(TARGET_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700932 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
Ian Rogersa3cf6ce2014-10-02 16:35:52 -0700933 $(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 -0700934
Ian Rogersf5c44b32014-08-19 16:52:36 -0700935# Clear variables now we're finished with them.
936$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
937$(foreach target, $(TARGET_TYPES), \
938 $(foreach prebuild, $(PREBUILD_TYPES), \
939 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
940$(foreach target, $(TARGET_TYPES), \
941 $(foreach compiler, $(COMPILER_TYPES), \
942 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
943$(foreach target, $(TARGET_TYPES), \
944 $(foreach relocate, $(RELOCATE_TYPES), \
945 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
946$(foreach target, $(TARGET_TYPES), \
947 $(foreach trace, $(TRACE_TYPES), \
948 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
949$(foreach target, $(TARGET_TYPES), \
950 $(foreach gc, $(GC_TYPES), \
951 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
952$(foreach target, $(TARGET_TYPES), \
953 $(foreach jni, $(JNI_TYPES), \
954 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
955$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000956 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
957 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES :=)))
958$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700959 $(foreach image, $(IMAGE_TYPES), \
960 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
961$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700962 $(foreach test, $(TEST_ART_RUN_TESTS), \
963 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
964$(foreach target, $(TARGET_TYPES), \
965 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
966 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100967$(foreach target, $(TARGET_TYPES), \
968 $(foreach run_type, $(RUN_TYPES), \
969 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700970define-test-art-run-test-group :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700971TARGET_TYPES :=
972PREBUILD_TYPES :=
973COMPILER_TYPES :=
974RELOCATE_TYPES :=
975TRACE_TYPES :=
976GC_TYPES :=
977JNI_TYPES :=
Alex Light03a112d2014-08-25 13:25:56 -0700978IMAGE_TYPES :=
Ian Rogers86df3ac2014-08-27 10:54:11 -0700979ADDRESS_SIZES_TARGET :=
980ADDRESS_SIZES_HOST :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700981ALL_ADDRESS_SIZES :=
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100982RUN_TYPES :=
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000983DEBUGGABLE_TYPES :=
Ian Rogers9fcaa4b2014-08-26 19:59:52 -0700984
985include $(LOCAL_PATH)/Android.libarttest.mk
986include art/test/Android.libnativebridgetest.mk