blob: 455474d9ee46ec3385423421802a797495bee19a [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
35# Helper to create individual build targets for tests. Must be called with $(eval).
36# $(1): the test number
37define define-build-art-run-test
38 dmart_target := $(art_run_tests_dir)/art-run-tests/$(1)/touch
Andreas Gampe8fda9f22014-10-03 16:15:37 -070039$$(dmart_target): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $(HOST_OUT_EXECUTABLES)/smali $(HOST_OUT_EXECUTABLES)/dexmerger
Ian Rogersafd9acc2014-06-17 08:21:54 -070040 $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@)
41 $(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -070042 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
43 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Ian Rogersafd9acc2014-06-17 08:21:54 -070044 $(LOCAL_PATH)/run-test --build-only --output-path $$(abspath $$(dir $$@)) $(1)
45 $(hide) touch $$@
46
47 TEST_ART_RUN_TEST_BUILD_RULES += $$(dmart_target)
48 dmart_target :=
49endef
Ian Rogersbf66bce2014-06-24 23:15:34 -070050$(foreach test, $(TEST_ART_RUN_TESTS), $(eval $(call define-build-art-run-test,$(test))))
Ian Rogersafd9acc2014-06-17 08:21:54 -070051
52include $(CLEAR_VARS)
53LOCAL_MODULE_TAGS := tests
54LOCAL_MODULE := art-run-tests
Ian Rogersabbf2422014-10-15 11:57:01 -070055LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES)
Ian Rogersafd9acc2014-06-17 08:21:54 -070056# The build system use this flag to pick up files generated by declare-make-art-run-test.
57LOCAL_PICKUP_FILES := $(art_run_tests_dir)
58
59include $(BUILD_PHONY_PACKAGE)
60
61# Clear temp vars.
Ian Rogersafd9acc2014-06-17 08:21:54 -070062art_run_tests_dir :=
63define-build-art-run-test :=
Ian Rogers8a14b752014-07-18 15:06:53 -070064TEST_ART_RUN_TEST_BUILD_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -070065
66########################################################################
Ian Rogersf5c44b32014-08-19 16:52:36 -070067# General rules to build and run a run-test.
Ian Rogersafd9acc2014-06-17 08:21:54 -070068
Ian Rogersf5c44b32014-08-19 16:52:36 -070069TARGET_TYPES := host target
Nicolas Geoffray41bb3312014-10-24 13:49:08 +010070PREBUILD_TYPES :=
71ifeq ($(ART_TEST_RUN_TEST_PREBUILD),true)
72 PREBUILD_TYPES += prebuild
73endif
Ian Rogers86df3ac2014-08-27 10:54:11 -070074ifeq ($(ART_TEST_RUN_TEST_NO_PREBUILD),true)
75 PREBUILD_TYPES += no-prebuild
76endif
77ifeq ($(ART_TEST_RUN_TEST_NO_DEX2OAT),true)
78 PREBUILD_TYPES += no-dex2oat
79endif
80COMPILER_TYPES :=
81ifeq ($(ART_TEST_DEFAULT_COMPILER),true)
82 COMPILER_TYPES += default
83endif
84ifeq ($(ART_TEST_INTERPRETER),true)
85 COMPILER_TYPES += interpreter
86endif
87ifeq ($(ART_TEST_OPTIMIZING),true)
88 COMPILER_TYPES += optimizing
89endif
90RELOCATE_TYPES := relocate
91ifeq ($(ART_TEST_RUN_TEST_NO_RELOCATE),true)
92 RELOCATE_TYPES += no-relocate
93endif
94ifeq ($(ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT),true)
95 RELOCATE_TYPES := relocate-no-patchoat
96endif
97TRACE_TYPES := no-trace
98ifeq ($(ART_TEST_TRACE),true)
99 TRACE_TYPES += trace
100endif
101GC_TYPES := cms
Alex Light992f1e72014-08-27 16:08:57 -0700102ifeq ($(ART_TEST_GC_STRESS),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700103 GC_TYPES += gcstress
104endif
Alex Light992f1e72014-08-27 16:08:57 -0700105ifeq ($(ART_TEST_GC_VERIFY),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700106 GC_TYPES += gcverify
107endif
108JNI_TYPES := checkjni
109ifeq ($(ART_TEST_JNI_FORCECOPY),true)
110 JNI_TYPES += forcecopy
111endif
112IMAGE_TYPES := image
113ifeq ($(ART_TEST_RUN_TEST_NO_IMAGE),true)
114 IMAGE_TYPES += no-image
115endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700116ifeq ($(ART_TEST_PIC_IMAGE),true)
117 IMAGE_TYPES += picimage
118endif
119PICTEST_TYPES := nopictest
120ifeq ($(ART_TEST_PIC_TEST),true)
121 PICTEST_TYPES += pictest
122endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100123RUN_TYPES :=
124ifeq ($(ART_TEST_RUN_TEST_DEBUG),true)
125 RUN_TYPES += debug
126endif
127ifeq ($(ART_TEST_RUN_TEST_NDEBUG),true)
128 RUN_TYPES += ndebug
129endif
Nicolas Geoffray41bb3312014-10-24 13:49:08 +0100130ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX)
131ADDRESS_SIZES_HOST := $(ART_PHONY_TEST_HOST_SUFFIX)
132ifeq ($(ART_TEST_RUN_TEST_2ND_ARCH),true)
133 ADDRESS_SIZES_TARGET += $(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
134 ADDRESS_SIZES_HOST += $(2ND_ART_PHONY_TEST_HOST_SUFFIX)
135endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700136ALL_ADDRESS_SIZES := 64 32
Ian Rogers86df3ac2014-08-27 10:54:11 -0700137
Ian Rogersf5c44b32014-08-19 16:52:36 -0700138# List all run test names with number arguments agreeing with the comment above.
139define all-run-test-names
140 $(foreach target, $(1), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100141 $(foreach run-type, $(2), \
142 $(foreach prebuild, $(3), \
143 $(foreach compiler, $(4), \
144 $(foreach relocate, $(5), \
145 $(foreach trace, $(6), \
146 $(foreach gc, $(7), \
147 $(foreach jni, $(8), \
148 $(foreach image, $(9), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700149 $(foreach pictest, $(10), \
150 $(foreach test, $(11), \
151 $(foreach address_size, $(12), \
152 test-art-$(target)-run-test-$(run-type)-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(image)-$(pictest)-$(test)$(address_size) \
153 ))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700154endef # all-run-test-names
155
156# To generate a full list or tests:
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100157# $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700158# $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
159# $(TEST_ART_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700160
161# Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE
162define name-to-var
163$(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
164endef # name-to-var
165
166# Tests that are timing sensitive and flaky on heavily loaded systems.
167TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \
168 053-wait-some \
169 055-enum-performance
170
171 # disable timing sensitive tests on "dist" builds.
172ifdef dist_goal
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100173 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700174 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700175 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700176endif
177
Ian Rogers86df3ac2014-08-27 10:54:11 -0700178TEST_ART_TIMING_SENSITIVE_RUN_TESTS :=
179
Nicolas Geoffray3d56be82014-09-30 15:05:13 +0100180TEST_ART_BROKEN_RUN_TESTS := \
181 004-ThreadStress
182
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100183ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Nicolas Geoffray3d56be82014-09-30 15:05:13 +0100184 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700185 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_BROKEN_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Nicolas Geoffray3d56be82014-09-30 15:05:13 +0100186
187TEST_ART_BROKEN_RUN_TESTS :=
188
Ian Rogers40e19122014-09-02 15:59:28 -0700189# 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 -0700190TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \
191 116-nodex2oat
192
Ian Rogers40e19122014-09-02 15:59:28 -0700193ifneq (,$(filter prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100194 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700195 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700196 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700197endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700198
Ian Rogers86df3ac2014-08-27 10:54:11 -0700199TEST_ART_BROKEN_PREBUILD_RUN_TESTS :=
200
Ian Rogersf5c44b32014-08-19 16:52:36 -0700201TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
202 117-nopatchoat
203
Ian Rogers40e19122014-09-02 15:59:28 -0700204ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100205 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700206 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700207 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700208endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700209
Ian Rogers86df3ac2014-08-27 10:54:11 -0700210TEST_ART_BROKEN_NO_PREBUILD_TESTS :=
211
Ian Rogers40e19122014-09-02 15:59:28 -0700212# Note 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without
213# --prebuild --relocate
214TEST_ART_BROKEN_NO_RELOCATE_TESTS := \
215 117-nopatchoat
216
217ifneq (,$(filter no-relocate,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100218 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700219 $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700220 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700221endif
222
223TEST_ART_BROKEN_NO_RELOCATE_TESTS :=
224
Ian Rogers40e19122014-09-02 15:59:28 -0700225# Tests that are broken with GC stress.
226TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := \
Ian Rogers58920cc2014-10-10 12:39:31 -0700227 004-SignalTest \
228 114-ParallelGC
Ian Rogers40e19122014-09-02 15:59:28 -0700229
230ifneq (,$(filter gcstress,$(GC_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100231 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700232 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700233 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700234endif
235
236TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
237
Ian Rogersf5c44b32014-08-19 16:52:36 -0700238# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100239ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700240 $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),115-native-bridge, \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700241 $(ALL_ADDRESS_SIZES))
242
Alex Light03a112d2014-08-25 13:25:56 -0700243# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
244# Therefore we shouldn't run them in situations where we actually don't have these since they
245# explicitly test for them. These all also assume we have an image.
246TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
247 116-nodex2oat \
248 117-nopatchoat \
249 118-noimage-dex2oat \
250 119-noimage-patchoat
251
Ian Rogers40e19122014-09-02 15:59:28 -0700252ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100253 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
Ian Rogers40e19122014-09-02 15:59:28 -0700254 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700255 $(PICTEST_TYPES),$(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700256endif
Alex Light03a112d2014-08-25 13:25:56 -0700257
Alex Light03a112d2014-08-25 13:25:56 -0700258
Ian Rogers40e19122014-09-02 15:59:28 -0700259ifneq (,$(filter no-image,$(IMAGE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100260 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700261 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700262 $(PICTEST_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700263endif
264
265ifneq (,$(filter relocate-no-patchoat,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100266 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700267 $(COMPILER_TYPES), relocate-no-patchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700268 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700269endif
Alex Light03a112d2014-08-25 13:25:56 -0700270
Ian Rogers86df3ac2014-08-27 10:54:11 -0700271TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
272
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100273# The following tests use libarttest.so, which is linked against libartd.so, so will
274# not work when libart.so is the one loaded.
275# TODO: Find a way to run these tests in ndebug mode.
276TEST_ART_BROKEN_NDEBUG_TESTS := \
277 004-JniTest \
278 004-ReferenceMap \
279 004-SignalTest \
280 004-StackWalk \
281 004-UnsafeTest \
Nicolas Geoffray64dea7e2014-11-07 14:32:42 +0000282 051-thread \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100283 115-native-bridge \
284 116-nodex2oat \
285 117-nopatchoat \
286 118-noimage-dex2oat \
287 119-noimage-patchoat \
288
289ifneq (,$(filter ndebug,$(RUN_TYPES)))
290 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
291 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700292 $(PICTEST_TYPES),$(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100293endif
294
295TEST_ART_BROKEN_NDEBUG_TESTS :=
296
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100297# Known broken tests for the default compiler (Quick).
Serguei Katkov27503542014-11-06 14:45:44 +0600298TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100299
300ifneq (,$(filter default,$(COMPILER_TYPES)))
301 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Nicolas Geoffray83cae422014-10-22 15:08:03 +0100302 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700303 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100304endif
305
306TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
307
Alexandre Rames5319def2014-10-23 10:03:10 +0100308# Known broken tests for the arm64 optimizing compiler backend.
309TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS := \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000310 001-HelloWorld \
Roland Levillained9b1952014-11-06 11:10:17 +0000311 002-sleep \
Alexandre Rames5319def2014-10-23 10:03:10 +0100312 003-omnibus-opcodes \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000313 004-InterfaceTest \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000314 004-JniTest \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000315 004-ReferenceMap \
316 004-SignalTest \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000317 004-StackWalk \
Nicolas Geoffray03e68d52014-11-04 11:49:17 +0000318 004-UnsafeTest \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000319 005-annotations \
Alexandre Rames5319def2014-10-23 10:03:10 +0100320 006-args \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000321 007-count10 \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000322 008-exceptions \
Alexandre Rames5319def2014-10-23 10:03:10 +0100323 011-array-copy \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000324 013-math2 \
325 016-intern \
326 017-float \
Alexandre Rames5319def2014-10-23 10:03:10 +0100327 018-stack-overflow \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000328 019-wrong-array-type \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000329 020-string \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000330 021-string2 \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000331 022-interface \
332 023-many-interfaces \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000333 024-illegal-access \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000334 026-access \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000335 028-array-write \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000336 029-assert \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000337 030-bad-finalizer \
338 031-class-attributes \
339 032-concrete-sub \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000340 033-class-init-deadlock \
341 035-enum \
Alexandre Rames5319def2014-10-23 10:03:10 +0100342 036-finalizer \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000343 037-inherit \
344 038-inner-null \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000345 039-join-main \
346 040-miranda \
347 042-new-instance \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000348 043-privates \
Alexandre Rames5319def2014-10-23 10:03:10 +0100349 044-proxy \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000350 045-reflect-array \
351 046-reflect \
352 047-returns \
353 049-show-object \
354 050-sync-test \
355 051-thread \
356 052-verifier-fun \
357 054-uncaught \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000358 055-enum-performance \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000359 056-const-string-jumbo \
360 061-out-of-memory \
361 063-process-manager \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000362 064-field-access \
363 065-mismatched-implements \
364 066-mismatched-super \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000365 067-preemptive-unpark \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000366 068-classloader \
367 069-field-type \
Alexandre Rames5319def2014-10-23 10:03:10 +0100368 070-nio-buffer \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000369 071-dexfile \
Alexandre Rames5319def2014-10-23 10:03:10 +0100370 072-precise-gc \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000371 074-gc-thrash \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000372 075-verification-error \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000373 076-boolean-put \
374 077-method-override \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000375 078-polymorphic-virtual \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000376 079-phantom \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000377 080-oom-throw \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000378 081-hot-exceptions \
Alexandre Rames5319def2014-10-23 10:03:10 +0100379 082-inline-execute \
380 083-compiler-regressions \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000381 084-class-init \
382 085-old-style-inner-class \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000383 086-null-super \
384 087-gc-after-link \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000385 088-monitor-verification \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000386 090-loop-formation \
387 092-locale \
Alexandre Rames5319def2014-10-23 10:03:10 +0100388 093-serialization \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000389 094-pattern \
Alexandre Rames5319def2014-10-23 10:03:10 +0100390 096-array-copy-concurrent-gc \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000391 097-duplicate-method \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000392 098-ddmc \
Alexandre Rames5319def2014-10-23 10:03:10 +0100393 100-reflect2 \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000394 101-fibonacci \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000395 102-concurrent-gc \
396 103-string-append \
Nicolas Geoffray96d9c0d2014-11-10 11:03:16 +0000397 104-growth-limit \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000398 105-invoke \
Alexandre Rames5319def2014-10-23 10:03:10 +0100399 106-exceptions2 \
400 107-int-math2 \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000401 109-suspend-check \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000402 110-field-access \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000403 111-unresolvable-exception \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000404 112-double-math \
405 113-multidex \
406 117-nopatchoat \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000407 118-noimage-dex2oat \
408 119-noimage-patchoat \
Alexandre Rames5319def2014-10-23 10:03:10 +0100409 121-modifiers \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000410 121-simple-suspend-check \
Alexandre Rames5319def2014-10-23 10:03:10 +0100411 122-npe \
412 123-compiler-regressions-mt \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000413 124-missing-classes \
414 125-gc-and-classloading \
Nicolas Geoffray4b420e72014-11-04 09:15:35 +0000415 126-miranda-multidex \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000416 201-built-in-exception-detail-messages \
417 202-thread-oome \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000418 300-package-override \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000419 301-abstract-protected \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000420 303-verification-stress \
421 401-optimizing-compiler \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000422 402-optimizing-control-flow \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000423 403-optimizing-long \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000424 404-optimizing-allocator \
Alexandre Rames5319def2014-10-23 10:03:10 +0100425 405-optimizing-long-allocator \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000426 406-fields \
Alexandre Rames5319def2014-10-23 10:03:10 +0100427 407-arrays \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000428 409-materialized-condition \
Alexandre Rames5319def2014-10-23 10:03:10 +0100429 410-floats \
430 411-optimizing-arith \
431 412-new-array \
432 413-regalloc-regression \
Calin Juravle096cc022014-10-23 17:01:13 +0100433 414-optimizing-arith-sub \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000434 414-static-fields \
Roland Levillain66ce1732014-10-23 16:38:33 +0100435 415-optimizing-arith-neg \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000436 416-optimizing-arith-not \
Calin Juravle7c4954d2014-10-28 16:57:40 +0000437 417-optimizing-arith-div \
Nicolas Geoffrayb5f62b32014-10-30 10:58:41 +0000438 418-const-string \
Nicolas Geoffray020ac032014-10-30 17:33:03 +0000439 419-long-parameter \
Nicolas Geoffray424f6762014-11-03 14:51:25 +0000440 420-const-class \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000441 421-exceptions \
Nicolas Geoffray0deac2f2014-11-06 17:37:50 +0000442 421-large-frame \
Nicolas Geoffray6f5c41f2014-11-06 08:59:20 +0000443 422-instanceof \
Roland Levillaindff1f282014-11-05 14:15:05 +0000444 422-type-conversion \
Nicolas Geoffray52839d12014-11-07 17:47:25 +0000445 423-invoke-interface \
Alexandre Rames5319def2014-10-23 10:03:10 +0100446 700-LoadArgRegs \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000447 701-easy-div-rem \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000448 702-LargeBranchOffset \
Nicolas Geoffray6fb4ef52014-11-06 09:33:43 +0000449 703-floating-point-div \
Alexandre Rames5319def2014-10-23 10:03:10 +0100450 800-smali
451
452ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
453 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
454 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700455 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS),64)
Alexandre Rames5319def2014-10-23 10:03:10 +0100456endif
457
458TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
459
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100460# Known broken tests for the optimizing compiler.
461TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS := \
462 099-vmdebug \ # b/18098594
463
464ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
465 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
466 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
467 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
468endif
469
470TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
471
Alexandre Rames5319def2014-10-23 10:03:10 +0100472
Ian Rogersf5c44b32014-08-19 16:52:36 -0700473# Clear variables ahead of appending to them when defining tests.
474$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
475$(foreach target, $(TARGET_TYPES), \
476 $(foreach prebuild, $(PREBUILD_TYPES), \
477 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
478$(foreach target, $(TARGET_TYPES), \
479 $(foreach compiler, $(COMPILER_TYPES), \
480 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
481$(foreach target, $(TARGET_TYPES), \
482 $(foreach relocate, $(RELOCATE_TYPES), \
483 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
484$(foreach target, $(TARGET_TYPES), \
485 $(foreach trace, $(TRACE_TYPES), \
486 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
487$(foreach target, $(TARGET_TYPES), \
488 $(foreach gc, $(GC_TYPES), \
489 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
490$(foreach target, $(TARGET_TYPES), \
491 $(foreach jni, $(JNI_TYPES), \
492 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
493$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700494 $(foreach image, $(IMAGE_TYPES), \
495 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
496$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700497 $(foreach test, $(TEST_ART_RUN_TESTS), \
498 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
499$(foreach target, $(TARGET_TYPES), \
500 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
501 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100502$(foreach target, $(TARGET_TYPES), \
503 $(foreach run_type, $(RUN_TYPES), \
504 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700505
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700506# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
507# only once).
508TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700509
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700510# Also need libarttest.
511TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
512ifdef TARGET_2ND_ARCH
513TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
514endif
515
Andreas Gampe855564b2014-07-25 02:32:19 -0700516# Also need libnativebridgetest.
517TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
518ifdef TARGET_2ND_ARCH
519TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
520endif
521
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700522# All tests require the host executables. The tests also depend on the core images, but on
523# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700524ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
525 $(ART_HOST_EXECUTABLES) \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700526 $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700527 $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700528 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700529
530ifneq ($(HOST_PREFER_32_BIT),true)
531ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700532 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700533 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700534 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700535endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700536
Ian Rogersf5c44b32014-08-19 16:52:36 -0700537# Create a rule to build and run a tests following the form:
Calin Juravle9228b2a2014-10-22 15:54:34 +0100538# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100539# {4: interpreter default optimizing}-{5: relocate no-relocate relocate-no-patchoat}-
540# {6: trace or no-trace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
Andreas Gampec23c9c92014-10-28 14:47:25 -0700541# {9: no-image image picimage}-{10: pictest nopictest}-{11: test name}{12: 32 or 64}
Ian Rogersafd9acc2014-06-17 08:21:54 -0700542define define-test-art-run-test
Nicolas Geoffray611e1db2014-10-09 17:34:45 +0100543 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700544 prereq_rule :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700545 test_groups :=
546 uc_host_or_target :=
Alex Lightbfac14a2014-07-30 09:41:21 -0700547 ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
548 run_test_options += --always-clean
549 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700550 ifeq ($(1),host)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700551 uc_host_or_target := HOST
Ian Rogersf5c44b32014-08-19 16:52:36 -0700552 test_groups := ART_RUN_TEST_HOST_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700553 run_test_options += --host
554 prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
555 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700556 ifeq ($(1),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700557 uc_host_or_target := TARGET
Ian Rogersf5c44b32014-08-19 16:52:36 -0700558 test_groups := ART_RUN_TEST_TARGET_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700559 prereq_rule := test-art-target-sync
560 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700561 $$(error found $(1) expected $(TARGET_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700562 endif
563 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100564 ifeq ($(2),debug)
565 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
566 else
567 ifeq ($(2),ndebug)
568 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
569 run_test_options += -O
570 else
571 $$(error found $(2) expected $(RUN_TYPES))
572 endif
573 endif
574 ifeq ($(3),prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700575 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
576 run_test_options += --prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700577 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100578 ifeq ($(3),no-prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700579 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
580 run_test_options += --no-prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700581 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100582 ifeq ($(3),no-dex2oat)
Alex Light03a112d2014-08-25 13:25:56 -0700583 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
584 run_test_options += --no-prebuild --no-dex2oat
585 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100586 $$(error found $(3) expected $(PREBUILD_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700587 endif
Alex Lighta59dd802014-07-02 16:28:08 -0700588 endif
589 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100590 ifeq ($(4),optimizing)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700591 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700592 run_test_options += --optimizing
Ian Rogersafd9acc2014-06-17 08:21:54 -0700593 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100594 ifeq ($(4),interpreter)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700595 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700596 run_test_options += --interpreter
597 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100598 ifeq ($(4),default)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700599 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700600 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100601 $$(error found $(4) expected $(COMPILER_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700602 endif
603 endif
604 endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700605
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100606 ifeq ($(5),relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700607 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
608 run_test_options += --relocate
Ian Rogersafd9acc2014-06-17 08:21:54 -0700609 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100610 ifeq ($(5),no-relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700611 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
612 run_test_options += --no-relocate
613 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100614 ifeq ($(5),relocate-no-patchoat)
Alex Light03a112d2014-08-25 13:25:56 -0700615 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
616 run_test_options += --relocate --no-patchoat
617 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100618 $$(error found $(5) expected $(RELOCATE_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700619 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700620 endif
621 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100622 ifeq ($(6),trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700623 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
Ian Rogers716e4f82014-07-16 11:18:03 -0700624 run_test_options += --trace
Ian Rogers716e4f82014-07-16 11:18:03 -0700625 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100626 ifeq ($(6),no-trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700627 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
Ian Rogers701aa642014-07-18 11:38:13 -0700628 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100629 $$(error found $(6) expected $(TRACE_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700630 endif
631 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100632 ifeq ($(7),gcverify)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700633 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700634 run_test_options += --gcverify
635 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100636 ifeq ($(7),gcstress)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700637 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700638 run_test_options += --gcstress
639 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100640 ifeq ($(7),cms)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700641 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
Ian Rogers8a14b752014-07-18 15:06:53 -0700642 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100643 $$(error found $(7) expected $(GC_TYPES))
Ian Rogers701aa642014-07-18 11:38:13 -0700644 endif
Ian Rogers716e4f82014-07-16 11:18:03 -0700645 endif
646 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100647 ifeq ($(8),forcecopy)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700648 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700649 run_test_options += --runtime-option -Xjniopts:forcecopy
650 ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
651 skip_test := true
652 endif
653 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100654 ifeq ($(8),checkjni)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700655 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700656 run_test_options += --runtime-option -Xcheck:jni
657 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100658 ifeq ($(8),jni)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700659 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
660 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100661 $$(error found $(8) expected $(JNI_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700662 endif
663 endif
664 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100665 ifeq ($(9),no-image)
Alex Light03a112d2014-08-25 13:25:56 -0700666 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
667 run_test_options += --no-image
Andreas Gampebf03e842014-10-29 20:46:17 -0700668 # Add the core dependency. This is required for pre-building.
669 ifeq ($(1),host)
670 prereq_rule += $(HOST_CORE_IMAGE_$(4)_no-pic_$(12))
671 else
672 prereq_rule += $(TARGET_CORE_IMAGE_$(4)_no-pic_$(12))
673 endif
Alex Light03a112d2014-08-25 13:25:56 -0700674 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100675 ifeq ($(9),image)
Alex Light03a112d2014-08-25 13:25:56 -0700676 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
Andreas Gampec23c9c92014-10-28 14:47:25 -0700677 # Add the core dependency.
678 ifeq ($(1),host)
679 prereq_rule += $(HOST_CORE_IMAGE_$(4)_no-pic_$(12))
680 else
681 prereq_rule += $(TARGET_CORE_IMAGE_$(4)_no-pic_$(12))
682 endif
Alex Light03a112d2014-08-25 13:25:56 -0700683 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700684 ifeq ($(9),picimage)
685 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
686 run_test_options += --pic-image
687 ifeq ($(1),host)
688 prereq_rule += $(HOST_CORE_IMAGE_$(4)_pic_$(12))
689 else
690 prereq_rule += $(TARGET_CORE_IMAGE_$(4)_pic_$(12))
691 endif
692 else
693 $$(error found $(9) expected $(IMAGE_TYPES))
694 endif
Alex Light03a112d2014-08-25 13:25:56 -0700695 endif
696 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700697 ifeq ($(10),pictest)
698 run_test_options += --pic-test
699 else
700 ifeq ($(10),nopictest)
701 # Nothing to be done.
702 else
703 $$(error found $(10) expected $(PICTEST_TYPES))
704 endif
705 endif
706 # $(11) is the test name
707 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(11))_RULES
708 ifeq ($(12),64)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700709 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
710 run_test_options += --64
711 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700712 ifeq ($(12),32)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700713 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
714 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700715 $$(error found $(12) expected $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700716 endif
717 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700718 run_test_rule_name := test-art-$(1)-run-test-$(2)-$(3)-$(4)-$(5)-$(6)-$(7)-$(8)-$(9)-$(10)-$(11)$(12)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700719 run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
Ian Rogers5242c0a2014-07-18 11:02:19 -0700720 $$(run_test_options)
Nicolas Geoffrayc8f23fc2014-10-28 17:59:47 +0000721 ifneq ($(ART_TEST_ANDROID_ROOT),)
722 run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
723 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700724$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
725.PHONY: $$(run_test_rule_name)
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700726$$(run_test_rule_name): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $(HOST_OUT_EXECUTABLES)/smali $(HOST_OUT_EXECUTABLES)/dexmerger $$(prereq_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700727 $(hide) $$(call ART_TEST_SKIP,$$@) && \
728 DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700729 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
730 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700731 art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(11) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700732 && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
733 $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
734 echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
735 rm -r $(ART_HOST_TEST_DIR)) || true
736
Ian Rogersf5c44b32014-08-19 16:52:36 -0700737 $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700738
739 # Clear locally defined variables.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700740 uc_host_or_target :=
741 test_groups :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700742 run_test_options :=
743 run_test_rule_name :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700744 prereq_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700745endef # define-test-art-run-test
746
Ian Rogersf5c44b32014-08-19 16:52:36 -0700747$(foreach target, $(TARGET_TYPES), \
748 $(foreach test, $(TEST_ART_RUN_TESTS), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100749 $(foreach run_type, $(RUN_TYPES), \
750 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
751 $(foreach prebuild, $(PREBUILD_TYPES), \
752 $(foreach compiler, $(COMPILER_TYPES), \
753 $(foreach relocate, $(RELOCATE_TYPES), \
754 $(foreach trace, $(TRACE_TYPES), \
755 $(foreach gc, $(GC_TYPES), \
756 $(foreach jni, $(JNI_TYPES), \
757 $(foreach image, $(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700758 $(foreach pictest, $(PICTEST_TYPES), \
759 $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(test),$(address_size))) \
760 ))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700761define-test-art-run-test :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700762
Ian Rogersafd9acc2014-06-17 08:21:54 -0700763# Define a phony rule whose purpose is to test its prerequisites.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700764# $(1): host or target
Ian Rogersafd9acc2014-06-17 08:21:54 -0700765# $(2): list of prerequisites
Ian Rogersf5c44b32014-08-19 16:52:36 -0700766define define-test-art-run-test-group
Ian Rogersafd9acc2014-06-17 08:21:54 -0700767.PHONY: $(1)
768$(1): $(2)
769 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
770
Ian Rogersafd9acc2014-06-17 08:21:54 -0700771endef # define-test-art-run-test-group
772
Ian Rogersafd9acc2014-06-17 08:21:54 -0700773
Ian Rogersf5c44b32014-08-19 16:52:36 -0700774$(foreach target, $(TARGET_TYPES), $(eval \
775 $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
776$(foreach target, $(TARGET_TYPES), \
777 $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
778 $(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)))))
779$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100780 $(foreach run-type, $(RUN_TYPES), $(eval \
781 $(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)))))
782$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700783 $(foreach compiler, $(COMPILER_TYPES), $(eval \
784 $(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)))))
785$(foreach target, $(TARGET_TYPES), \
786 $(foreach relocate, $(RELOCATE_TYPES), $(eval \
787 $(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)))))
788$(foreach target, $(TARGET_TYPES), \
789 $(foreach trace, $(TRACE_TYPES), $(eval \
790 $(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)))))
791$(foreach target, $(TARGET_TYPES), \
792 $(foreach gc, $(GC_TYPES), $(eval \
793 $(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)))))
794$(foreach target, $(TARGET_TYPES), \
795 $(foreach jni, $(JNI_TYPES), $(eval \
796 $(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)))))
797$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700798 $(foreach image, $(IMAGE_TYPES), $(eval \
799 $(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)))))
800$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700801 $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
802 $(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)))))
803$(foreach target, $(TARGET_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700804 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
Ian Rogersa3cf6ce2014-10-02 16:35:52 -0700805 $(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 -0700806
Ian Rogersf5c44b32014-08-19 16:52:36 -0700807# Clear variables now we're finished with them.
808$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
809$(foreach target, $(TARGET_TYPES), \
810 $(foreach prebuild, $(PREBUILD_TYPES), \
811 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
812$(foreach target, $(TARGET_TYPES), \
813 $(foreach compiler, $(COMPILER_TYPES), \
814 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
815$(foreach target, $(TARGET_TYPES), \
816 $(foreach relocate, $(RELOCATE_TYPES), \
817 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
818$(foreach target, $(TARGET_TYPES), \
819 $(foreach trace, $(TRACE_TYPES), \
820 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
821$(foreach target, $(TARGET_TYPES), \
822 $(foreach gc, $(GC_TYPES), \
823 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
824$(foreach target, $(TARGET_TYPES), \
825 $(foreach jni, $(JNI_TYPES), \
826 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
827$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700828 $(foreach image, $(IMAGE_TYPES), \
829 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
830$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700831 $(foreach test, $(TEST_ART_RUN_TESTS), \
832 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
833$(foreach target, $(TARGET_TYPES), \
834 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
835 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100836$(foreach target, $(TARGET_TYPES), \
837 $(foreach run_type, $(RUN_TYPES), \
838 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700839define-test-art-run-test-group :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700840TARGET_TYPES :=
841PREBUILD_TYPES :=
842COMPILER_TYPES :=
843RELOCATE_TYPES :=
844TRACE_TYPES :=
845GC_TYPES :=
846JNI_TYPES :=
Alex Light03a112d2014-08-25 13:25:56 -0700847IMAGE_TYPES :=
Ian Rogers86df3ac2014-08-27 10:54:11 -0700848ADDRESS_SIZES_TARGET :=
849ADDRESS_SIZES_HOST :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700850ALL_ADDRESS_SIZES :=
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100851RUN_TYPES :=
Ian Rogers9fcaa4b2014-08-26 19:59:52 -0700852
853include $(LOCAL_PATH)/Android.libarttest.mk
854include art/test/Android.libnativebridgetest.mk