blob: a6f31b4aa5a4b5668b27578081e48bee50d2c48c [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
Ian Rogers40e19122014-09-02 15:59:28 -0700180# 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 -0700181TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \
182 116-nodex2oat
183
Ian Rogers40e19122014-09-02 15:59:28 -0700184ifneq (,$(filter prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100185 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700186 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700187 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700188endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700189
Ian Rogers86df3ac2014-08-27 10:54:11 -0700190TEST_ART_BROKEN_PREBUILD_RUN_TESTS :=
191
Ian Rogersf5c44b32014-08-19 16:52:36 -0700192TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
193 117-nopatchoat
194
Ian Rogers40e19122014-09-02 15:59:28 -0700195ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100196 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700197 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700198 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700199endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700200
Ian Rogers86df3ac2014-08-27 10:54:11 -0700201TEST_ART_BROKEN_NO_PREBUILD_TESTS :=
202
Ian Rogers40e19122014-09-02 15:59:28 -0700203# Note 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without
204# --prebuild --relocate
205TEST_ART_BROKEN_NO_RELOCATE_TESTS := \
206 117-nopatchoat
207
208ifneq (,$(filter no-relocate,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100209 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700210 $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700211 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700212endif
213
214TEST_ART_BROKEN_NO_RELOCATE_TESTS :=
215
Ian Rogers40e19122014-09-02 15:59:28 -0700216# Tests that are broken with GC stress.
217TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := \
Ian Rogers58920cc2014-10-10 12:39:31 -0700218 004-SignalTest \
219 114-ParallelGC
Ian Rogers40e19122014-09-02 15:59:28 -0700220
221ifneq (,$(filter gcstress,$(GC_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100222 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700223 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700224 $(IMAGE_TYPES), $(PICTEST_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700225endif
226
227TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
228
Ian Rogersf5c44b32014-08-19 16:52:36 -0700229# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100230ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700231 $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),115-native-bridge, \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700232 $(ALL_ADDRESS_SIZES))
233
Alex Light03a112d2014-08-25 13:25:56 -0700234# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
235# Therefore we shouldn't run them in situations where we actually don't have these since they
236# explicitly test for them. These all also assume we have an image.
237TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
238 116-nodex2oat \
239 117-nopatchoat \
240 118-noimage-dex2oat \
241 119-noimage-patchoat
242
Ian Rogers40e19122014-09-02 15:59:28 -0700243ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100244 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
Ian Rogers40e19122014-09-02 15:59:28 -0700245 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700246 $(PICTEST_TYPES),$(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700247endif
Alex Light03a112d2014-08-25 13:25:56 -0700248
Alex Light03a112d2014-08-25 13:25:56 -0700249
Ian Rogers40e19122014-09-02 15:59:28 -0700250ifneq (,$(filter no-image,$(IMAGE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100251 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700252 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700253 $(PICTEST_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700254endif
255
256ifneq (,$(filter relocate-no-patchoat,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100257 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700258 $(COMPILER_TYPES), relocate-no-patchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700259 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700260endif
Alex Light03a112d2014-08-25 13:25:56 -0700261
Ian Rogers86df3ac2014-08-27 10:54:11 -0700262TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
263
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100264# The following tests use libarttest.so, which is linked against libartd.so, so will
265# not work when libart.so is the one loaded.
266# TODO: Find a way to run these tests in ndebug mode.
267TEST_ART_BROKEN_NDEBUG_TESTS := \
268 004-JniTest \
269 004-ReferenceMap \
270 004-SignalTest \
271 004-StackWalk \
272 004-UnsafeTest \
Nicolas Geoffray64dea7e2014-11-07 14:32:42 +0000273 051-thread \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100274 115-native-bridge \
275 116-nodex2oat \
276 117-nopatchoat \
277 118-noimage-dex2oat \
278 119-noimage-patchoat \
279
280ifneq (,$(filter ndebug,$(RUN_TYPES)))
281 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
282 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700283 $(PICTEST_TYPES),$(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100284endif
285
286TEST_ART_BROKEN_NDEBUG_TESTS :=
287
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100288# Known broken tests for the default compiler (Quick).
Vladimir Marko29b55352014-11-11 12:30:29 +0000289TEST_ART_BROKEN_DEFAULT_RUN_TESTS := \
290 412-new-array
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100291
292ifneq (,$(filter default,$(COMPILER_TYPES)))
293 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Nicolas Geoffray83cae422014-10-22 15:08:03 +0100294 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700295 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100296endif
297
298TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
299
Alexandre Rames5319def2014-10-23 10:03:10 +0100300# Known broken tests for the arm64 optimizing compiler backend.
301TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS := \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000302 001-HelloWorld \
Roland Levillained9b1952014-11-06 11:10:17 +0000303 002-sleep \
Alexandre Rames5319def2014-10-23 10:03:10 +0100304 003-omnibus-opcodes \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000305 004-InterfaceTest \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000306 004-JniTest \
Nicolas Geoffray36cc29b2014-11-12 12:19:58 +0000307 004-NativeAllocations \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000308 004-ReferenceMap \
309 004-SignalTest \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000310 004-StackWalk \
Nicolas Geoffray03e68d52014-11-04 11:49:17 +0000311 004-UnsafeTest \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000312 005-annotations \
Alexandre Rames5319def2014-10-23 10:03:10 +0100313 006-args \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000314 007-count10 \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000315 008-exceptions \
Nicolas Geoffray2a52b332014-11-12 10:47:41 +0000316 009-instanceof \
317 010-instance \
Alexandre Rames5319def2014-10-23 10:03:10 +0100318 011-array-copy \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000319 013-math2 \
320 016-intern \
321 017-float \
Alexandre Rames5319def2014-10-23 10:03:10 +0100322 018-stack-overflow \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000323 019-wrong-array-type \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000324 020-string \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000325 021-string2 \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000326 022-interface \
327 023-many-interfaces \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000328 024-illegal-access \
Nicolas Geoffray2a52b332014-11-12 10:47:41 +0000329 025-access-controller \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000330 026-access \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000331 028-array-write \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000332 029-assert \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000333 030-bad-finalizer \
334 031-class-attributes \
335 032-concrete-sub \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000336 033-class-init-deadlock \
Nicolas Geoffray2a52b332014-11-12 10:47:41 +0000337 034-call-null \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000338 035-enum \
Alexandre Rames5319def2014-10-23 10:03:10 +0100339 036-finalizer \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000340 037-inherit \
341 038-inner-null \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000342 039-join-main \
343 040-miranda \
344 042-new-instance \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000345 043-privates \
Alexandre Rames5319def2014-10-23 10:03:10 +0100346 044-proxy \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000347 045-reflect-array \
348 046-reflect \
349 047-returns \
350 049-show-object \
351 050-sync-test \
352 051-thread \
353 052-verifier-fun \
354 054-uncaught \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000355 055-enum-performance \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000356 056-const-string-jumbo \
Nicolas Geoffray2a52b332014-11-12 10:47:41 +0000357 058-enum-order \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000358 061-out-of-memory \
Nicolas Geoffray2a52b332014-11-12 10:47:41 +0000359 062-character-encodings \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000360 063-process-manager \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000361 064-field-access \
362 065-mismatched-implements \
363 066-mismatched-super \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000364 067-preemptive-unpark \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000365 068-classloader \
366 069-field-type \
Alexandre Rames5319def2014-10-23 10:03:10 +0100367 070-nio-buffer \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000368 071-dexfile \
Alexandre Rames5319def2014-10-23 10:03:10 +0100369 072-precise-gc \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000370 074-gc-thrash \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000371 075-verification-error \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000372 076-boolean-put \
373 077-method-override \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000374 078-polymorphic-virtual \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000375 079-phantom \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000376 080-oom-throw \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000377 081-hot-exceptions \
Alexandre Rames5319def2014-10-23 10:03:10 +0100378 082-inline-execute \
379 083-compiler-regressions \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000380 084-class-init \
381 085-old-style-inner-class \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000382 086-null-super \
383 087-gc-after-link \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000384 088-monitor-verification \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000385 090-loop-formation \
386 092-locale \
Alexandre Rames5319def2014-10-23 10:03:10 +0100387 093-serialization \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000388 094-pattern \
Alexandre Rames5319def2014-10-23 10:03:10 +0100389 096-array-copy-concurrent-gc \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000390 097-duplicate-method \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000391 098-ddmc \
Alexandre Rames5319def2014-10-23 10:03:10 +0100392 100-reflect2 \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000393 101-fibonacci \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000394 102-concurrent-gc \
395 103-string-append \
Nicolas Geoffray96d9c0d2014-11-10 11:03:16 +0000396 104-growth-limit \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000397 105-invoke \
Alexandre Rames5319def2014-10-23 10:03:10 +0100398 106-exceptions2 \
399 107-int-math2 \
Nicolas Geoffray2a52b332014-11-12 10:47:41 +0000400 108-check-cast \
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 \
Nicolas Geoffray2a52b332014-11-12 10:47:41 +0000406 114-ParallelGC \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000407 117-nopatchoat \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000408 118-noimage-dex2oat \
409 119-noimage-patchoat \
Nicolas Geoffray36cc29b2014-11-12 12:19:58 +0000410 120-hashcode \
Alexandre Rames5319def2014-10-23 10:03:10 +0100411 121-modifiers \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000412 121-simple-suspend-check \
Alexandre Rames5319def2014-10-23 10:03:10 +0100413 122-npe \
414 123-compiler-regressions-mt \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000415 124-missing-classes \
416 125-gc-and-classloading \
Nicolas Geoffray4b420e72014-11-04 09:15:35 +0000417 126-miranda-multidex \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000418 201-built-in-exception-detail-messages \
419 202-thread-oome \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000420 300-package-override \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000421 301-abstract-protected \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000422 303-verification-stress \
Nicolas Geoffray2a52b332014-11-12 10:47:41 +0000423 304-method-tracing \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000424 401-optimizing-compiler \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000425 402-optimizing-control-flow \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000426 403-optimizing-long \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000427 404-optimizing-allocator \
Alexandre Rames5319def2014-10-23 10:03:10 +0100428 405-optimizing-long-allocator \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000429 406-fields \
Alexandre Rames5319def2014-10-23 10:03:10 +0100430 407-arrays \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000431 409-materialized-condition \
Alexandre Rames5319def2014-10-23 10:03:10 +0100432 410-floats \
433 411-optimizing-arith \
434 412-new-array \
435 413-regalloc-regression \
Calin Juravle096cc022014-10-23 17:01:13 +0100436 414-optimizing-arith-sub \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000437 414-static-fields \
Roland Levillain66ce1732014-10-23 16:38:33 +0100438 415-optimizing-arith-neg \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000439 416-optimizing-arith-not \
Calin Juravle7c4954d2014-10-28 16:57:40 +0000440 417-optimizing-arith-div \
Nicolas Geoffrayb5f62b32014-10-30 10:58:41 +0000441 418-const-string \
Nicolas Geoffray020ac032014-10-30 17:33:03 +0000442 419-long-parameter \
Nicolas Geoffray424f6762014-11-03 14:51:25 +0000443 420-const-class \
Nicolas Geoffrayde58ab22014-11-05 12:46:03 +0000444 421-exceptions \
Nicolas Geoffray0deac2f2014-11-06 17:37:50 +0000445 421-large-frame \
Nicolas Geoffray6f5c41f2014-11-06 08:59:20 +0000446 422-instanceof \
Roland Levillaindff1f282014-11-05 14:15:05 +0000447 422-type-conversion \
Nicolas Geoffray52839d12014-11-07 17:47:25 +0000448 423-invoke-interface \
Nicolas Geoffray57a88d42014-11-10 15:09:21 +0000449 424-checkcast \
Nicolas Geoffray36cc29b2014-11-12 12:19:58 +0000450 426-monitor \
Nicolas Geoffray70e59ad2014-11-12 18:28:18 +0000451 427-bitwise \
Alexandre Rames5319def2014-10-23 10:03:10 +0100452 700-LoadArgRegs \
Nicolas Geoffray53c42b62014-10-31 15:07:56 +0000453 701-easy-div-rem \
Nicolas Geoffray32607a12014-10-30 10:54:03 +0000454 702-LargeBranchOffset \
Nicolas Geoffray6fb4ef52014-11-06 09:33:43 +0000455 703-floating-point-div \
Alexandre Rames5319def2014-10-23 10:03:10 +0100456 800-smali
457
458ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
459 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
460 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700461 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS),64)
Alexandre Rames5319def2014-10-23 10:03:10 +0100462endif
463
464TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
465
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100466# Known broken tests for the optimizing compiler.
467TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS := \
468 099-vmdebug \ # b/18098594
469
470ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
471 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
472 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
473 $(IMAGE_TYPES),$(PICTEST_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
474endif
475
476TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
477
Alexandre Rames5319def2014-10-23 10:03:10 +0100478
Ian Rogersf5c44b32014-08-19 16:52:36 -0700479# Clear variables ahead of appending to them when defining tests.
480$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
481$(foreach target, $(TARGET_TYPES), \
482 $(foreach prebuild, $(PREBUILD_TYPES), \
483 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
484$(foreach target, $(TARGET_TYPES), \
485 $(foreach compiler, $(COMPILER_TYPES), \
486 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
487$(foreach target, $(TARGET_TYPES), \
488 $(foreach relocate, $(RELOCATE_TYPES), \
489 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
490$(foreach target, $(TARGET_TYPES), \
491 $(foreach trace, $(TRACE_TYPES), \
492 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
493$(foreach target, $(TARGET_TYPES), \
494 $(foreach gc, $(GC_TYPES), \
495 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
496$(foreach target, $(TARGET_TYPES), \
497 $(foreach jni, $(JNI_TYPES), \
498 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
499$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700500 $(foreach image, $(IMAGE_TYPES), \
501 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
502$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700503 $(foreach test, $(TEST_ART_RUN_TESTS), \
504 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
505$(foreach target, $(TARGET_TYPES), \
506 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
507 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100508$(foreach target, $(TARGET_TYPES), \
509 $(foreach run_type, $(RUN_TYPES), \
510 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700511
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700512# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
513# only once).
514TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700515
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700516# Also need libarttest.
517TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
518ifdef TARGET_2ND_ARCH
519TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
520endif
521
Andreas Gampe855564b2014-07-25 02:32:19 -0700522# Also need libnativebridgetest.
523TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
524ifdef TARGET_2ND_ARCH
525TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
526endif
527
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700528# All tests require the host executables. The tests also depend on the core images, but on
529# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700530ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
531 $(ART_HOST_EXECUTABLES) \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700532 $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700533 $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700534 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700535
536ifneq ($(HOST_PREFER_32_BIT),true)
537ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700538 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700539 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700540 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700541endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700542
Ian Rogersf5c44b32014-08-19 16:52:36 -0700543# Create a rule to build and run a tests following the form:
Calin Juravle9228b2a2014-10-22 15:54:34 +0100544# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100545# {4: interpreter default optimizing}-{5: relocate no-relocate relocate-no-patchoat}-
546# {6: trace or no-trace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
Andreas Gampec23c9c92014-10-28 14:47:25 -0700547# {9: no-image image picimage}-{10: pictest nopictest}-{11: test name}{12: 32 or 64}
Ian Rogersafd9acc2014-06-17 08:21:54 -0700548define define-test-art-run-test
Nicolas Geoffray611e1db2014-10-09 17:34:45 +0100549 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700550 prereq_rule :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700551 test_groups :=
552 uc_host_or_target :=
Alex Lightbfac14a2014-07-30 09:41:21 -0700553 ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
554 run_test_options += --always-clean
555 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700556 ifeq ($(1),host)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700557 uc_host_or_target := HOST
Ian Rogersf5c44b32014-08-19 16:52:36 -0700558 test_groups := ART_RUN_TEST_HOST_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700559 run_test_options += --host
560 prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
561 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700562 ifeq ($(1),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700563 uc_host_or_target := TARGET
Ian Rogersf5c44b32014-08-19 16:52:36 -0700564 test_groups := ART_RUN_TEST_TARGET_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700565 prereq_rule := test-art-target-sync
566 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700567 $$(error found $(1) expected $(TARGET_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700568 endif
569 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100570 ifeq ($(2),debug)
571 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
572 else
573 ifeq ($(2),ndebug)
574 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
575 run_test_options += -O
576 else
577 $$(error found $(2) expected $(RUN_TYPES))
578 endif
579 endif
580 ifeq ($(3),prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700581 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
582 run_test_options += --prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700583 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100584 ifeq ($(3),no-prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700585 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
586 run_test_options += --no-prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700587 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100588 ifeq ($(3),no-dex2oat)
Alex Light03a112d2014-08-25 13:25:56 -0700589 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
590 run_test_options += --no-prebuild --no-dex2oat
591 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100592 $$(error found $(3) expected $(PREBUILD_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700593 endif
Alex Lighta59dd802014-07-02 16:28:08 -0700594 endif
595 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100596 ifeq ($(4),optimizing)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700597 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700598 run_test_options += --optimizing
Ian Rogersafd9acc2014-06-17 08:21:54 -0700599 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100600 ifeq ($(4),interpreter)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700601 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700602 run_test_options += --interpreter
603 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100604 ifeq ($(4),default)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700605 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700606 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100607 $$(error found $(4) expected $(COMPILER_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700608 endif
609 endif
610 endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700611
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100612 ifeq ($(5),relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700613 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
614 run_test_options += --relocate
Ian Rogersafd9acc2014-06-17 08:21:54 -0700615 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100616 ifeq ($(5),no-relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700617 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
618 run_test_options += --no-relocate
619 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100620 ifeq ($(5),relocate-no-patchoat)
Alex Light03a112d2014-08-25 13:25:56 -0700621 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
622 run_test_options += --relocate --no-patchoat
623 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100624 $$(error found $(5) expected $(RELOCATE_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700625 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700626 endif
627 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100628 ifeq ($(6),trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700629 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
Ian Rogers716e4f82014-07-16 11:18:03 -0700630 run_test_options += --trace
Ian Rogers716e4f82014-07-16 11:18:03 -0700631 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100632 ifeq ($(6),no-trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700633 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
Ian Rogers701aa642014-07-18 11:38:13 -0700634 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100635 $$(error found $(6) expected $(TRACE_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700636 endif
637 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100638 ifeq ($(7),gcverify)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700639 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700640 run_test_options += --gcverify
641 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100642 ifeq ($(7),gcstress)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700643 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700644 run_test_options += --gcstress
645 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100646 ifeq ($(7),cms)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700647 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
Ian Rogers8a14b752014-07-18 15:06:53 -0700648 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100649 $$(error found $(7) expected $(GC_TYPES))
Ian Rogers701aa642014-07-18 11:38:13 -0700650 endif
Ian Rogers716e4f82014-07-16 11:18:03 -0700651 endif
652 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100653 ifeq ($(8),forcecopy)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700654 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700655 run_test_options += --runtime-option -Xjniopts:forcecopy
656 ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
657 skip_test := true
658 endif
659 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100660 ifeq ($(8),checkjni)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700661 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700662 run_test_options += --runtime-option -Xcheck:jni
663 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100664 ifeq ($(8),jni)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700665 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
666 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100667 $$(error found $(8) expected $(JNI_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700668 endif
669 endif
670 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100671 ifeq ($(9),no-image)
Alex Light03a112d2014-08-25 13:25:56 -0700672 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
673 run_test_options += --no-image
Andreas Gampebf03e842014-10-29 20:46:17 -0700674 # Add the core dependency. This is required for pre-building.
675 ifeq ($(1),host)
676 prereq_rule += $(HOST_CORE_IMAGE_$(4)_no-pic_$(12))
677 else
678 prereq_rule += $(TARGET_CORE_IMAGE_$(4)_no-pic_$(12))
679 endif
Alex Light03a112d2014-08-25 13:25:56 -0700680 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100681 ifeq ($(9),image)
Alex Light03a112d2014-08-25 13:25:56 -0700682 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
Andreas Gampec23c9c92014-10-28 14:47:25 -0700683 # Add the core dependency.
684 ifeq ($(1),host)
685 prereq_rule += $(HOST_CORE_IMAGE_$(4)_no-pic_$(12))
686 else
687 prereq_rule += $(TARGET_CORE_IMAGE_$(4)_no-pic_$(12))
688 endif
Alex Light03a112d2014-08-25 13:25:56 -0700689 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700690 ifeq ($(9),picimage)
691 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
692 run_test_options += --pic-image
693 ifeq ($(1),host)
694 prereq_rule += $(HOST_CORE_IMAGE_$(4)_pic_$(12))
695 else
696 prereq_rule += $(TARGET_CORE_IMAGE_$(4)_pic_$(12))
697 endif
698 else
699 $$(error found $(9) expected $(IMAGE_TYPES))
700 endif
Alex Light03a112d2014-08-25 13:25:56 -0700701 endif
702 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700703 ifeq ($(10),pictest)
704 run_test_options += --pic-test
705 else
706 ifeq ($(10),nopictest)
707 # Nothing to be done.
708 else
709 $$(error found $(10) expected $(PICTEST_TYPES))
710 endif
711 endif
712 # $(11) is the test name
713 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(11))_RULES
714 ifeq ($(12),64)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700715 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
716 run_test_options += --64
717 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700718 ifeq ($(12),32)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700719 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
720 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700721 $$(error found $(12) expected $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700722 endif
723 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700724 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 -0700725 run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
Ian Rogers5242c0a2014-07-18 11:02:19 -0700726 $$(run_test_options)
Nicolas Geoffrayc8f23fc2014-10-28 17:59:47 +0000727 ifneq ($(ART_TEST_ANDROID_ROOT),)
728 run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
729 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700730$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
731.PHONY: $$(run_test_rule_name)
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700732$$(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 -0700733 $(hide) $$(call ART_TEST_SKIP,$$@) && \
734 DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700735 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
736 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700737 art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(11) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700738 && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
739 $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
740 echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
741 rm -r $(ART_HOST_TEST_DIR)) || true
742
Ian Rogersf5c44b32014-08-19 16:52:36 -0700743 $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700744
745 # Clear locally defined variables.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700746 uc_host_or_target :=
747 test_groups :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700748 run_test_options :=
749 run_test_rule_name :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700750 prereq_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700751endef # define-test-art-run-test
752
Ian Rogersf5c44b32014-08-19 16:52:36 -0700753$(foreach target, $(TARGET_TYPES), \
754 $(foreach test, $(TEST_ART_RUN_TESTS), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100755 $(foreach run_type, $(RUN_TYPES), \
756 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
757 $(foreach prebuild, $(PREBUILD_TYPES), \
758 $(foreach compiler, $(COMPILER_TYPES), \
759 $(foreach relocate, $(RELOCATE_TYPES), \
760 $(foreach trace, $(TRACE_TYPES), \
761 $(foreach gc, $(GC_TYPES), \
762 $(foreach jni, $(JNI_TYPES), \
763 $(foreach image, $(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700764 $(foreach pictest, $(PICTEST_TYPES), \
765 $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(test),$(address_size))) \
766 ))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700767define-test-art-run-test :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700768
Ian Rogersafd9acc2014-06-17 08:21:54 -0700769# Define a phony rule whose purpose is to test its prerequisites.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700770# $(1): host or target
Ian Rogersafd9acc2014-06-17 08:21:54 -0700771# $(2): list of prerequisites
Ian Rogersf5c44b32014-08-19 16:52:36 -0700772define define-test-art-run-test-group
Ian Rogersafd9acc2014-06-17 08:21:54 -0700773.PHONY: $(1)
774$(1): $(2)
775 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
776
Ian Rogersafd9acc2014-06-17 08:21:54 -0700777endef # define-test-art-run-test-group
778
Ian Rogersafd9acc2014-06-17 08:21:54 -0700779
Ian Rogersf5c44b32014-08-19 16:52:36 -0700780$(foreach target, $(TARGET_TYPES), $(eval \
781 $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
782$(foreach target, $(TARGET_TYPES), \
783 $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
784 $(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)))))
785$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100786 $(foreach run-type, $(RUN_TYPES), $(eval \
787 $(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)))))
788$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700789 $(foreach compiler, $(COMPILER_TYPES), $(eval \
790 $(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)))))
791$(foreach target, $(TARGET_TYPES), \
792 $(foreach relocate, $(RELOCATE_TYPES), $(eval \
793 $(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)))))
794$(foreach target, $(TARGET_TYPES), \
795 $(foreach trace, $(TRACE_TYPES), $(eval \
796 $(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)))))
797$(foreach target, $(TARGET_TYPES), \
798 $(foreach gc, $(GC_TYPES), $(eval \
799 $(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)))))
800$(foreach target, $(TARGET_TYPES), \
801 $(foreach jni, $(JNI_TYPES), $(eval \
802 $(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)))))
803$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700804 $(foreach image, $(IMAGE_TYPES), $(eval \
805 $(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)))))
806$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700807 $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
808 $(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)))))
809$(foreach target, $(TARGET_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700810 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
Ian Rogersa3cf6ce2014-10-02 16:35:52 -0700811 $(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 -0700812
Ian Rogersf5c44b32014-08-19 16:52:36 -0700813# Clear variables now we're finished with them.
814$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
815$(foreach target, $(TARGET_TYPES), \
816 $(foreach prebuild, $(PREBUILD_TYPES), \
817 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
818$(foreach target, $(TARGET_TYPES), \
819 $(foreach compiler, $(COMPILER_TYPES), \
820 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
821$(foreach target, $(TARGET_TYPES), \
822 $(foreach relocate, $(RELOCATE_TYPES), \
823 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
824$(foreach target, $(TARGET_TYPES), \
825 $(foreach trace, $(TRACE_TYPES), \
826 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
827$(foreach target, $(TARGET_TYPES), \
828 $(foreach gc, $(GC_TYPES), \
829 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
830$(foreach target, $(TARGET_TYPES), \
831 $(foreach jni, $(JNI_TYPES), \
832 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
833$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700834 $(foreach image, $(IMAGE_TYPES), \
835 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
836$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700837 $(foreach test, $(TEST_ART_RUN_TESTS), \
838 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
839$(foreach target, $(TARGET_TYPES), \
840 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
841 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100842$(foreach target, $(TARGET_TYPES), \
843 $(foreach run_type, $(RUN_TYPES), \
844 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700845define-test-art-run-test-group :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700846TARGET_TYPES :=
847PREBUILD_TYPES :=
848COMPILER_TYPES :=
849RELOCATE_TYPES :=
850TRACE_TYPES :=
851GC_TYPES :=
852JNI_TYPES :=
Alex Light03a112d2014-08-25 13:25:56 -0700853IMAGE_TYPES :=
Ian Rogers86df3ac2014-08-27 10:54:11 -0700854ADDRESS_SIZES_TARGET :=
855ADDRESS_SIZES_HOST :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700856ALL_ADDRESS_SIZES :=
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100857RUN_TYPES :=
Ian Rogers9fcaa4b2014-08-26 19:59:52 -0700858
859include $(LOCAL_PATH)/Android.libarttest.mk
860include art/test/Android.libnativebridgetest.mk