blob: cf4c610698b58bb50c3b2bc10fdc0ca66aabb356 [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
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100456# Known broken tests for the optimizing compiler.
Nicolas Geoffrayaa8dd2f2015-01-23 17:48:28 +0000457TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100458
459ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
460 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
461 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000462 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100463endif
464
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000465# If ART_USE_OPTIMIZING_COMPILER is set to true, then the default core.art has been
466# compiled with the optimizing compiler.
467ifeq ($(ART_USE_OPTIMIZING_COMPILER),true)
468 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
469 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000470 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000471endif
472
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100473TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
474
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000475# Tests that should fail when the optimizing compiler compiles them non-debuggable.
476TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS := \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +0000477 454-get-vreg \
478 455-set-vreg \
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000479 457-regs \
480
481ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
482 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
483 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700484 $(IMAGE_TYPES),$(PICTEST_TYPES),ndebuggable,$(TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000485endif
486
487TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
488
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000489# Tests that should fail when the optimizing compiler compiles them debuggable.
490TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS := \
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000491
492ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
493 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
494 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
495 $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
496endif
497
498TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
499
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700500# Tests that should fail in the read barrier configuration.
David Srbeckya26cb572015-04-22 18:57:06 -0700501# 098: b/20720510
502# 137: Read barrier forces interpreter. Cannot run this with the interpreter.
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700503TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS := \
David Srbeckya26cb572015-04-22 18:57:06 -0700504 098-ddmc \
505 137-cfi \
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700506
507ifeq ($(ART_USE_READ_BARRIER),true)
508 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
509 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
510 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
511endif
512
513TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100514
David Srbeckya26cb572015-04-22 18:57:06 -0700515# Tests that should fail in the heap poisoning configuration.
516# 137: Heap poisoning forces interpreter. Cannot run this with the interpreter.
517TEST_ART_BROKEN_HEAP_POISONING_RUN_TESTS := \
518 137-cfi
519
520ifeq ($(ART_HEAP_POISONING),true)
521 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
522 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
523 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
524endif
525
526TEST_ART_BROKEN_HEAP_POISONING_RUN_TESTS :=
527
Ian Rogersf5c44b32014-08-19 16:52:36 -0700528# Clear variables ahead of appending to them when defining tests.
529$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
530$(foreach target, $(TARGET_TYPES), \
531 $(foreach prebuild, $(PREBUILD_TYPES), \
532 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
533$(foreach target, $(TARGET_TYPES), \
534 $(foreach compiler, $(COMPILER_TYPES), \
535 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
536$(foreach target, $(TARGET_TYPES), \
537 $(foreach relocate, $(RELOCATE_TYPES), \
538 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
539$(foreach target, $(TARGET_TYPES), \
540 $(foreach trace, $(TRACE_TYPES), \
541 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
542$(foreach target, $(TARGET_TYPES), \
543 $(foreach gc, $(GC_TYPES), \
544 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
545$(foreach target, $(TARGET_TYPES), \
546 $(foreach jni, $(JNI_TYPES), \
547 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
548$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700549 $(foreach image, $(IMAGE_TYPES), \
550 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
551$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700552 $(foreach test, $(TEST_ART_RUN_TESTS), \
553 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
554$(foreach target, $(TARGET_TYPES), \
555 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
556 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100557$(foreach target, $(TARGET_TYPES), \
558 $(foreach run_type, $(RUN_TYPES), \
559 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000560$(foreach target, $(TARGET_TYPES), \
561 $(foreach debuggable_type, $(DEBUGGABLE_TYPES), \
562 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700563
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700564# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
565# only once).
566TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700567
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700568# Also need libarttest.
569TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
570ifdef TARGET_2ND_ARCH
571TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
572endif
573
Andreas Gampe855564b2014-07-25 02:32:19 -0700574# Also need libnativebridgetest.
575TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
576ifdef TARGET_2ND_ARCH
577TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
578endif
579
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700580# All tests require the host executables. The tests also depend on the core images, but on
581# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700582ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
583 $(ART_HOST_EXECUTABLES) \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700584 $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700585 $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700586 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700587
588ifneq ($(HOST_PREFER_32_BIT),true)
589ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700590 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700591 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700592 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700593endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700594
Ian Rogersf5c44b32014-08-19 16:52:36 -0700595# Create a rule to build and run a tests following the form:
Calin Juravle9228b2a2014-10-22 15:54:34 +0100596# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700597# {4: interpreter default optimizing jit}-{5: relocate nrelocate relocate-npatchoat}-
598# {6: trace or ntrace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
599# {9: no-image image picimage}-{10: pictest npictest}-
600# {11: ndebuggable debuggable}-{12: test name}{13: 32 or 64}
Ian Rogersafd9acc2014-06-17 08:21:54 -0700601define define-test-art-run-test
Nicolas Geoffray611e1db2014-10-09 17:34:45 +0100602 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700603 prereq_rule :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700604 test_groups :=
605 uc_host_or_target :=
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100606 jack_classpath :=
607 ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
608 run_test_options += --build-with-jack
609 else
610 run_test_options += --build-with-javac-dx
611 endif
Alex Lightbfac14a2014-07-30 09:41:21 -0700612 ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
613 run_test_options += --always-clean
614 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700615 ifeq ($(1),host)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700616 uc_host_or_target := HOST
Ian Rogersf5c44b32014-08-19 16:52:36 -0700617 test_groups := ART_RUN_TEST_HOST_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700618 run_test_options += --host
619 prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100620 jack_classpath := $(HOST_JACK_CLASSPATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700621 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700622 ifeq ($(1),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700623 uc_host_or_target := TARGET
Ian Rogersf5c44b32014-08-19 16:52:36 -0700624 test_groups := ART_RUN_TEST_TARGET_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700625 prereq_rule := test-art-target-sync
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100626 jack_classpath := $(TARGET_JACK_CLASSPATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700627 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700628 $$(error found $(1) expected $(TARGET_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700629 endif
630 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100631 ifeq ($(2),debug)
632 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
633 else
634 ifeq ($(2),ndebug)
635 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
636 run_test_options += -O
637 else
638 $$(error found $(2) expected $(RUN_TYPES))
639 endif
640 endif
641 ifeq ($(3),prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700642 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
643 run_test_options += --prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700644 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100645 ifeq ($(3),no-prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700646 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
647 run_test_options += --no-prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700648 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100649 ifeq ($(3),no-dex2oat)
Alex Light03a112d2014-08-25 13:25:56 -0700650 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
651 run_test_options += --no-prebuild --no-dex2oat
652 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100653 $$(error found $(3) expected $(PREBUILD_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700654 endif
Alex Lighta59dd802014-07-02 16:28:08 -0700655 endif
656 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100657 ifeq ($(4),optimizing)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700658 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700659 run_test_options += --optimizing
Ian Rogersafd9acc2014-06-17 08:21:54 -0700660 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100661 ifeq ($(4),interpreter)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700662 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700663 run_test_options += --interpreter
664 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100665 ifeq ($(4),default)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700666 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
Nicolas Geoffrayc9338b92014-12-03 13:36:10 +0000667 run_test_options += --quick
Ian Rogersafd9acc2014-06-17 08:21:54 -0700668 else
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800669 ifeq ($(4),jit)
Mathieu Chartier3fc1b122015-02-26 10:58:08 -0800670 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JIT_RULES
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800671 run_test_options += --jit
672 else
673 $$(error found $(4) expected $(COMPILER_TYPES))
674 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700675 endif
676 endif
677 endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700678
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100679 ifeq ($(5),relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700680 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
681 run_test_options += --relocate
Ian Rogersafd9acc2014-06-17 08:21:54 -0700682 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100683 ifeq ($(5),no-relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700684 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
685 run_test_options += --no-relocate
686 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700687 ifeq ($(5),relocate-npatchoat)
Alex Light03a112d2014-08-25 13:25:56 -0700688 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
689 run_test_options += --relocate --no-patchoat
690 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100691 $$(error found $(5) expected $(RELOCATE_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700692 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700693 endif
694 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100695 ifeq ($(6),trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700696 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
Ian Rogers716e4f82014-07-16 11:18:03 -0700697 run_test_options += --trace
Ian Rogers716e4f82014-07-16 11:18:03 -0700698 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700699 ifeq ($(6),ntrace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700700 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
Ian Rogers701aa642014-07-18 11:38:13 -0700701 else
Andreas Gampeb91205e2015-06-22 22:53:45 -0700702 ifeq ($(6),stream)
703 # Group streaming under normal tracing rules.
704 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
705 run_test_options += --trace --stream
706 else
707 $$(error found $(6) expected $(TRACE_TYPES))
708 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700709 endif
710 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100711 ifeq ($(7),gcverify)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700712 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700713 run_test_options += --gcverify
714 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100715 ifeq ($(7),gcstress)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700716 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700717 run_test_options += --gcstress
718 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100719 ifeq ($(7),cms)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700720 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
Ian Rogers8a14b752014-07-18 15:06:53 -0700721 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100722 $$(error found $(7) expected $(GC_TYPES))
Ian Rogers701aa642014-07-18 11:38:13 -0700723 endif
Ian Rogers716e4f82014-07-16 11:18:03 -0700724 endif
725 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100726 ifeq ($(8),forcecopy)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700727 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700728 run_test_options += --runtime-option -Xjniopts:forcecopy
729 ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
730 skip_test := true
731 endif
732 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100733 ifeq ($(8),checkjni)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700734 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700735 run_test_options += --runtime-option -Xcheck:jni
736 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100737 ifeq ($(8),jni)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700738 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
739 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100740 $$(error found $(8) expected $(JNI_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700741 endif
742 endif
743 endif
Mathieu Chartiere2a12c02015-02-27 13:21:15 -0800744 ifeq ($(4),jit)
745 # Use interpreter image for JIT.
746 image_suffix := interpreter
747 else
748 image_suffix := $(4)
749 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100750 ifeq ($(9),no-image)
Alex Light03a112d2014-08-25 13:25:56 -0700751 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
752 run_test_options += --no-image
Andreas Gampebf03e842014-10-29 20:46:17 -0700753 # Add the core dependency. This is required for pre-building.
754 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000755 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700756 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000757 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700758 endif
Alex Light03a112d2014-08-25 13:25:56 -0700759 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100760 ifeq ($(9),image)
Alex Light03a112d2014-08-25 13:25:56 -0700761 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
Andreas Gampec23c9c92014-10-28 14:47:25 -0700762 # Add the core dependency.
763 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000764 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700765 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000766 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700767 endif
Alex Light03a112d2014-08-25 13:25:56 -0700768 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700769 ifeq ($(9),picimage)
770 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
771 run_test_options += --pic-image
772 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000773 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700774 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000775 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700776 endif
777 else
778 $$(error found $(9) expected $(IMAGE_TYPES))
779 endif
Alex Light03a112d2014-08-25 13:25:56 -0700780 endif
781 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700782 ifeq ($(10),pictest)
783 run_test_options += --pic-test
784 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700785 ifeq ($(10),npictest)
Andreas Gampec23c9c92014-10-28 14:47:25 -0700786 # Nothing to be done.
787 else
788 $$(error found $(10) expected $(PICTEST_TYPES))
789 endif
790 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000791 ifeq ($(11),debuggable)
792 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUGGABLE_RULES
793 run_test_options += --debuggable
794 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700795 ifeq ($(11),ndebuggable)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000796 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NONDEBUGGABLE_RULES
797 # Nothing to be done.
798 else
799 $$(error found $(11) expected $(DEBUGGABLE_TYPES))
800 endif
801 endif
802 # $(12) is the test name.
803 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(12))_RULES
804 ifeq ($(13),64)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700805 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
806 run_test_options += --64
807 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000808 ifeq ($(13),32)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700809 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
810 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000811 $$(error found $(13) expected $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700812 endif
813 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000814 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 -0700815 run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
Ian Rogers5242c0a2014-07-18 11:02:19 -0700816 $$(run_test_options)
Nicolas Geoffrayc8f23fc2014-10-28 17:59:47 +0000817 ifneq ($(ART_TEST_ANDROID_ROOT),)
818 run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
819 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700820$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100821$$(run_test_rule_name): PRIVATE_JACK_CLASSPATH := $$(jack_classpath)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700822.PHONY: $$(run_test_rule_name)
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100823$$(run_test_rule_name): $(TEST_ART_RUN_TEST_DEPENDENCIES) $(HOST_OUT_EXECUTABLES)/hprof-conv $$(prereq_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700824 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100825 DX=$(abspath $(DX)) \
826 JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700827 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
828 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100829 JACK=$(abspath $(JACK)) \
830 JACK_VM_COMMAND="$(JACK_VM) $(DEFAULT_JACK_VM_ARGS) $(JAVA_TMPDIR_ARG) -jar $(abspath $(JACK_LAUNCHER_JAR)) " \
831 JACK_CLASSPATH=$$(PRIVATE_JACK_CLASSPATH) \
832 JACK_JAR=$(abspath $(JACK_JAR)) \
833 JILL_JAR=$(abspath $(JILL_JAR)) \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000834 art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(12) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700835 && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
836 $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
837 echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
838 rm -r $(ART_HOST_TEST_DIR)) || true
839
Ian Rogersf5c44b32014-08-19 16:52:36 -0700840 $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700841
842 # Clear locally defined variables.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700843 uc_host_or_target :=
844 test_groups :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700845 run_test_options :=
846 run_test_rule_name :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700847 prereq_rule :=
Sebastien Hertz5ee94542015-02-24 17:39:50 +0100848 jack_classpath :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700849endef # define-test-art-run-test
850
Ian Rogersf5c44b32014-08-19 16:52:36 -0700851$(foreach target, $(TARGET_TYPES), \
852 $(foreach test, $(TEST_ART_RUN_TESTS), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100853 $(foreach run_type, $(RUN_TYPES), \
854 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
855 $(foreach prebuild, $(PREBUILD_TYPES), \
856 $(foreach compiler, $(COMPILER_TYPES), \
857 $(foreach relocate, $(RELOCATE_TYPES), \
858 $(foreach trace, $(TRACE_TYPES), \
859 $(foreach gc, $(GC_TYPES), \
860 $(foreach jni, $(JNI_TYPES), \
861 $(foreach image, $(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700862 $(foreach pictest, $(PICTEST_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000863 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
864 $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(debuggable),$(test),$(address_size))) \
865 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700866define-test-art-run-test :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700867
Ian Rogersafd9acc2014-06-17 08:21:54 -0700868# Define a phony rule whose purpose is to test its prerequisites.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700869# $(1): host or target
Ian Rogersafd9acc2014-06-17 08:21:54 -0700870# $(2): list of prerequisites
Ian Rogersf5c44b32014-08-19 16:52:36 -0700871define define-test-art-run-test-group
Ian Rogersafd9acc2014-06-17 08:21:54 -0700872.PHONY: $(1)
873$(1): $(2)
874 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
875
Ian Rogersafd9acc2014-06-17 08:21:54 -0700876endef # define-test-art-run-test-group
877
Ian Rogersafd9acc2014-06-17 08:21:54 -0700878
Ian Rogersf5c44b32014-08-19 16:52:36 -0700879$(foreach target, $(TARGET_TYPES), $(eval \
880 $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
881$(foreach target, $(TARGET_TYPES), \
882 $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
883 $(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)))))
884$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100885 $(foreach run-type, $(RUN_TYPES), $(eval \
886 $(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)))))
887$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700888 $(foreach compiler, $(COMPILER_TYPES), $(eval \
889 $(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)))))
890$(foreach target, $(TARGET_TYPES), \
891 $(foreach relocate, $(RELOCATE_TYPES), $(eval \
892 $(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)))))
893$(foreach target, $(TARGET_TYPES), \
894 $(foreach trace, $(TRACE_TYPES), $(eval \
895 $(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)))))
896$(foreach target, $(TARGET_TYPES), \
897 $(foreach gc, $(GC_TYPES), $(eval \
898 $(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)))))
899$(foreach target, $(TARGET_TYPES), \
900 $(foreach jni, $(JNI_TYPES), $(eval \
901 $(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)))))
902$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000903 $(foreach debuggable, $(DEBUGGABLE_TYPES), $(eval \
904 $(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)))))
905$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700906 $(foreach image, $(IMAGE_TYPES), $(eval \
907 $(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)))))
908$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700909 $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
910 $(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)))))
911$(foreach target, $(TARGET_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700912 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
Ian Rogersa3cf6ce2014-10-02 16:35:52 -0700913 $(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 -0700914
Ian Rogersf5c44b32014-08-19 16:52:36 -0700915# Clear variables now we're finished with them.
916$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
917$(foreach target, $(TARGET_TYPES), \
918 $(foreach prebuild, $(PREBUILD_TYPES), \
919 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
920$(foreach target, $(TARGET_TYPES), \
921 $(foreach compiler, $(COMPILER_TYPES), \
922 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
923$(foreach target, $(TARGET_TYPES), \
924 $(foreach relocate, $(RELOCATE_TYPES), \
925 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
926$(foreach target, $(TARGET_TYPES), \
927 $(foreach trace, $(TRACE_TYPES), \
928 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
929$(foreach target, $(TARGET_TYPES), \
930 $(foreach gc, $(GC_TYPES), \
931 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
932$(foreach target, $(TARGET_TYPES), \
933 $(foreach jni, $(JNI_TYPES), \
934 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
935$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000936 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
937 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES :=)))
938$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700939 $(foreach image, $(IMAGE_TYPES), \
940 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
941$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700942 $(foreach test, $(TEST_ART_RUN_TESTS), \
943 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
944$(foreach target, $(TARGET_TYPES), \
945 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
946 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100947$(foreach target, $(TARGET_TYPES), \
948 $(foreach run_type, $(RUN_TYPES), \
949 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700950define-test-art-run-test-group :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700951TARGET_TYPES :=
952PREBUILD_TYPES :=
953COMPILER_TYPES :=
954RELOCATE_TYPES :=
955TRACE_TYPES :=
956GC_TYPES :=
957JNI_TYPES :=
Alex Light03a112d2014-08-25 13:25:56 -0700958IMAGE_TYPES :=
Ian Rogers86df3ac2014-08-27 10:54:11 -0700959ADDRESS_SIZES_TARGET :=
960ADDRESS_SIZES_HOST :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700961ALL_ADDRESS_SIZES :=
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100962RUN_TYPES :=
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000963DEBUGGABLE_TYPES :=
Ian Rogers9fcaa4b2014-08-26 19:59:52 -0700964
965include $(LOCAL_PATH)/Android.libarttest.mk
966include art/test/Android.libnativebridgetest.mk