blob: e7a04391b2618750c6f457ec33d8bcf7f8000e5f [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).
298TEST_ART_BROKEN_DEFAULT_RUN_TESTS := \
299 412-new-array
300
301ifneq (,$(filter default,$(COMPILER_TYPES)))
302 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Nicolas Geoffray83cae422014-10-22 15:08:03 +0100303 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700304 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100305endif
306
307TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
308
Alexandre Rames5319def2014-10-23 10:03:10 +0100309# Known broken tests for the arm64 optimizing compiler backend.
310TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS := \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000311 001-HelloWorld \
Roland Levillained9b1952014-11-06 11:10:17 +0000312 002-sleep \
Alexandre Rames5319def2014-10-23 10:03:10 +0100313 003-omnibus-opcodes \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000314 004-InterfaceTest \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000315 004-JniTest \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000316 004-ReferenceMap \
317 004-SignalTest \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000318 004-StackWalk \
Nicolas Geoffray03e68d52014-11-04 11:49:17 +0000319 004-UnsafeTest \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000320 005-annotations \
Alexandre Rames5319def2014-10-23 10:03:10 +0100321 006-args \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000322 007-count10 \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000323 008-exceptions \
Alexandre Rames5319def2014-10-23 10:03:10 +0100324 011-array-copy \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000325 013-math2 \
326 016-intern \
327 017-float \
Alexandre Rames5319def2014-10-23 10:03:10 +0100328 018-stack-overflow \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000329 019-wrong-array-type \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000330 020-string \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000331 021-string2 \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000332 022-interface \
333 023-many-interfaces \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000334 024-illegal-access \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000335 026-access \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000336 028-array-write \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000337 029-assert \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000338 030-bad-finalizer \
339 031-class-attributes \
340 032-concrete-sub \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000341 033-class-init-deadlock \
342 035-enum \
Alexandre Rames5319def2014-10-23 10:03:10 +0100343 036-finalizer \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000344 037-inherit \
345 038-inner-null \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000346 039-join-main \
347 040-miranda \
348 042-new-instance \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000349 043-privates \
Alexandre Rames5319def2014-10-23 10:03:10 +0100350 044-proxy \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000351 045-reflect-array \
352 046-reflect \
353 047-returns \
354 049-show-object \
355 050-sync-test \
356 051-thread \
357 052-verifier-fun \
358 054-uncaught \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000359 055-enum-performance \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000360 056-const-string-jumbo \
361 061-out-of-memory \
362 063-process-manager \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000363 064-field-access \
364 065-mismatched-implements \
365 066-mismatched-super \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000366 067-preemptive-unpark \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000367 068-classloader \
368 069-field-type \
Alexandre Rames5319def2014-10-23 10:03:10 +0100369 070-nio-buffer \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000370 071-dexfile \
Alexandre Rames5319def2014-10-23 10:03:10 +0100371 072-precise-gc \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000372 074-gc-thrash \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000373 075-verification-error \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000374 076-boolean-put \
375 077-method-override \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000376 078-polymorphic-virtual \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000377 079-phantom \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000378 080-oom-throw \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000379 081-hot-exceptions \
Alexandre Rames5319def2014-10-23 10:03:10 +0100380 082-inline-execute \
381 083-compiler-regressions \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000382 084-class-init \
383 085-old-style-inner-class \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000384 086-null-super \
385 087-gc-after-link \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000386 088-monitor-verification \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000387 090-loop-formation \
388 092-locale \
Alexandre Rames5319def2014-10-23 10:03:10 +0100389 093-serialization \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000390 094-pattern \
Alexandre Rames5319def2014-10-23 10:03:10 +0100391 096-array-copy-concurrent-gc \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000392 097-duplicate-method \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000393 098-ddmc \
Alexandre Rames5319def2014-10-23 10:03:10 +0100394 100-reflect2 \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000395 101-fibonacci \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000396 102-concurrent-gc \
397 103-string-append \
Nicolas Geoffray96d9c0d2014-11-10 11:03:16 +0000398 104-growth-limit \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000399 105-invoke \
Alexandre Rames5319def2014-10-23 10:03:10 +0100400 106-exceptions2 \
401 107-int-math2 \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000402 109-suspend-check \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000403 110-field-access \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000404 111-unresolvable-exception \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000405 112-double-math \
406 113-multidex \
407 117-nopatchoat \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000408 118-noimage-dex2oat \
409 119-noimage-patchoat \
Alexandre Rames5319def2014-10-23 10:03:10 +0100410 121-modifiers \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000411 121-simple-suspend-check \
Alexandre Rames5319def2014-10-23 10:03:10 +0100412 122-npe \
413 123-compiler-regressions-mt \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000414 124-missing-classes \
415 125-gc-and-classloading \
Nicolas Geoffray4b420e72014-11-04 09:15:35 +0000416 126-miranda-multidex \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000417 201-built-in-exception-detail-messages \
418 202-thread-oome \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000419 300-package-override \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000420 301-abstract-protected \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000421 303-verification-stress \
422 401-optimizing-compiler \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000423 402-optimizing-control-flow \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000424 403-optimizing-long \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000425 404-optimizing-allocator \
Alexandre Rames5319def2014-10-23 10:03:10 +0100426 405-optimizing-long-allocator \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000427 406-fields \
Alexandre Rames5319def2014-10-23 10:03:10 +0100428 407-arrays \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000429 409-materialized-condition \
Alexandre Rames5319def2014-10-23 10:03:10 +0100430 410-floats \
431 411-optimizing-arith \
432 412-new-array \
433 413-regalloc-regression \
Calin Juravle096cc022014-10-23 17:01:13 +0100434 414-optimizing-arith-sub \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000435 414-static-fields \
Roland Levillain66ce1732014-10-23 16:38:33 +0100436 415-optimizing-arith-neg \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000437 416-optimizing-arith-not \
Calin Juravle7c4954d2014-10-28 16:57:40 +0000438 417-optimizing-arith-div \
Nicolas Geoffrayb5f62b32014-10-30 10:58:41 +0000439 418-const-string \
Nicolas Geoffray020ac032014-10-30 17:33:03 +0000440 419-long-parameter \
Nicolas Geoffray424f6762014-11-03 14:51:25 +0000441 420-const-class \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000442 421-exceptions \
Nicolas Geoffray0deac2f2014-11-06 17:37:50 +0000443 421-large-frame \
Nicolas Geoffray6f5c41f2014-11-06 08:59:20 +0000444 422-instanceof \
Roland Levillaindff1f282014-11-05 14:15:05 +0000445 422-type-conversion \
Nicolas Geoffray52839d12014-11-07 17:47:25 +0000446 423-invoke-interface \
Alexandre Rames5319def2014-10-23 10:03:10 +0100447 700-LoadArgRegs \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000448 701-easy-div-rem \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000449 702-LargeBranchOffset \
Nicolas Geoffray6fb4ef52014-11-06 09:33:43 +0000450 703-floating-point-div \
Alexandre Rames5319def2014-10-23 10:03:10 +0100451 800-smali
452
453ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
454 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
455 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700456 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS),64)
Alexandre Rames5319def2014-10-23 10:03:10 +0100457endif
458
459TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
460
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100461# Known broken tests for the optimizing compiler.
462TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS := \
463 099-vmdebug \ # b/18098594
464
465ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
466 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
467 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
468 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
469endif
470
471TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
472
Alexandre Rames5319def2014-10-23 10:03:10 +0100473
Ian Rogersf5c44b32014-08-19 16:52:36 -0700474# Clear variables ahead of appending to them when defining tests.
475$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
476$(foreach target, $(TARGET_TYPES), \
477 $(foreach prebuild, $(PREBUILD_TYPES), \
478 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
479$(foreach target, $(TARGET_TYPES), \
480 $(foreach compiler, $(COMPILER_TYPES), \
481 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
482$(foreach target, $(TARGET_TYPES), \
483 $(foreach relocate, $(RELOCATE_TYPES), \
484 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
485$(foreach target, $(TARGET_TYPES), \
486 $(foreach trace, $(TRACE_TYPES), \
487 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
488$(foreach target, $(TARGET_TYPES), \
489 $(foreach gc, $(GC_TYPES), \
490 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
491$(foreach target, $(TARGET_TYPES), \
492 $(foreach jni, $(JNI_TYPES), \
493 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
494$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700495 $(foreach image, $(IMAGE_TYPES), \
496 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
497$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700498 $(foreach test, $(TEST_ART_RUN_TESTS), \
499 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
500$(foreach target, $(TARGET_TYPES), \
501 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
502 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100503$(foreach target, $(TARGET_TYPES), \
504 $(foreach run_type, $(RUN_TYPES), \
505 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700506
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700507# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
508# only once).
509TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700510
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700511# Also need libarttest.
512TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
513ifdef TARGET_2ND_ARCH
514TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
515endif
516
Andreas Gampe855564b2014-07-25 02:32:19 -0700517# Also need libnativebridgetest.
518TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
519ifdef TARGET_2ND_ARCH
520TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
521endif
522
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700523# All tests require the host executables. The tests also depend on the core images, but on
524# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700525ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
526 $(ART_HOST_EXECUTABLES) \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700527 $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700528 $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700529 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700530
531ifneq ($(HOST_PREFER_32_BIT),true)
532ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700533 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700534 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700535 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700536endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700537
Ian Rogersf5c44b32014-08-19 16:52:36 -0700538# Create a rule to build and run a tests following the form:
Calin Juravle9228b2a2014-10-22 15:54:34 +0100539# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100540# {4: interpreter default optimizing}-{5: relocate no-relocate relocate-no-patchoat}-
541# {6: trace or no-trace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
Andreas Gampec23c9c92014-10-28 14:47:25 -0700542# {9: no-image image picimage}-{10: pictest nopictest}-{11: test name}{12: 32 or 64}
Ian Rogersafd9acc2014-06-17 08:21:54 -0700543define define-test-art-run-test
Nicolas Geoffray611e1db2014-10-09 17:34:45 +0100544 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700545 prereq_rule :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700546 test_groups :=
547 uc_host_or_target :=
Alex Lightbfac14a2014-07-30 09:41:21 -0700548 ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
549 run_test_options += --always-clean
550 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700551 ifeq ($(1),host)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700552 uc_host_or_target := HOST
Ian Rogersf5c44b32014-08-19 16:52:36 -0700553 test_groups := ART_RUN_TEST_HOST_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700554 run_test_options += --host
555 prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
556 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700557 ifeq ($(1),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700558 uc_host_or_target := TARGET
Ian Rogersf5c44b32014-08-19 16:52:36 -0700559 test_groups := ART_RUN_TEST_TARGET_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700560 prereq_rule := test-art-target-sync
561 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700562 $$(error found $(1) expected $(TARGET_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700563 endif
564 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100565 ifeq ($(2),debug)
566 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
567 else
568 ifeq ($(2),ndebug)
569 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
570 run_test_options += -O
571 else
572 $$(error found $(2) expected $(RUN_TYPES))
573 endif
574 endif
575 ifeq ($(3),prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700576 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
577 run_test_options += --prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700578 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100579 ifeq ($(3),no-prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700580 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
581 run_test_options += --no-prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700582 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100583 ifeq ($(3),no-dex2oat)
Alex Light03a112d2014-08-25 13:25:56 -0700584 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
585 run_test_options += --no-prebuild --no-dex2oat
586 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100587 $$(error found $(3) expected $(PREBUILD_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700588 endif
Alex Lighta59dd802014-07-02 16:28:08 -0700589 endif
590 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100591 ifeq ($(4),optimizing)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700592 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700593 run_test_options += --optimizing
Ian Rogersafd9acc2014-06-17 08:21:54 -0700594 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100595 ifeq ($(4),interpreter)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700596 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700597 run_test_options += --interpreter
598 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100599 ifeq ($(4),default)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700600 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700601 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100602 $$(error found $(4) expected $(COMPILER_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700603 endif
604 endif
605 endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700606
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100607 ifeq ($(5),relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700608 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
609 run_test_options += --relocate
Ian Rogersafd9acc2014-06-17 08:21:54 -0700610 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100611 ifeq ($(5),no-relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700612 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
613 run_test_options += --no-relocate
614 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100615 ifeq ($(5),relocate-no-patchoat)
Alex Light03a112d2014-08-25 13:25:56 -0700616 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
617 run_test_options += --relocate --no-patchoat
618 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100619 $$(error found $(5) expected $(RELOCATE_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700620 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700621 endif
622 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100623 ifeq ($(6),trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700624 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
Ian Rogers716e4f82014-07-16 11:18:03 -0700625 run_test_options += --trace
Ian Rogers716e4f82014-07-16 11:18:03 -0700626 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100627 ifeq ($(6),no-trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700628 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
Ian Rogers701aa642014-07-18 11:38:13 -0700629 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100630 $$(error found $(6) expected $(TRACE_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700631 endif
632 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100633 ifeq ($(7),gcverify)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700634 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700635 run_test_options += --gcverify
636 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100637 ifeq ($(7),gcstress)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700638 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700639 run_test_options += --gcstress
640 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100641 ifeq ($(7),cms)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700642 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
Ian Rogers8a14b752014-07-18 15:06:53 -0700643 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100644 $$(error found $(7) expected $(GC_TYPES))
Ian Rogers701aa642014-07-18 11:38:13 -0700645 endif
Ian Rogers716e4f82014-07-16 11:18:03 -0700646 endif
647 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100648 ifeq ($(8),forcecopy)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700649 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700650 run_test_options += --runtime-option -Xjniopts:forcecopy
651 ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
652 skip_test := true
653 endif
654 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100655 ifeq ($(8),checkjni)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700656 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700657 run_test_options += --runtime-option -Xcheck:jni
658 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100659 ifeq ($(8),jni)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700660 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
661 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100662 $$(error found $(8) expected $(JNI_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700663 endif
664 endif
665 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100666 ifeq ($(9),no-image)
Alex Light03a112d2014-08-25 13:25:56 -0700667 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
668 run_test_options += --no-image
Andreas Gampebf03e842014-10-29 20:46:17 -0700669 # Add the core dependency. This is required for pre-building.
670 ifeq ($(1),host)
671 prereq_rule += $(HOST_CORE_IMAGE_$(4)_no-pic_$(12))
672 else
673 prereq_rule += $(TARGET_CORE_IMAGE_$(4)_no-pic_$(12))
674 endif
Alex Light03a112d2014-08-25 13:25:56 -0700675 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100676 ifeq ($(9),image)
Alex Light03a112d2014-08-25 13:25:56 -0700677 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
Andreas Gampec23c9c92014-10-28 14:47:25 -0700678 # Add the core dependency.
679 ifeq ($(1),host)
680 prereq_rule += $(HOST_CORE_IMAGE_$(4)_no-pic_$(12))
681 else
682 prereq_rule += $(TARGET_CORE_IMAGE_$(4)_no-pic_$(12))
683 endif
Alex Light03a112d2014-08-25 13:25:56 -0700684 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700685 ifeq ($(9),picimage)
686 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
687 run_test_options += --pic-image
688 ifeq ($(1),host)
689 prereq_rule += $(HOST_CORE_IMAGE_$(4)_pic_$(12))
690 else
691 prereq_rule += $(TARGET_CORE_IMAGE_$(4)_pic_$(12))
692 endif
693 else
694 $$(error found $(9) expected $(IMAGE_TYPES))
695 endif
Alex Light03a112d2014-08-25 13:25:56 -0700696 endif
697 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700698 ifeq ($(10),pictest)
699 run_test_options += --pic-test
700 else
701 ifeq ($(10),nopictest)
702 # Nothing to be done.
703 else
704 $$(error found $(10) expected $(PICTEST_TYPES))
705 endif
706 endif
707 # $(11) is the test name
708 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(11))_RULES
709 ifeq ($(12),64)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700710 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
711 run_test_options += --64
712 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700713 ifeq ($(12),32)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700714 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
715 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700716 $$(error found $(12) expected $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700717 endif
718 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700719 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 -0700720 run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
Ian Rogers5242c0a2014-07-18 11:02:19 -0700721 $$(run_test_options)
Nicolas Geoffrayc8f23fc2014-10-28 17:59:47 +0000722 ifneq ($(ART_TEST_ANDROID_ROOT),)
723 run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
724 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700725$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
726.PHONY: $$(run_test_rule_name)
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700727$$(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 -0700728 $(hide) $$(call ART_TEST_SKIP,$$@) && \
729 DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700730 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
731 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700732 art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(11) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700733 && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
734 $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
735 echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
736 rm -r $(ART_HOST_TEST_DIR)) || true
737
Ian Rogersf5c44b32014-08-19 16:52:36 -0700738 $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700739
740 # Clear locally defined variables.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700741 uc_host_or_target :=
742 test_groups :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700743 run_test_options :=
744 run_test_rule_name :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700745 prereq_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700746endef # define-test-art-run-test
747
Ian Rogersf5c44b32014-08-19 16:52:36 -0700748$(foreach target, $(TARGET_TYPES), \
749 $(foreach test, $(TEST_ART_RUN_TESTS), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100750 $(foreach run_type, $(RUN_TYPES), \
751 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
752 $(foreach prebuild, $(PREBUILD_TYPES), \
753 $(foreach compiler, $(COMPILER_TYPES), \
754 $(foreach relocate, $(RELOCATE_TYPES), \
755 $(foreach trace, $(TRACE_TYPES), \
756 $(foreach gc, $(GC_TYPES), \
757 $(foreach jni, $(JNI_TYPES), \
758 $(foreach image, $(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700759 $(foreach pictest, $(PICTEST_TYPES), \
760 $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(test),$(address_size))) \
761 ))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700762define-test-art-run-test :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700763
Ian Rogersafd9acc2014-06-17 08:21:54 -0700764# Define a phony rule whose purpose is to test its prerequisites.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700765# $(1): host or target
Ian Rogersafd9acc2014-06-17 08:21:54 -0700766# $(2): list of prerequisites
Ian Rogersf5c44b32014-08-19 16:52:36 -0700767define define-test-art-run-test-group
Ian Rogersafd9acc2014-06-17 08:21:54 -0700768.PHONY: $(1)
769$(1): $(2)
770 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
771
Ian Rogersafd9acc2014-06-17 08:21:54 -0700772endef # define-test-art-run-test-group
773
Ian Rogersafd9acc2014-06-17 08:21:54 -0700774
Ian Rogersf5c44b32014-08-19 16:52:36 -0700775$(foreach target, $(TARGET_TYPES), $(eval \
776 $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
777$(foreach target, $(TARGET_TYPES), \
778 $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
779 $(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)))))
780$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100781 $(foreach run-type, $(RUN_TYPES), $(eval \
782 $(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)))))
783$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700784 $(foreach compiler, $(COMPILER_TYPES), $(eval \
785 $(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)))))
786$(foreach target, $(TARGET_TYPES), \
787 $(foreach relocate, $(RELOCATE_TYPES), $(eval \
788 $(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)))))
789$(foreach target, $(TARGET_TYPES), \
790 $(foreach trace, $(TRACE_TYPES), $(eval \
791 $(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)))))
792$(foreach target, $(TARGET_TYPES), \
793 $(foreach gc, $(GC_TYPES), $(eval \
794 $(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)))))
795$(foreach target, $(TARGET_TYPES), \
796 $(foreach jni, $(JNI_TYPES), $(eval \
797 $(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)))))
798$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700799 $(foreach image, $(IMAGE_TYPES), $(eval \
800 $(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)))))
801$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700802 $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
803 $(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)))))
804$(foreach target, $(TARGET_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700805 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
Ian Rogersa3cf6ce2014-10-02 16:35:52 -0700806 $(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 -0700807
Ian Rogersf5c44b32014-08-19 16:52:36 -0700808# Clear variables now we're finished with them.
809$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
810$(foreach target, $(TARGET_TYPES), \
811 $(foreach prebuild, $(PREBUILD_TYPES), \
812 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
813$(foreach target, $(TARGET_TYPES), \
814 $(foreach compiler, $(COMPILER_TYPES), \
815 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
816$(foreach target, $(TARGET_TYPES), \
817 $(foreach relocate, $(RELOCATE_TYPES), \
818 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
819$(foreach target, $(TARGET_TYPES), \
820 $(foreach trace, $(TRACE_TYPES), \
821 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
822$(foreach target, $(TARGET_TYPES), \
823 $(foreach gc, $(GC_TYPES), \
824 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
825$(foreach target, $(TARGET_TYPES), \
826 $(foreach jni, $(JNI_TYPES), \
827 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
828$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700829 $(foreach image, $(IMAGE_TYPES), \
830 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
831$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700832 $(foreach test, $(TEST_ART_RUN_TESTS), \
833 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
834$(foreach target, $(TARGET_TYPES), \
835 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
836 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100837$(foreach target, $(TARGET_TYPES), \
838 $(foreach run_type, $(RUN_TYPES), \
839 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700840define-test-art-run-test-group :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700841TARGET_TYPES :=
842PREBUILD_TYPES :=
843COMPILER_TYPES :=
844RELOCATE_TYPES :=
845TRACE_TYPES :=
846GC_TYPES :=
847JNI_TYPES :=
Alex Light03a112d2014-08-25 13:25:56 -0700848IMAGE_TYPES :=
Ian Rogers86df3ac2014-08-27 10:54:11 -0700849ADDRESS_SIZES_TARGET :=
850ADDRESS_SIZES_HOST :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700851ALL_ADDRESS_SIZES :=
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100852RUN_TYPES :=
Ian Rogers9fcaa4b2014-08-26 19:59:52 -0700853
854include $(LOCAL_PATH)/Android.libarttest.mk
855include art/test/Android.libnativebridgetest.mk