blob: 65ddf8da1770c3c3c239d53538d09855ba98b8ac [file] [log] [blame]
Ian Rogersafd9acc2014-06-17 08:21:54 -07001# Copyright (C) 2011 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16LOCAL_PATH := $(call my-dir)
17
18include art/build/Android.common_test.mk
19
20# List of all tests of the form 003-omnibus-opcodes.
21TEST_ART_RUN_TESTS := $(wildcard $(LOCAL_PATH)/[0-9]*)
22TEST_ART_RUN_TESTS := $(subst $(LOCAL_PATH)/,, $(TEST_ART_RUN_TESTS))
23
Ian Rogersf5c44b32014-08-19 16:52:36 -070024########################################################################
25# The art-run-tests module, used to build all run-tests into an image.
Alex Light9dcc4572014-08-14 14:16:26 -070026
Ian Rogersafd9acc2014-06-17 08:21:54 -070027# The path where build only targets will be output, e.g.
28# out/target/product/generic_x86_64/obj/PACKAGING/art-run-tests_intermediates/DATA
29art_run_tests_dir := $(call intermediates-dir-for,PACKAGING,art-run-tests)/DATA
30
31# A generated list of prerequisites that call 'run-test --build-only', the actual prerequisite is
32# an empty file touched in the intermediate directory.
33TEST_ART_RUN_TEST_BUILD_RULES :=
34
Nicolas Geoffray07f2bc12015-05-29 13:40:25 +010035# Dependencies for actually running a run-test.
Sebastien Hertz19ac0272015-02-24 17:39:50 +010036TEST_ART_RUN_TEST_DEPENDENCIES := \
37 $(DX) \
38 $(HOST_OUT_EXECUTABLES)/jasmin \
39 $(HOST_OUT_EXECUTABLES)/smali \
40 $(HOST_OUT_EXECUTABLES)/dexmerger
41
42ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
43 TEST_ART_RUN_TEST_DEPENDENCIES += \
44 $(JACK_JAR) \
45 $(JACK_LAUNCHER_JAR) \
46 $(JILL_JAR)
47endif
Nicolas Geoffray07f2bc12015-05-29 13:40:25 +010048
Hiroshi Yamauchi093f1b42015-07-14 12:20:30 -070049ifeq ($(ART_TEST_DEBUG_GC),true)
50 ART_TEST_WITH_STRACE := true
51endif
52
Ian Rogersafd9acc2014-06-17 08:21:54 -070053# Helper to create individual build targets for tests. Must be called with $(eval).
54# $(1): the test number
55define define-build-art-run-test
56 dmart_target := $(art_run_tests_dir)/art-run-tests/$(1)/touch
Sebastien Hertz19ac0272015-02-24 17:39:50 +010057 run_test_options = --build-only
58 ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
59 run_test_options += --build-with-jack
60 else
61 run_test_options += --build-with-javac-dx
62 endif
63$$(dmart_target): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
Nicolas Geoffray07f2bc12015-05-29 13:40:25 +010064$$(dmart_target): $(TEST_ART_RUN_TEST_DEPENDENCIES)
Ian Rogersafd9acc2014-06-17 08:21:54 -070065 $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@)
66 $(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -070067 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
68 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Sebastien Hertz19ac0272015-02-24 17:39:50 +010069 JACK=$(abspath $(JACK)) \
70 JACK_VM_COMMAND="$(JACK_VM) $(DEFAULT_JACK_VM_ARGS) $(JAVA_TMPDIR_ARG) -jar $(abspath $(JACK_LAUNCHER_JAR)) " \
71 JACK_CLASSPATH=$(TARGET_JACK_CLASSPATH) \
72 JACK_JAR=$(abspath $(JACK_JAR)) \
73 JILL_JAR=$(abspath $(JILL_JAR)) \
74 $(LOCAL_PATH)/run-test $$(PRIVATE_RUN_TEST_OPTIONS) --output-path $$(abspath $$(dir $$@)) $(1)
Ian Rogersafd9acc2014-06-17 08:21:54 -070075 $(hide) touch $$@
76
77 TEST_ART_RUN_TEST_BUILD_RULES += $$(dmart_target)
78 dmart_target :=
Sebastien Hertz19ac0272015-02-24 17:39:50 +010079 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -070080endef
Ian Rogersbf66bce2014-06-24 23:15:34 -070081$(foreach test, $(TEST_ART_RUN_TESTS), $(eval $(call define-build-art-run-test,$(test))))
Ian Rogersafd9acc2014-06-17 08:21:54 -070082
83include $(CLEAR_VARS)
84LOCAL_MODULE_TAGS := tests
85LOCAL_MODULE := art-run-tests
Ian Rogersabbf2422014-10-15 11:57:01 -070086LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES)
Ian Rogersafd9acc2014-06-17 08:21:54 -070087# The build system use this flag to pick up files generated by declare-make-art-run-test.
88LOCAL_PICKUP_FILES := $(art_run_tests_dir)
89
90include $(BUILD_PHONY_PACKAGE)
91
92# Clear temp vars.
Ian Rogersafd9acc2014-06-17 08:21:54 -070093art_run_tests_dir :=
94define-build-art-run-test :=
Ian Rogers8a14b752014-07-18 15:06:53 -070095TEST_ART_RUN_TEST_BUILD_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -070096
97########################################################################
Ian Rogersf5c44b32014-08-19 16:52:36 -070098# General rules to build and run a run-test.
Ian Rogersafd9acc2014-06-17 08:21:54 -070099
Ian Rogersf5c44b32014-08-19 16:52:36 -0700100TARGET_TYPES := host target
Nicolas Geoffray41bb3312014-10-24 13:49:08 +0100101PREBUILD_TYPES :=
102ifeq ($(ART_TEST_RUN_TEST_PREBUILD),true)
103 PREBUILD_TYPES += prebuild
104endif
Ian Rogers86df3ac2014-08-27 10:54:11 -0700105ifeq ($(ART_TEST_RUN_TEST_NO_PREBUILD),true)
106 PREBUILD_TYPES += no-prebuild
107endif
108ifeq ($(ART_TEST_RUN_TEST_NO_DEX2OAT),true)
109 PREBUILD_TYPES += no-dex2oat
110endif
111COMPILER_TYPES :=
112ifeq ($(ART_TEST_DEFAULT_COMPILER),true)
113 COMPILER_TYPES += default
114endif
115ifeq ($(ART_TEST_INTERPRETER),true)
116 COMPILER_TYPES += interpreter
117endif
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800118ifeq ($(ART_TEST_JIT),true)
119 COMPILER_TYPES += jit
120endif
Ian Rogers86df3ac2014-08-27 10:54:11 -0700121ifeq ($(ART_TEST_OPTIMIZING),true)
122 COMPILER_TYPES += optimizing
123endif
124RELOCATE_TYPES := relocate
125ifeq ($(ART_TEST_RUN_TEST_NO_RELOCATE),true)
126 RELOCATE_TYPES += no-relocate
127endif
128ifeq ($(ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT),true)
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700129 RELOCATE_TYPES += relocate-npatchoat
Ian Rogers86df3ac2014-08-27 10:54:11 -0700130endif
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700131TRACE_TYPES := ntrace
Ian Rogers86df3ac2014-08-27 10:54:11 -0700132ifeq ($(ART_TEST_TRACE),true)
133 TRACE_TYPES += trace
134endif
Andreas Gampe7526d782015-06-22 22:53:45 -0700135ifeq ($(ART_TEST_TRACE_STREAM),true)
136 TRACE_TYPES += stream
137endif
Ian Rogers86df3ac2014-08-27 10:54:11 -0700138GC_TYPES := cms
Alex Light992f1e72014-08-27 16:08:57 -0700139ifeq ($(ART_TEST_GC_STRESS),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700140 GC_TYPES += gcstress
141endif
Alex Light992f1e72014-08-27 16:08:57 -0700142ifeq ($(ART_TEST_GC_VERIFY),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700143 GC_TYPES += gcverify
144endif
145JNI_TYPES := checkjni
146ifeq ($(ART_TEST_JNI_FORCECOPY),true)
147 JNI_TYPES += forcecopy
148endif
149IMAGE_TYPES := image
150ifeq ($(ART_TEST_RUN_TEST_NO_IMAGE),true)
151 IMAGE_TYPES += no-image
152endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700153ifeq ($(ART_TEST_PIC_IMAGE),true)
154 IMAGE_TYPES += picimage
155endif
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700156PICTEST_TYPES := npictest
Andreas Gampec23c9c92014-10-28 14:47:25 -0700157ifeq ($(ART_TEST_PIC_TEST),true)
158 PICTEST_TYPES += pictest
159endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100160RUN_TYPES :=
161ifeq ($(ART_TEST_RUN_TEST_DEBUG),true)
162 RUN_TYPES += debug
163endif
164ifeq ($(ART_TEST_RUN_TEST_NDEBUG),true)
165 RUN_TYPES += ndebug
166endif
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700167DEBUGGABLE_TYPES := ndebuggable
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000168ifeq ($(ART_TEST_RUN_TEST_DEBUGGABLE),true)
169DEBUGGABLE_TYPES += debuggable
170endif
Nicolas Geoffray41bb3312014-10-24 13:49:08 +0100171ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX)
172ADDRESS_SIZES_HOST := $(ART_PHONY_TEST_HOST_SUFFIX)
173ifeq ($(ART_TEST_RUN_TEST_2ND_ARCH),true)
174 ADDRESS_SIZES_TARGET += $(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
175 ADDRESS_SIZES_HOST += $(2ND_ART_PHONY_TEST_HOST_SUFFIX)
176endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700177ALL_ADDRESS_SIZES := 64 32
Ian Rogers86df3ac2014-08-27 10:54:11 -0700178
Ian Rogersf5c44b32014-08-19 16:52:36 -0700179# List all run test names with number arguments agreeing with the comment above.
180define all-run-test-names
181 $(foreach target, $(1), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100182 $(foreach run-type, $(2), \
183 $(foreach prebuild, $(3), \
184 $(foreach compiler, $(4), \
185 $(foreach relocate, $(5), \
186 $(foreach trace, $(6), \
187 $(foreach gc, $(7), \
188 $(foreach jni, $(8), \
189 $(foreach image, $(9), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700190 $(foreach pictest, $(10), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000191 $(foreach debuggable, $(11), \
192 $(foreach test, $(12), \
193 $(foreach address_size, $(13), \
194 test-art-$(target)-run-test-$(run-type)-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(image)-$(pictest)-$(debuggable)-$(test)$(address_size) \
195 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700196endef # all-run-test-names
197
198# To generate a full list or tests:
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100199# $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700200# $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Roland Levillaind139bb72015-07-15 14:09:20 +0100201# $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700202
203# Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE
204define name-to-var
205$(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
206endef # name-to-var
207
208# Tests that are timing sensitive and flaky on heavily loaded systems.
209TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \
210 053-wait-some \
Mathieu Chartiere4a91bb2015-01-28 13:11:44 -0800211 055-enum-performance \
212 133-static-invoke-super
Ian Rogersf5c44b32014-08-19 16:52:36 -0700213
214 # disable timing sensitive tests on "dist" builds.
215ifdef dist_goal
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100216 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700217 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000218 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700219endif
220
Ian Rogers86df3ac2014-08-27 10:54:11 -0700221TEST_ART_TIMING_SENSITIVE_RUN_TESTS :=
222
Ian Rogers40e19122014-09-02 15:59:28 -0700223# 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 -0700224TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \
Andreas Gampe3ad5d5e2015-02-03 18:26:55 -0800225 116-nodex2oat \
Jean Christophe Beyler24e04aa2014-09-12 12:03:25 -0700226 118-noimage-dex2oat \
227 134-nodex2oat-nofallback
Ian Rogersf5c44b32014-08-19 16:52:36 -0700228
Ian Rogers40e19122014-09-02 15:59:28 -0700229ifneq (,$(filter prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100230 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700231 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000232 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700233endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700234
Ian Rogers86df3ac2014-08-27 10:54:11 -0700235TEST_ART_BROKEN_PREBUILD_RUN_TESTS :=
236
Ian Rogersf5c44b32014-08-19 16:52:36 -0700237TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
238 117-nopatchoat
239
Ian Rogers40e19122014-09-02 15:59:28 -0700240ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100241 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700242 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000243 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700244endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700245
Ian Rogers86df3ac2014-08-27 10:54:11 -0700246TEST_ART_BROKEN_NO_PREBUILD_TESTS :=
247
Ian Rogers40e19122014-09-02 15:59:28 -0700248# Note 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without
249# --prebuild --relocate
250TEST_ART_BROKEN_NO_RELOCATE_TESTS := \
Andreas Gampe3ad5d5e2015-02-03 18:26:55 -0800251 117-nopatchoat \
252 118-noimage-dex2oat \
253 119-noimage-patchoat
Ian Rogers40e19122014-09-02 15:59:28 -0700254
255ifneq (,$(filter no-relocate,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100256 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700257 $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000258 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700259endif
260
261TEST_ART_BROKEN_NO_RELOCATE_TESTS :=
262
Man Cao1ed11b92015-06-11 22:47:35 -0700263# Tests that are broken with GC stress.
Mathieu Chartiereb193622015-06-27 15:42:27 -0700264# 137-cfi needs to unwind a second forked process. We're using a primitive sleep to wait till we
265# hope the second process got into the expected state. The slowness of gcstress makes this bad.
266TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := \
267 137-cfi
Man Cao1ed11b92015-06-11 22:47:35 -0700268
269ifneq (,$(filter gcstress,$(GC_TYPES)))
270 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
271 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
272 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
273endif
274
275TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
Ian Rogers40e19122014-09-02 15:59:28 -0700276
Ian Rogersf5c44b32014-08-19 16:52:36 -0700277# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100278ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000279 $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), 115-native-bridge, \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700280 $(ALL_ADDRESS_SIZES))
281
Andreas Gampe3a913092015-01-10 00:26:17 -0800282# 130-hprof dumps the heap and runs hprof-conv to check whether the file is somewhat readable. This
283# is only possible on the host.
284# TODO: Turn off all the other combinations, this is more about testing actual ART code. A gtest is
285# very hard to write here, as (for a complete test) JDWP must be set up.
286ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
287 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000288 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),130-hprof,$(ALL_ADDRESS_SIZES))
Andreas Gampe3a913092015-01-10 00:26:17 -0800289
Andreas Gampe94329d32015-04-24 20:22:06 -0700290# 131 is an old test. The functionality has been implemented at an earlier stage and is checked
291# in tests 138.
292ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
293 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
294 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),131-structural-change,$(ALL_ADDRESS_SIZES))
295
Andreas Gampe69b5d8f2015-06-03 15:43:16 -0700296# 138-duplicate-classes-check. Turned off temporarily, b/21333911.
297ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
298 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
299 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),138-duplicate-classes-check,$(ALL_ADDRESS_SIZES))
300
Alex Light03a112d2014-08-25 13:25:56 -0700301# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
302# Therefore we shouldn't run them in situations where we actually don't have these since they
303# explicitly test for them. These all also assume we have an image.
304TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
305 116-nodex2oat \
306 117-nopatchoat \
307 118-noimage-dex2oat \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700308 119-noimage-patchoat \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700309 137-cfi \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700310 138-duplicate-classes-check2
311
312# This test fails without an image.
313TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS := \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700314 137-cfi \
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700315 138-duplicate-classes-check
Alex Light03a112d2014-08-25 13:25:56 -0700316
Ian Rogers40e19122014-09-02 15:59:28 -0700317ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100318 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
Ian Rogers40e19122014-09-02 15:59:28 -0700319 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000320 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700321endif
Alex Light03a112d2014-08-25 13:25:56 -0700322
Alex Light03a112d2014-08-25 13:25:56 -0700323
Ian Rogers40e19122014-09-02 15:59:28 -0700324ifneq (,$(filter no-image,$(IMAGE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100325 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700326 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000327 $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Andreas Gampeb9aec2c2015-04-23 22:23:47 -0700328 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
329 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
330 $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700331endif
332
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700333ifneq (,$(filter relocate-npatchoat,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100334 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700335 $(COMPILER_TYPES), relocate-npatchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000336 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700337endif
Alex Light03a112d2014-08-25 13:25:56 -0700338
Ian Rogers86df3ac2014-08-27 10:54:11 -0700339TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
340
Andreas Gampee1bbed22015-05-20 13:55:00 -0700341# 137:
342# This test unrolls and expects managed frames, but tracing means we run the interpreter.
343# 802:
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800344# This test dynamically enables tracing to force a deoptimization. This makes the test meaningless
345# when already tracing, and writes an error message that we do not want to check for.
346TEST_ART_BROKEN_TRACING_RUN_TESTS := \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700347 137-cfi \
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800348 802-deoptimization
349
Andreas Gampe7526d782015-06-22 22:53:45 -0700350ifneq (,$(filter trace stream,$(TRACE_TYPES)))
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800351 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Andreas Gampe7526d782015-06-22 22:53:45 -0700352 $(COMPILER_TYPES),$(RELOCATE_TYPES),trace stream,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000353 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800354endif
355
356TEST_ART_BROKEN_TRACING_RUN_TESTS :=
357
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100358# The following tests use libarttest.so, which is linked against libartd.so, so will
359# not work when libart.so is the one loaded.
360# TODO: Find a way to run these tests in ndebug mode.
361TEST_ART_BROKEN_NDEBUG_TESTS := \
362 004-JniTest \
363 004-ReferenceMap \
364 004-SignalTest \
365 004-StackWalk \
366 004-UnsafeTest \
Nicolas Geoffray64dea7e2014-11-07 14:32:42 +0000367 051-thread \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100368 115-native-bridge \
369 116-nodex2oat \
370 117-nopatchoat \
371 118-noimage-dex2oat \
372 119-noimage-patchoat \
Nicolas Geoffray8c9200a2015-01-15 08:42:47 +0000373 131-structural-change \
Andreas Gampe73810102015-04-22 18:57:06 -0700374 137-cfi \
Andreas Gampee1bbed22015-05-20 13:55:00 -0700375 139-register-natives \
Nicolas Geoffrayd845fd02015-03-03 12:43:45 +0000376 454-get-vreg \
377 455-set-vreg \
Nicolas Geoffray64d69ab2015-03-10 19:26:24 +0000378 457-regs \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +0000379 461-get-reference-vreg \
Nicolas Geoffrayd8126be2015-03-27 10:22:41 +0000380 466-get-live-vreg \
Nicolas Geoffray32c9ea52015-06-12 14:52:33 +0100381 497-inlining-and-class-loader \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100382
383ifneq (,$(filter ndebug,$(RUN_TYPES)))
384 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
385 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000386 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100387endif
388
389TEST_ART_BROKEN_NDEBUG_TESTS :=
390
Andreas Gampee1bbed22015-05-20 13:55:00 -0700391# Known broken tests for the interpreter.
392# CFI unwinding expects managed frames.
393TEST_ART_BROKEN_INTERPRETER_RUN_TESTS := \
394 137-cfi
395
396ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
397 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
398 interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
399 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_INTERPRETER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
400endif
401
402TEST_ART_BROKEN_INTERPRETER_RUN_TESTS :=
403
Andreas Gampeaab9f732015-05-20 14:50:06 -0700404# Known broken tests for the JIT.
405# CFI unwinding expects managed frames, and the test does not iterate enough to even compile. JIT
406# also uses Generic JNI instead of the JNI compiler.
407TEST_ART_BROKEN_JIT_RUN_TESTS := \
408 137-cfi
409
410ifneq (,$(filter jit,$(COMPILER_TYPES)))
411 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
412 jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
413 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_JIT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
414endif
415
416TEST_ART_BROKEN_JIT_RUN_TESTS :=
417
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100418# Known broken tests for the default compiler (Quick).
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000419TEST_ART_BROKEN_DEFAULT_RUN_TESTS := \
Vladimir Marko07785bb2015-06-15 18:52:54 +0100420 457-regs
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100421
422ifneq (,$(filter default,$(COMPILER_TYPES)))
423 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Nicolas Geoffray83cae422014-10-22 15:08:03 +0100424 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000425 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100426endif
427
428TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
429
Alexandre Rames5319def2014-10-23 10:03:10 +0100430# Known broken tests for the arm64 optimizing compiler backend.
Serban Constantinescu02d81cc2015-01-05 16:08:49 +0000431TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100432
433ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
434 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
435 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000436 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS),64)
Alexandre Rames5319def2014-10-23 10:03:10 +0100437endif
438
439TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
440
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100441# Known broken tests for the optimizing compiler.
Nicolas Geoffrayaa8dd2f2015-01-23 17:48:28 +0000442TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100443
444ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
445 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
446 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000447 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100448endif
449
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000450# If ART_USE_OPTIMIZING_COMPILER is set to true, then the default core.art has been
451# compiled with the optimizing compiler.
452ifeq ($(ART_USE_OPTIMIZING_COMPILER),true)
453 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
454 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000455 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000456endif
457
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100458TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
459
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000460# Tests that should fail when the optimizing compiler compiles them non-debuggable.
461TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS := \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +0000462 454-get-vreg \
463 455-set-vreg \
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000464 457-regs \
465
466ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
467 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
468 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700469 $(IMAGE_TYPES),$(PICTEST_TYPES),ndebuggable,$(TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000470endif
471
472TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
473
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000474# Tests that should fail when the optimizing compiler compiles them debuggable.
475TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS := \
Nicolas Geoffraye50b8d22015-03-13 08:57:42 +0000476
477ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
478 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
479 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
480 $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
481endif
482
483TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
484
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700485# Tests that should fail in the read barrier configuration.
Andreas Gampee1bbed22015-05-20 13:55:00 -0700486# 137: Read barrier forces interpreter. Cannot run this with the interpreter.
487TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS := \
488 137-cfi
Hiroshi Yamauchi1d858232015-05-05 13:36:39 -0700489
490ifeq ($(ART_USE_READ_BARRIER),true)
491 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
492 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
493 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
494endif
495
496TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100497
Roland Levillain4d027112015-07-01 15:41:14 +0100498# Tests that should fail in the heap poisoning configuration with the default (Quick) compiler.
499# 137: Quick punts to the interpreter, and this test cannot run this with the interpreter.
500TEST_ART_BROKEN_DEFAULT_HEAP_POISONING_RUN_TESTS := \
501 137-cfi
502# Tests that should fail in the heap poisoning configuration with the Optimizing compiler.
503# 055-enum-performance: Exceeds run time limits due to heap poisoning instrumentation.
504TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS := \
505 055-enum-performance
506# Tests that should fail in the heap poisoning configuration with the interpreter.
507# 137: Cannot run this with the interpreter.
508TEST_ART_BROKEN_INTERPRETER_HEAP_POISONING_RUN_TESTS := \
Andreas Gampe44372192015-05-21 10:01:42 -0700509 137-cfi
510
511ifeq ($(ART_HEAP_POISONING),true)
Roland Levillain4d027112015-07-01 15:41:14 +0100512 ifneq (,$(filter default,$(COMPILER_TYPES)))
513 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
514 $(PREBUILD_TYPES),default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
515 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
516 $(TEST_ART_BROKEN_DEFAULT_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
517 endif
518
519 ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
520 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
521 $(PREBUILD_TYPES),optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
522 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
523 $(TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
524 endif
525
526 ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
527 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
528 $(PREBUILD_TYPES),interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
529 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
530 $(TEST_ART_BROKEN_INTERPRETER_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
531 endif
Andreas Gampe44372192015-05-21 10:01:42 -0700532endif
533
Roland Levillain4d027112015-07-01 15:41:14 +0100534TEST_ART_BROKEN_INTERPRETER_HEAP_POISONING_RUN_TESTS :=
535TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS :=
536TEST_ART_BROKEN_DEFAULT_HEAP_POISONING_RUN_TESTS :=
Andreas Gampe44372192015-05-21 10:01:42 -0700537
Ian Rogersf5c44b32014-08-19 16:52:36 -0700538# Clear variables ahead of appending to them when defining tests.
539$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
540$(foreach target, $(TARGET_TYPES), \
541 $(foreach prebuild, $(PREBUILD_TYPES), \
542 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
543$(foreach target, $(TARGET_TYPES), \
544 $(foreach compiler, $(COMPILER_TYPES), \
545 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
546$(foreach target, $(TARGET_TYPES), \
547 $(foreach relocate, $(RELOCATE_TYPES), \
548 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
549$(foreach target, $(TARGET_TYPES), \
550 $(foreach trace, $(TRACE_TYPES), \
551 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
552$(foreach target, $(TARGET_TYPES), \
553 $(foreach gc, $(GC_TYPES), \
554 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
555$(foreach target, $(TARGET_TYPES), \
556 $(foreach jni, $(JNI_TYPES), \
557 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
558$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700559 $(foreach image, $(IMAGE_TYPES), \
560 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
561$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700562 $(foreach test, $(TEST_ART_RUN_TESTS), \
563 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
564$(foreach target, $(TARGET_TYPES), \
565 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
566 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100567$(foreach target, $(TARGET_TYPES), \
568 $(foreach run_type, $(RUN_TYPES), \
569 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000570$(foreach target, $(TARGET_TYPES), \
571 $(foreach debuggable_type, $(DEBUGGABLE_TYPES), \
572 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700573
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700574# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
575# only once).
576TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700577
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700578# Also need libarttest.
579TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
580ifdef TARGET_2ND_ARCH
581TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
582endif
583
Andreas Gampe855564b2014-07-25 02:32:19 -0700584# Also need libnativebridgetest.
585TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
586ifdef TARGET_2ND_ARCH
587TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
588endif
589
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700590# All tests require the host executables. The tests also depend on the core images, but on
591# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700592ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
593 $(ART_HOST_EXECUTABLES) \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700594 $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700595 $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700596 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700597
598ifneq ($(HOST_PREFER_32_BIT),true)
599ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700600 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700601 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700602 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700603endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700604
Ian Rogersf5c44b32014-08-19 16:52:36 -0700605# Create a rule to build and run a tests following the form:
Calin Juravle9228b2a2014-10-22 15:54:34 +0100606# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700607# {4: interpreter default optimizing jit}-{5: relocate nrelocate relocate-npatchoat}-
608# {6: trace or ntrace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
609# {9: no-image image picimage}-{10: pictest npictest}-
610# {11: ndebuggable debuggable}-{12: test name}{13: 32 or 64}
Ian Rogersafd9acc2014-06-17 08:21:54 -0700611define define-test-art-run-test
Nicolas Geoffray611e1db2014-10-09 17:34:45 +0100612 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700613 prereq_rule :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700614 test_groups :=
615 uc_host_or_target :=
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100616 jack_classpath :=
617 ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
618 run_test_options += --build-with-jack
619 else
620 run_test_options += --build-with-javac-dx
621 endif
Hiroshi Yamauchi1d4184d2015-07-13 17:11:22 -0700622 ifeq ($(ART_TEST_WITH_STRACE),true)
623 run_test_options += --strace
624 endif
Alex Lightbfac14a2014-07-30 09:41:21 -0700625 ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
626 run_test_options += --always-clean
627 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700628 ifeq ($(1),host)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700629 uc_host_or_target := HOST
Ian Rogersf5c44b32014-08-19 16:52:36 -0700630 test_groups := ART_RUN_TEST_HOST_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700631 run_test_options += --host
632 prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100633 jack_classpath := $(HOST_JACK_CLASSPATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700634 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700635 ifeq ($(1),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700636 uc_host_or_target := TARGET
Ian Rogersf5c44b32014-08-19 16:52:36 -0700637 test_groups := ART_RUN_TEST_TARGET_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700638 prereq_rule := test-art-target-sync
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100639 jack_classpath := $(TARGET_JACK_CLASSPATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700640 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700641 $$(error found $(1) expected $(TARGET_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700642 endif
643 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100644 ifeq ($(2),debug)
645 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
646 else
647 ifeq ($(2),ndebug)
648 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
649 run_test_options += -O
650 else
651 $$(error found $(2) expected $(RUN_TYPES))
652 endif
653 endif
654 ifeq ($(3),prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700655 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
656 run_test_options += --prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700657 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100658 ifeq ($(3),no-prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700659 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
660 run_test_options += --no-prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700661 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100662 ifeq ($(3),no-dex2oat)
Alex Light03a112d2014-08-25 13:25:56 -0700663 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
664 run_test_options += --no-prebuild --no-dex2oat
665 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100666 $$(error found $(3) expected $(PREBUILD_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700667 endif
Alex Lighta59dd802014-07-02 16:28:08 -0700668 endif
669 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100670 ifeq ($(4),optimizing)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700671 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700672 run_test_options += --optimizing
Ian Rogersafd9acc2014-06-17 08:21:54 -0700673 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100674 ifeq ($(4),interpreter)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700675 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700676 run_test_options += --interpreter
677 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100678 ifeq ($(4),default)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700679 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
Nicolas Geoffrayc9338b92014-12-03 13:36:10 +0000680 run_test_options += --quick
Ian Rogersafd9acc2014-06-17 08:21:54 -0700681 else
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800682 ifeq ($(4),jit)
Mathieu Chartier3fc1b122015-02-26 10:58:08 -0800683 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JIT_RULES
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800684 run_test_options += --jit
685 else
686 $$(error found $(4) expected $(COMPILER_TYPES))
687 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700688 endif
689 endif
690 endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700691
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100692 ifeq ($(5),relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700693 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
694 run_test_options += --relocate
Ian Rogersafd9acc2014-06-17 08:21:54 -0700695 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100696 ifeq ($(5),no-relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700697 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
698 run_test_options += --no-relocate
699 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700700 ifeq ($(5),relocate-npatchoat)
Alex Light03a112d2014-08-25 13:25:56 -0700701 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
702 run_test_options += --relocate --no-patchoat
703 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100704 $$(error found $(5) expected $(RELOCATE_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700705 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700706 endif
707 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100708 ifeq ($(6),trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700709 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
Ian Rogers716e4f82014-07-16 11:18:03 -0700710 run_test_options += --trace
Ian Rogers716e4f82014-07-16 11:18:03 -0700711 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700712 ifeq ($(6),ntrace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700713 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
Ian Rogers701aa642014-07-18 11:38:13 -0700714 else
Andreas Gampe7526d782015-06-22 22:53:45 -0700715 ifeq ($(6),stream)
716 # Group streaming under normal tracing rules.
717 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
718 run_test_options += --trace --stream
719 else
720 $$(error found $(6) expected $(TRACE_TYPES))
721 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700722 endif
723 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100724 ifeq ($(7),gcverify)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700725 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700726 run_test_options += --gcverify
727 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100728 ifeq ($(7),gcstress)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700729 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700730 run_test_options += --gcstress
731 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100732 ifeq ($(7),cms)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700733 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
Ian Rogers8a14b752014-07-18 15:06:53 -0700734 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100735 $$(error found $(7) expected $(GC_TYPES))
Ian Rogers701aa642014-07-18 11:38:13 -0700736 endif
Ian Rogers716e4f82014-07-16 11:18:03 -0700737 endif
738 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100739 ifeq ($(8),forcecopy)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700740 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700741 run_test_options += --runtime-option -Xjniopts:forcecopy
742 ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
743 skip_test := true
744 endif
745 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100746 ifeq ($(8),checkjni)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700747 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700748 run_test_options += --runtime-option -Xcheck:jni
749 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100750 ifeq ($(8),jni)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700751 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
752 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100753 $$(error found $(8) expected $(JNI_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700754 endif
755 endif
756 endif
Mathieu Chartiere2a12c02015-02-27 13:21:15 -0800757 ifeq ($(4),jit)
758 # Use interpreter image for JIT.
759 image_suffix := interpreter
760 else
761 image_suffix := $(4)
762 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100763 ifeq ($(9),no-image)
Alex Light03a112d2014-08-25 13:25:56 -0700764 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
765 run_test_options += --no-image
Andreas Gampebf03e842014-10-29 20:46:17 -0700766 # Add the core dependency. This is required for pre-building.
767 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000768 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700769 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000770 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700771 endif
Alex Light03a112d2014-08-25 13:25:56 -0700772 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100773 ifeq ($(9),image)
Alex Light03a112d2014-08-25 13:25:56 -0700774 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
Andreas Gampec23c9c92014-10-28 14:47:25 -0700775 # Add the core dependency.
776 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000777 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700778 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000779 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700780 endif
Alex Light03a112d2014-08-25 13:25:56 -0700781 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700782 ifeq ($(9),picimage)
783 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
784 run_test_options += --pic-image
785 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000786 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700787 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000788 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700789 endif
790 else
791 $$(error found $(9) expected $(IMAGE_TYPES))
792 endif
Alex Light03a112d2014-08-25 13:25:56 -0700793 endif
794 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700795 ifeq ($(10),pictest)
796 run_test_options += --pic-test
797 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700798 ifeq ($(10),npictest)
Andreas Gampec23c9c92014-10-28 14:47:25 -0700799 # Nothing to be done.
800 else
801 $$(error found $(10) expected $(PICTEST_TYPES))
802 endif
803 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000804 ifeq ($(11),debuggable)
805 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUGGABLE_RULES
806 run_test_options += --debuggable
807 else
Mathieu Chartier1445dd32015-03-20 14:29:51 -0700808 ifeq ($(11),ndebuggable)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000809 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NONDEBUGGABLE_RULES
810 # Nothing to be done.
811 else
812 $$(error found $(11) expected $(DEBUGGABLE_TYPES))
813 endif
814 endif
815 # $(12) is the test name.
816 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(12))_RULES
817 ifeq ($(13),64)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700818 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
819 run_test_options += --64
820 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000821 ifeq ($(13),32)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700822 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
823 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000824 $$(error found $(13) expected $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700825 endif
826 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000827 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 -0700828 run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
Ian Rogers5242c0a2014-07-18 11:02:19 -0700829 $$(run_test_options)
Nicolas Geoffrayc8f23fc2014-10-28 17:59:47 +0000830 ifneq ($(ART_TEST_ANDROID_ROOT),)
831 run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
832 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700833$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100834$$(run_test_rule_name): PRIVATE_JACK_CLASSPATH := $$(jack_classpath)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700835.PHONY: $$(run_test_rule_name)
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100836$$(run_test_rule_name): $(TEST_ART_RUN_TEST_DEPENDENCIES) $(HOST_OUT_EXECUTABLES)/hprof-conv $$(prereq_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700837 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100838 DX=$(abspath $(DX)) \
839 JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700840 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
841 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100842 JACK=$(abspath $(JACK)) \
843 JACK_VM_COMMAND="$(JACK_VM) $(DEFAULT_JACK_VM_ARGS) $(JAVA_TMPDIR_ARG) -jar $(abspath $(JACK_LAUNCHER_JAR)) " \
844 JACK_CLASSPATH=$$(PRIVATE_JACK_CLASSPATH) \
845 JACK_JAR=$(abspath $(JACK_JAR)) \
846 JILL_JAR=$(abspath $(JILL_JAR)) \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000847 art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(12) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700848 && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
849 $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
850 echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
851 rm -r $(ART_HOST_TEST_DIR)) || true
852
Ian Rogersf5c44b32014-08-19 16:52:36 -0700853 $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700854
855 # Clear locally defined variables.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700856 uc_host_or_target :=
857 test_groups :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700858 run_test_options :=
859 run_test_rule_name :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700860 prereq_rule :=
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100861 jack_classpath :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700862endef # define-test-art-run-test
863
Ian Rogersf5c44b32014-08-19 16:52:36 -0700864$(foreach target, $(TARGET_TYPES), \
865 $(foreach test, $(TEST_ART_RUN_TESTS), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100866 $(foreach run_type, $(RUN_TYPES), \
867 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
868 $(foreach prebuild, $(PREBUILD_TYPES), \
869 $(foreach compiler, $(COMPILER_TYPES), \
870 $(foreach relocate, $(RELOCATE_TYPES), \
871 $(foreach trace, $(TRACE_TYPES), \
872 $(foreach gc, $(GC_TYPES), \
873 $(foreach jni, $(JNI_TYPES), \
874 $(foreach image, $(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700875 $(foreach pictest, $(PICTEST_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000876 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
877 $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(debuggable),$(test),$(address_size))) \
878 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700879define-test-art-run-test :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700880
Ian Rogersafd9acc2014-06-17 08:21:54 -0700881# Define a phony rule whose purpose is to test its prerequisites.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700882# $(1): host or target
Ian Rogersafd9acc2014-06-17 08:21:54 -0700883# $(2): list of prerequisites
Ian Rogersf5c44b32014-08-19 16:52:36 -0700884define define-test-art-run-test-group
Ian Rogersafd9acc2014-06-17 08:21:54 -0700885.PHONY: $(1)
886$(1): $(2)
887 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
888
Ian Rogersafd9acc2014-06-17 08:21:54 -0700889endef # define-test-art-run-test-group
890
Ian Rogersafd9acc2014-06-17 08:21:54 -0700891
Ian Rogersf5c44b32014-08-19 16:52:36 -0700892$(foreach target, $(TARGET_TYPES), $(eval \
893 $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
894$(foreach target, $(TARGET_TYPES), \
895 $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
896 $(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)))))
897$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100898 $(foreach run-type, $(RUN_TYPES), $(eval \
899 $(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)))))
900$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700901 $(foreach compiler, $(COMPILER_TYPES), $(eval \
902 $(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)))))
903$(foreach target, $(TARGET_TYPES), \
904 $(foreach relocate, $(RELOCATE_TYPES), $(eval \
905 $(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)))))
906$(foreach target, $(TARGET_TYPES), \
907 $(foreach trace, $(TRACE_TYPES), $(eval \
908 $(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)))))
909$(foreach target, $(TARGET_TYPES), \
910 $(foreach gc, $(GC_TYPES), $(eval \
911 $(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)))))
912$(foreach target, $(TARGET_TYPES), \
913 $(foreach jni, $(JNI_TYPES), $(eval \
914 $(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)))))
915$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000916 $(foreach debuggable, $(DEBUGGABLE_TYPES), $(eval \
917 $(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)))))
918$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700919 $(foreach image, $(IMAGE_TYPES), $(eval \
920 $(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)))))
921$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700922 $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
923 $(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)))))
924$(foreach target, $(TARGET_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700925 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
Ian Rogersa3cf6ce2014-10-02 16:35:52 -0700926 $(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 -0700927
Ian Rogersf5c44b32014-08-19 16:52:36 -0700928# Clear variables now we're finished with them.
929$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
930$(foreach target, $(TARGET_TYPES), \
931 $(foreach prebuild, $(PREBUILD_TYPES), \
932 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
933$(foreach target, $(TARGET_TYPES), \
934 $(foreach compiler, $(COMPILER_TYPES), \
935 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
936$(foreach target, $(TARGET_TYPES), \
937 $(foreach relocate, $(RELOCATE_TYPES), \
938 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
939$(foreach target, $(TARGET_TYPES), \
940 $(foreach trace, $(TRACE_TYPES), \
941 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
942$(foreach target, $(TARGET_TYPES), \
943 $(foreach gc, $(GC_TYPES), \
944 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
945$(foreach target, $(TARGET_TYPES), \
946 $(foreach jni, $(JNI_TYPES), \
947 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
948$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000949 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
950 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES :=)))
951$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700952 $(foreach image, $(IMAGE_TYPES), \
953 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
954$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700955 $(foreach test, $(TEST_ART_RUN_TESTS), \
956 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
957$(foreach target, $(TARGET_TYPES), \
958 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
959 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100960$(foreach target, $(TARGET_TYPES), \
961 $(foreach run_type, $(RUN_TYPES), \
962 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700963define-test-art-run-test-group :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700964TARGET_TYPES :=
965PREBUILD_TYPES :=
966COMPILER_TYPES :=
967RELOCATE_TYPES :=
968TRACE_TYPES :=
969GC_TYPES :=
970JNI_TYPES :=
Alex Light03a112d2014-08-25 13:25:56 -0700971IMAGE_TYPES :=
Ian Rogers86df3ac2014-08-27 10:54:11 -0700972ADDRESS_SIZES_TARGET :=
973ADDRESS_SIZES_HOST :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700974ALL_ADDRESS_SIZES :=
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100975RUN_TYPES :=
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000976DEBUGGABLE_TYPES :=
Ian Rogers9fcaa4b2014-08-26 19:59:52 -0700977
978include $(LOCAL_PATH)/Android.libarttest.mk
979include art/test/Android.libnativebridgetest.mk