blob: b1edc3b4213635017a9954ff2da8216b2a16e867 [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
Sebastien Hertz5ee94542015-02-24 17:39:50 +010035# Dependencies for actually running a run-test.
36TEST_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
48
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 Hertz5ee94542015-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)
60$$(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 Hertz5ee94542015-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 Hertz5ee94542015-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 Gampeb91205e2015-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
Ian Rogers40e19122014-09-02 15:59:28 -0700259# Tests that are broken with GC stress.
Mathieu Chartierbdeb9b72015-01-07 17:42:07 -0800260TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
Ian Rogers40e19122014-09-02 15:59:28 -0700261
262ifneq (,$(filter gcstress,$(GC_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100263 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700264 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000265 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DBEUGGABLE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700266endif
267
268TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
269
Ian Rogersf5c44b32014-08-19 16:52:36 -0700270# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100271ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000272 $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), 115-native-bridge, \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700273 $(ALL_ADDRESS_SIZES))
274
Andreas Gampe3a913092015-01-10 00:26:17 -0800275# 130-hprof dumps the heap and runs hprof-conv to check whether the file is somewhat readable. This
276# is only possible on the host.
277# TODO: Turn off all the other combinations, this is more about testing actual ART code. A gtest is
278# very hard to write here, as (for a complete test) JDWP must be set up.
279ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
280 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000281 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),130-hprof,$(ALL_ADDRESS_SIZES))
Andreas Gampe3a913092015-01-10 00:26:17 -0800282
Andreas Gampe94329d32015-04-24 20:22:06 -0700283# 131 is an old test. The functionality has been implemented at an earlier stage and is checked
284# in tests 138.
285ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
286 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
287 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),131-structural-change,$(ALL_ADDRESS_SIZES))
288
Andreas Gampe0fc16a02015-06-03 15:43:16 -0700289# 138-duplicate-classes-check. Turned off temporarily, b/21333911.
290ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
291 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
292 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),138-duplicate-classes-check,$(ALL_ADDRESS_SIZES))
293
Alex Light03a112d2014-08-25 13:25:56 -0700294# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
295# Therefore we shouldn't run them in situations where we actually don't have these since they
296# explicitly test for them. These all also assume we have an image.
297TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
298 116-nodex2oat \
299 117-nopatchoat \
300 118-noimage-dex2oat \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700301 119-noimage-patchoat \
David Srbeckya26cb572015-04-22 18:57:06 -0700302 137-cfi \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700303 138-duplicate-classes-check2
304
305# This test fails without an image.
306TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS := \
David Srbeckya26cb572015-04-22 18:57:06 -0700307 137-cfi \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700308 138-duplicate-classes-check
Alex Light03a112d2014-08-25 13:25:56 -0700309
Ian Rogers40e19122014-09-02 15:59:28 -0700310ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100311 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
Ian Rogers40e19122014-09-02 15:59:28 -0700312 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000313 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700314endif
Alex Light03a112d2014-08-25 13:25:56 -0700315
Alex Light03a112d2014-08-25 13:25:56 -0700316
Ian Rogers40e19122014-09-02 15:59:28 -0700317ifneq (,$(filter no-image,$(IMAGE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100318 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700319 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000320 $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700321 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
322 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
323 $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700324endif
325
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700326ifneq (,$(filter relocate-npatchoat,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100327 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700328 $(COMPILER_TYPES), relocate-npatchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000329 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700330endif
Alex Light03a112d2014-08-25 13:25:56 -0700331
Ian Rogers86df3ac2014-08-27 10:54:11 -0700332TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
333
David Srbeckya26cb572015-04-22 18:57:06 -0700334# 137:
335# This test unrolls and expects managed frames, but tracing means we run the interpreter.
336# 802:
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800337# This test dynamically enables tracing to force a deoptimization. This makes the test meaningless
338# when already tracing, and writes an error message that we do not want to check for.
339TEST_ART_BROKEN_TRACING_RUN_TESTS := \
David Srbeckya26cb572015-04-22 18:57:06 -0700340 137-cfi \
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800341 802-deoptimization
342
Andreas Gampeb91205e2015-06-22 22:53:45 -0700343ifneq (,$(filter trace stream,$(TRACE_TYPES)))
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800344 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Andreas Gampeb91205e2015-06-22 22:53:45 -0700345 $(COMPILER_TYPES),$(RELOCATE_TYPES),trace stream,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000346 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800347endif
348
349TEST_ART_BROKEN_TRACING_RUN_TESTS :=
350
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100351# The following tests use libarttest.so, which is linked against libartd.so, so will
352# not work when libart.so is the one loaded.
353# TODO: Find a way to run these tests in ndebug mode.
354TEST_ART_BROKEN_NDEBUG_TESTS := \
355 004-JniTest \
356 004-ReferenceMap \
357 004-SignalTest \
358 004-StackWalk \
359 004-UnsafeTest \
Nicolas Geoffray64dea7e2014-11-07 14:32:42 +0000360 051-thread \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100361 115-native-bridge \
362 116-nodex2oat \
363 117-nopatchoat \
364 118-noimage-dex2oat \
365 119-noimage-patchoat \
Nicolas Geoffray8c9200a2015-01-15 08:42:47 +0000366 131-structural-change \
David Srbeckya26cb572015-04-22 18:57:06 -0700367 137-cfi \
Andreas Gampe82566092015-05-18 15:52:22 -0700368 139-register-natives \
Nicolas Geoffrayd845fd02015-03-03 12:43:45 +0000369 454-get-vreg \
370 455-set-vreg \
Nicolas Geoffray64d69ab2015-03-10 19:26:24 +0000371 457-regs \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +0000372 461-get-reference-vreg \
Nicolas Geoffrayd8126be2015-03-27 10:22:41 +0000373 466-get-live-vreg \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100374
375ifneq (,$(filter ndebug,$(RUN_TYPES)))
376 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
377 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000378 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100379endif
380
381TEST_ART_BROKEN_NDEBUG_TESTS :=
382
David Srbeckya26cb572015-04-22 18:57:06 -0700383# Known broken tests for the interpreter.
384# CFI unwinding expects managed frames.
385TEST_ART_BROKEN_INTERPRETER_RUN_TESTS := \
386 137-cfi
387
388ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
389 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
390 interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
391 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_INTERPRETER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
392endif
393
394TEST_ART_BROKEN_INTERPRETER_RUN_TESTS :=
395
396# Known broken tests for the JIT.
397# CFI unwinding expects managed frames, and the test does not iterate enough to even compile. JIT
398# also uses Generic JNI instead of the JNI compiler.
399TEST_ART_BROKEN_JIT_RUN_TESTS := \
400 137-cfi
401
402ifneq (,$(filter jit,$(COMPILER_TYPES)))
403 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
404 jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
405 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_JIT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
406endif
407
408TEST_ART_BROKEN_JIT_RUN_TESTS :=
409
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100410# Known broken tests for the default compiler (Quick).
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000411TEST_ART_BROKEN_DEFAULT_RUN_TESTS := \
412 457-regs
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100413
414ifneq (,$(filter default,$(COMPILER_TYPES)))
415 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Nicolas Geoffray83cae422014-10-22 15:08:03 +0100416 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000417 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100418endif
419
420TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
421
Roland Levillain232ade02015-04-20 15:14:36 +0100422# Known broken tests for Quick's and Optimizing's ARM back ends.
423TEST_ART_BROKEN_ARM_RUN_TESTS := 477-long-to-float-conversion-precision # b/20413424
424
425ifeq ($(TARGET_ARCH),arm)
426 ifneq (,$(filter 32,$(ALL_ADDRESS_SIZES)))
427 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
428 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
429 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_ARM_RUN_TESTS),32)
430 endif
431endif
432
Roland Levillain0a025d22015-04-23 15:02:51 +0100433ifdef TARGET_2ND_ARCH
434 ifeq ($(TARGET_2ND_ARCH),arm)
435 ifneq (,$(filter 32,$(ALL_ADDRESS_SIZES)))
436 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
437 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
438 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_ARM_RUN_TESTS),32)
439 endif
440 endif
441endif
442
Roland Levillain232ade02015-04-20 15:14:36 +0100443TEST_ART_BROKEN_ARM_RUN_TESTS :=
444
Alexandre Rames5319def2014-10-23 10:03:10 +0100445# Known broken tests for the arm64 optimizing compiler backend.
Serban Constantinescu02d81cc2015-01-05 16:08:49 +0000446TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100447
448ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
449 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
450 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000451 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS),64)
Alexandre Rames5319def2014-10-23 10:03:10 +0100452endif
453
454TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
455
Roland Levillaina1935c42015-06-26 16:12:18 +0100456# Known broken tests for the MIPS64 optimizing compiler backend in 64-bit mode. b/21555893
457TEST_ART_BROKEN_OPTIMIZING_MIPS64_64BIT_RUN_TESTS := \
Roland Levillaina1935c42015-06-26 16:12:18 +0100458 449-checker-bce
459
460ifeq ($(TARGET_ARCH),mips64)
461 ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
462 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
463 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
464 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_MIPS64_64BIT_RUN_TESTS),64)
465 endif
466endif
467
468TEST_ART_BROKEN_OPTIMIZING_MIPS64_64BIT_RUN_TESTS :=
469
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100470# Known broken tests for the optimizing compiler.
Nicolas Geoffrayaa8dd2f2015-01-23 17:48:28 +0000471TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100472
473ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
474 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
475 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000476 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100477endif
478
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000479# If ART_USE_OPTIMIZING_COMPILER is set to true, then the default core.art has been
480# compiled with the optimizing compiler.
481ifeq ($(ART_USE_OPTIMIZING_COMPILER),true)
482 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
483 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000484 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000485endif
486
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100487TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
488
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000489# Tests that should fail when the optimizing compiler compiles them non-debuggable.
490TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS := \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +0000491 454-get-vreg \
492 455-set-vreg \
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000493 457-regs \
494
495ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
496 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
497 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700498 $(IMAGE_TYPES),$(PICTEST_TYPES),ndebuggable,$(TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000499endif
500
501TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
502
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000503# Tests that should fail when the optimizing compiler compiles them debuggable.
504TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS := \
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000505
506ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
507 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
508 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
509 $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
510endif
511
512TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
513
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700514# Tests that should fail in the read barrier configuration.
David Srbeckya26cb572015-04-22 18:57:06 -0700515# 098: b/20720510
516# 137: Read barrier forces interpreter. Cannot run this with the interpreter.
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700517TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS := \
David Srbeckya26cb572015-04-22 18:57:06 -0700518 098-ddmc \
519 137-cfi \
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700520
521ifeq ($(ART_USE_READ_BARRIER),true)
522 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
523 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
524 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
525endif
526
527TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100528
David Srbeckya26cb572015-04-22 18:57:06 -0700529# Tests that should fail in the heap poisoning configuration.
530# 137: Heap poisoning forces interpreter. Cannot run this with the interpreter.
531TEST_ART_BROKEN_HEAP_POISONING_RUN_TESTS := \
532 137-cfi
533
534ifeq ($(ART_HEAP_POISONING),true)
535 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
536 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
537 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
538endif
539
540TEST_ART_BROKEN_HEAP_POISONING_RUN_TESTS :=
541
Ian Rogersf5c44b32014-08-19 16:52:36 -0700542# Clear variables ahead of appending to them when defining tests.
543$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
544$(foreach target, $(TARGET_TYPES), \
545 $(foreach prebuild, $(PREBUILD_TYPES), \
546 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
547$(foreach target, $(TARGET_TYPES), \
548 $(foreach compiler, $(COMPILER_TYPES), \
549 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
550$(foreach target, $(TARGET_TYPES), \
551 $(foreach relocate, $(RELOCATE_TYPES), \
552 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
553$(foreach target, $(TARGET_TYPES), \
554 $(foreach trace, $(TRACE_TYPES), \
555 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
556$(foreach target, $(TARGET_TYPES), \
557 $(foreach gc, $(GC_TYPES), \
558 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
559$(foreach target, $(TARGET_TYPES), \
560 $(foreach jni, $(JNI_TYPES), \
561 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
562$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700563 $(foreach image, $(IMAGE_TYPES), \
564 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
565$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700566 $(foreach test, $(TEST_ART_RUN_TESTS), \
567 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
568$(foreach target, $(TARGET_TYPES), \
569 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
570 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100571$(foreach target, $(TARGET_TYPES), \
572 $(foreach run_type, $(RUN_TYPES), \
573 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000574$(foreach target, $(TARGET_TYPES), \
575 $(foreach debuggable_type, $(DEBUGGABLE_TYPES), \
576 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700577
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700578# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
579# only once).
580TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700581
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700582# Also need libarttest.
583TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
584ifdef TARGET_2ND_ARCH
585TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
586endif
587
Andreas Gampe855564b2014-07-25 02:32:19 -0700588# Also need libnativebridgetest.
589TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
590ifdef TARGET_2ND_ARCH
591TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
592endif
593
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700594# All tests require the host executables. The tests also depend on the core images, but on
595# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700596ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
597 $(ART_HOST_EXECUTABLES) \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700598 $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700599 $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700600 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700601
602ifneq ($(HOST_PREFER_32_BIT),true)
603ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700604 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700605 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700606 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700607endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700608
Ian Rogersf5c44b32014-08-19 16:52:36 -0700609# Create a rule to build and run a tests following the form:
Calin Juravle9228b2a2014-10-22 15:54:34 +0100610# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700611# {4: interpreter default optimizing jit}-{5: relocate nrelocate relocate-npatchoat}-
612# {6: trace or ntrace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
613# {9: no-image image picimage}-{10: pictest npictest}-
614# {11: ndebuggable debuggable}-{12: test name}{13: 32 or 64}
Ian Rogersafd9acc2014-06-17 08:21:54 -0700615define define-test-art-run-test
Nicolas Geoffray611e1db2014-10-09 17:34:45 +0100616 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700617 prereq_rule :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700618 test_groups :=
619 uc_host_or_target :=
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100620 jack_classpath :=
621 ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
622 run_test_options += --build-with-jack
623 else
624 run_test_options += --build-with-javac-dx
625 endif
Alex Lightbfac14a2014-07-30 09:41:21 -0700626 ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
627 run_test_options += --always-clean
628 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700629 ifeq ($(1),host)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700630 uc_host_or_target := HOST
Ian Rogersf5c44b32014-08-19 16:52:36 -0700631 test_groups := ART_RUN_TEST_HOST_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700632 run_test_options += --host
633 prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100634 jack_classpath := $(HOST_JACK_CLASSPATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700635 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700636 ifeq ($(1),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700637 uc_host_or_target := TARGET
Ian Rogersf5c44b32014-08-19 16:52:36 -0700638 test_groups := ART_RUN_TEST_TARGET_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700639 prereq_rule := test-art-target-sync
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100640 jack_classpath := $(TARGET_JACK_CLASSPATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700641 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700642 $$(error found $(1) expected $(TARGET_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700643 endif
644 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100645 ifeq ($(2),debug)
646 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
647 else
648 ifeq ($(2),ndebug)
649 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
650 run_test_options += -O
651 else
652 $$(error found $(2) expected $(RUN_TYPES))
653 endif
654 endif
655 ifeq ($(3),prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700656 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
657 run_test_options += --prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700658 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100659 ifeq ($(3),no-prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700660 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
661 run_test_options += --no-prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700662 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100663 ifeq ($(3),no-dex2oat)
Alex Light03a112d2014-08-25 13:25:56 -0700664 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
665 run_test_options += --no-prebuild --no-dex2oat
666 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100667 $$(error found $(3) expected $(PREBUILD_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700668 endif
Alex Lighta59dd802014-07-02 16:28:08 -0700669 endif
670 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100671 ifeq ($(4),optimizing)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700672 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700673 run_test_options += --optimizing
Ian Rogersafd9acc2014-06-17 08:21:54 -0700674 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100675 ifeq ($(4),interpreter)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700676 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700677 run_test_options += --interpreter
678 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100679 ifeq ($(4),default)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700680 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
Nicolas Geoffrayc9338b92014-12-03 13:36:10 +0000681 run_test_options += --quick
Ian Rogersafd9acc2014-06-17 08:21:54 -0700682 else
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800683 ifeq ($(4),jit)
Mathieu Chartier3fc1b122015-02-26 10:58:08 -0800684 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JIT_RULES
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800685 run_test_options += --jit
686 else
687 $$(error found $(4) expected $(COMPILER_TYPES))
688 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700689 endif
690 endif
691 endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700692
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100693 ifeq ($(5),relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700694 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
695 run_test_options += --relocate
Ian Rogersafd9acc2014-06-17 08:21:54 -0700696 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100697 ifeq ($(5),no-relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700698 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
699 run_test_options += --no-relocate
700 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700701 ifeq ($(5),relocate-npatchoat)
Alex Light03a112d2014-08-25 13:25:56 -0700702 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
703 run_test_options += --relocate --no-patchoat
704 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100705 $$(error found $(5) expected $(RELOCATE_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700706 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700707 endif
708 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100709 ifeq ($(6),trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700710 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
Ian Rogers716e4f82014-07-16 11:18:03 -0700711 run_test_options += --trace
Ian Rogers716e4f82014-07-16 11:18:03 -0700712 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700713 ifeq ($(6),ntrace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700714 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
Ian Rogers701aa642014-07-18 11:38:13 -0700715 else
Andreas Gampeb91205e2015-06-22 22:53:45 -0700716 ifeq ($(6),stream)
717 # Group streaming under normal tracing rules.
718 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
719 run_test_options += --trace --stream
720 else
721 $$(error found $(6) expected $(TRACE_TYPES))
722 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700723 endif
724 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100725 ifeq ($(7),gcverify)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700726 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700727 run_test_options += --gcverify
728 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100729 ifeq ($(7),gcstress)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700730 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700731 run_test_options += --gcstress
732 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100733 ifeq ($(7),cms)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700734 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
Ian Rogers8a14b752014-07-18 15:06:53 -0700735 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100736 $$(error found $(7) expected $(GC_TYPES))
Ian Rogers701aa642014-07-18 11:38:13 -0700737 endif
Ian Rogers716e4f82014-07-16 11:18:03 -0700738 endif
739 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100740 ifeq ($(8),forcecopy)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700741 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700742 run_test_options += --runtime-option -Xjniopts:forcecopy
743 ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
744 skip_test := true
745 endif
746 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100747 ifeq ($(8),checkjni)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700748 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700749 run_test_options += --runtime-option -Xcheck:jni
750 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100751 ifeq ($(8),jni)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700752 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
753 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100754 $$(error found $(8) expected $(JNI_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700755 endif
756 endif
757 endif
Mathieu Chartiere2a12c02015-02-27 13:21:15 -0800758 ifeq ($(4),jit)
759 # Use interpreter image for JIT.
760 image_suffix := interpreter
761 else
762 image_suffix := $(4)
763 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100764 ifeq ($(9),no-image)
Alex Light03a112d2014-08-25 13:25:56 -0700765 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
766 run_test_options += --no-image
Andreas Gampebf03e842014-10-29 20:46:17 -0700767 # Add the core dependency. This is required for pre-building.
768 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000769 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700770 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000771 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700772 endif
Alex Light03a112d2014-08-25 13:25:56 -0700773 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100774 ifeq ($(9),image)
Alex Light03a112d2014-08-25 13:25:56 -0700775 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
Andreas Gampec23c9c92014-10-28 14:47:25 -0700776 # Add the core dependency.
777 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000778 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700779 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000780 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700781 endif
Alex Light03a112d2014-08-25 13:25:56 -0700782 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700783 ifeq ($(9),picimage)
784 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
785 run_test_options += --pic-image
786 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000787 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700788 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000789 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700790 endif
791 else
792 $$(error found $(9) expected $(IMAGE_TYPES))
793 endif
Alex Light03a112d2014-08-25 13:25:56 -0700794 endif
795 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700796 ifeq ($(10),pictest)
797 run_test_options += --pic-test
798 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700799 ifeq ($(10),npictest)
Andreas Gampec23c9c92014-10-28 14:47:25 -0700800 # Nothing to be done.
801 else
802 $$(error found $(10) expected $(PICTEST_TYPES))
803 endif
804 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000805 ifeq ($(11),debuggable)
806 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUGGABLE_RULES
807 run_test_options += --debuggable
808 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700809 ifeq ($(11),ndebuggable)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000810 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NONDEBUGGABLE_RULES
811 # Nothing to be done.
812 else
813 $$(error found $(11) expected $(DEBUGGABLE_TYPES))
814 endif
815 endif
816 # $(12) is the test name.
817 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(12))_RULES
818 ifeq ($(13),64)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700819 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
820 run_test_options += --64
821 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000822 ifeq ($(13),32)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700823 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
824 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000825 $$(error found $(13) expected $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700826 endif
827 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000828 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 -0700829 run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
Ian Rogers5242c0a2014-07-18 11:02:19 -0700830 $$(run_test_options)
Nicolas Geoffrayc8f23fc2014-10-28 17:59:47 +0000831 ifneq ($(ART_TEST_ANDROID_ROOT),)
832 run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
833 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700834$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100835$$(run_test_rule_name): PRIVATE_JACK_CLASSPATH := $$(jack_classpath)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700836.PHONY: $$(run_test_rule_name)
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100837$$(run_test_rule_name): $(TEST_ART_RUN_TEST_DEPENDENCIES) $(HOST_OUT_EXECUTABLES)/hprof-conv $$(prereq_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700838 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100839 DX=$(abspath $(DX)) \
840 JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700841 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
842 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100843 JACK=$(abspath $(JACK)) \
844 JACK_VM_COMMAND="$(JACK_VM) $(DEFAULT_JACK_VM_ARGS) $(JAVA_TMPDIR_ARG) -jar $(abspath $(JACK_LAUNCHER_JAR)) " \
845 JACK_CLASSPATH=$$(PRIVATE_JACK_CLASSPATH) \
846 JACK_JAR=$(abspath $(JACK_JAR)) \
847 JILL_JAR=$(abspath $(JILL_JAR)) \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000848 art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(12) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700849 && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
850 $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
851 echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
852 rm -r $(ART_HOST_TEST_DIR)) || true
853
Ian Rogersf5c44b32014-08-19 16:52:36 -0700854 $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700855
856 # Clear locally defined variables.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700857 uc_host_or_target :=
858 test_groups :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700859 run_test_options :=
860 run_test_rule_name :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700861 prereq_rule :=
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100862 jack_classpath :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700863endef # define-test-art-run-test
864
Ian Rogersf5c44b32014-08-19 16:52:36 -0700865$(foreach target, $(TARGET_TYPES), \
866 $(foreach test, $(TEST_ART_RUN_TESTS), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100867 $(foreach run_type, $(RUN_TYPES), \
868 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
869 $(foreach prebuild, $(PREBUILD_TYPES), \
870 $(foreach compiler, $(COMPILER_TYPES), \
871 $(foreach relocate, $(RELOCATE_TYPES), \
872 $(foreach trace, $(TRACE_TYPES), \
873 $(foreach gc, $(GC_TYPES), \
874 $(foreach jni, $(JNI_TYPES), \
875 $(foreach image, $(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700876 $(foreach pictest, $(PICTEST_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000877 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
878 $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(debuggable),$(test),$(address_size))) \
879 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700880define-test-art-run-test :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700881
Ian Rogersafd9acc2014-06-17 08:21:54 -0700882# Define a phony rule whose purpose is to test its prerequisites.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700883# $(1): host or target
Ian Rogersafd9acc2014-06-17 08:21:54 -0700884# $(2): list of prerequisites
Ian Rogersf5c44b32014-08-19 16:52:36 -0700885define define-test-art-run-test-group
Ian Rogersafd9acc2014-06-17 08:21:54 -0700886.PHONY: $(1)
887$(1): $(2)
888 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
889
Ian Rogersafd9acc2014-06-17 08:21:54 -0700890endef # define-test-art-run-test-group
891
Ian Rogersafd9acc2014-06-17 08:21:54 -0700892
Ian Rogersf5c44b32014-08-19 16:52:36 -0700893$(foreach target, $(TARGET_TYPES), $(eval \
894 $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
895$(foreach target, $(TARGET_TYPES), \
896 $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
897 $(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)))))
898$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100899 $(foreach run-type, $(RUN_TYPES), $(eval \
900 $(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)))))
901$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700902 $(foreach compiler, $(COMPILER_TYPES), $(eval \
903 $(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)))))
904$(foreach target, $(TARGET_TYPES), \
905 $(foreach relocate, $(RELOCATE_TYPES), $(eval \
906 $(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)))))
907$(foreach target, $(TARGET_TYPES), \
908 $(foreach trace, $(TRACE_TYPES), $(eval \
909 $(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)))))
910$(foreach target, $(TARGET_TYPES), \
911 $(foreach gc, $(GC_TYPES), $(eval \
912 $(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)))))
913$(foreach target, $(TARGET_TYPES), \
914 $(foreach jni, $(JNI_TYPES), $(eval \
915 $(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)))))
916$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000917 $(foreach debuggable, $(DEBUGGABLE_TYPES), $(eval \
918 $(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)))))
919$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700920 $(foreach image, $(IMAGE_TYPES), $(eval \
921 $(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)))))
922$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700923 $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
924 $(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)))))
925$(foreach target, $(TARGET_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700926 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
Ian Rogersa3cf6ce2014-10-02 16:35:52 -0700927 $(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 -0700928
Ian Rogersf5c44b32014-08-19 16:52:36 -0700929# Clear variables now we're finished with them.
930$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
931$(foreach target, $(TARGET_TYPES), \
932 $(foreach prebuild, $(PREBUILD_TYPES), \
933 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
934$(foreach target, $(TARGET_TYPES), \
935 $(foreach compiler, $(COMPILER_TYPES), \
936 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
937$(foreach target, $(TARGET_TYPES), \
938 $(foreach relocate, $(RELOCATE_TYPES), \
939 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
940$(foreach target, $(TARGET_TYPES), \
941 $(foreach trace, $(TRACE_TYPES), \
942 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
943$(foreach target, $(TARGET_TYPES), \
944 $(foreach gc, $(GC_TYPES), \
945 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
946$(foreach target, $(TARGET_TYPES), \
947 $(foreach jni, $(JNI_TYPES), \
948 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
949$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000950 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
951 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES :=)))
952$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700953 $(foreach image, $(IMAGE_TYPES), \
954 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
955$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700956 $(foreach test, $(TEST_ART_RUN_TESTS), \
957 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
958$(foreach target, $(TARGET_TYPES), \
959 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
960 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100961$(foreach target, $(TARGET_TYPES), \
962 $(foreach run_type, $(RUN_TYPES), \
963 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700964define-test-art-run-test-group :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700965TARGET_TYPES :=
966PREBUILD_TYPES :=
967COMPILER_TYPES :=
968RELOCATE_TYPES :=
969TRACE_TYPES :=
970GC_TYPES :=
971JNI_TYPES :=
Alex Light03a112d2014-08-25 13:25:56 -0700972IMAGE_TYPES :=
Ian Rogers86df3ac2014-08-27 10:54:11 -0700973ADDRESS_SIZES_TARGET :=
974ADDRESS_SIZES_HOST :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700975ALL_ADDRESS_SIZES :=
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100976RUN_TYPES :=
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000977DEBUGGABLE_TYPES :=
Ian Rogers9fcaa4b2014-08-26 19:59:52 -0700978
979include $(LOCAL_PATH)/Android.libarttest.mk
980include art/test/Android.libnativebridgetest.mk