blob: c666d359fb30d8e327d4cd630bb6f39059ab6806 [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
Mathieu Chartiere5f13e52015-02-24 09:37:21 -080087ifeq ($(ART_TEST_JIT),true)
88 COMPILER_TYPES += jit
89endif
Ian Rogers86df3ac2014-08-27 10:54:11 -070090ifeq ($(ART_TEST_OPTIMIZING),true)
91 COMPILER_TYPES += optimizing
92endif
93RELOCATE_TYPES := relocate
94ifeq ($(ART_TEST_RUN_TEST_NO_RELOCATE),true)
95 RELOCATE_TYPES += no-relocate
96endif
97ifeq ($(ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT),true)
98 RELOCATE_TYPES := relocate-no-patchoat
99endif
100TRACE_TYPES := no-trace
101ifeq ($(ART_TEST_TRACE),true)
102 TRACE_TYPES += trace
103endif
104GC_TYPES := cms
Alex Light992f1e72014-08-27 16:08:57 -0700105ifeq ($(ART_TEST_GC_STRESS),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700106 GC_TYPES += gcstress
107endif
Alex Light992f1e72014-08-27 16:08:57 -0700108ifeq ($(ART_TEST_GC_VERIFY),true)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700109 GC_TYPES += gcverify
110endif
111JNI_TYPES := checkjni
112ifeq ($(ART_TEST_JNI_FORCECOPY),true)
113 JNI_TYPES += forcecopy
114endif
115IMAGE_TYPES := image
116ifeq ($(ART_TEST_RUN_TEST_NO_IMAGE),true)
117 IMAGE_TYPES += no-image
118endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700119ifeq ($(ART_TEST_PIC_IMAGE),true)
120 IMAGE_TYPES += picimage
121endif
122PICTEST_TYPES := nopictest
123ifeq ($(ART_TEST_PIC_TEST),true)
124 PICTEST_TYPES += pictest
125endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100126RUN_TYPES :=
127ifeq ($(ART_TEST_RUN_TEST_DEBUG),true)
128 RUN_TYPES += debug
129endif
130ifeq ($(ART_TEST_RUN_TEST_NDEBUG),true)
131 RUN_TYPES += ndebug
132endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000133DEBUGGABLE_TYPES := nondebuggable
134ifeq ($(ART_TEST_RUN_TEST_DEBUGGABLE),true)
135DEBUGGABLE_TYPES += debuggable
136endif
Nicolas Geoffray41bb3312014-10-24 13:49:08 +0100137ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX)
138ADDRESS_SIZES_HOST := $(ART_PHONY_TEST_HOST_SUFFIX)
139ifeq ($(ART_TEST_RUN_TEST_2ND_ARCH),true)
140 ADDRESS_SIZES_TARGET += $(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
141 ADDRESS_SIZES_HOST += $(2ND_ART_PHONY_TEST_HOST_SUFFIX)
142endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700143ALL_ADDRESS_SIZES := 64 32
Ian Rogers86df3ac2014-08-27 10:54:11 -0700144
Ian Rogersf5c44b32014-08-19 16:52:36 -0700145# List all run test names with number arguments agreeing with the comment above.
146define all-run-test-names
147 $(foreach target, $(1), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100148 $(foreach run-type, $(2), \
149 $(foreach prebuild, $(3), \
150 $(foreach compiler, $(4), \
151 $(foreach relocate, $(5), \
152 $(foreach trace, $(6), \
153 $(foreach gc, $(7), \
154 $(foreach jni, $(8), \
155 $(foreach image, $(9), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700156 $(foreach pictest, $(10), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000157 $(foreach debuggable, $(11), \
158 $(foreach test, $(12), \
159 $(foreach address_size, $(13), \
160 test-art-$(target)-run-test-$(run-type)-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(image)-$(pictest)-$(debuggable)-$(test)$(address_size) \
161 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700162endef # all-run-test-names
163
164# To generate a full list or tests:
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100165# $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700166# $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000167# $(DEBUGGABLE_TYPES) $(TEST_ART_RUN_TESTS), $(ALL_ADDRESS_SIZES)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700168
169# Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE
170define name-to-var
171$(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
172endef # name-to-var
173
174# Tests that are timing sensitive and flaky on heavily loaded systems.
175TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \
176 053-wait-some \
Mathieu Chartiere4a91bb2015-01-28 13:11:44 -0800177 055-enum-performance \
178 133-static-invoke-super
Ian Rogersf5c44b32014-08-19 16:52:36 -0700179
180 # disable timing sensitive tests on "dist" builds.
181ifdef dist_goal
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100182 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700183 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000184 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700185endif
186
Ian Rogers86df3ac2014-08-27 10:54:11 -0700187TEST_ART_TIMING_SENSITIVE_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 := \
Andreas Gampe3ad5d5e2015-02-03 18:26:55 -0800191 116-nodex2oat \
Jean Christophe Beyler24e04aa2014-09-12 12:03:25 -0700192 118-noimage-dex2oat \
193 134-nodex2oat-nofallback
Ian Rogersf5c44b32014-08-19 16:52:36 -0700194
Ian Rogers40e19122014-09-02 15:59:28 -0700195ifneq (,$(filter prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100196 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700197 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000198 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_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_PREBUILD_RUN_TESTS :=
202
Ian Rogersf5c44b32014-08-19 16:52:36 -0700203TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
204 117-nopatchoat
205
Ian Rogers40e19122014-09-02 15:59:28 -0700206ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100207 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-prebuild, \
Ian Rogers40e19122014-09-02 15:59:28 -0700208 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000209 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700210endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700211
Ian Rogers86df3ac2014-08-27 10:54:11 -0700212TEST_ART_BROKEN_NO_PREBUILD_TESTS :=
213
Ian Rogers40e19122014-09-02 15:59:28 -0700214# Note 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without
215# --prebuild --relocate
216TEST_ART_BROKEN_NO_RELOCATE_TESTS := \
Andreas Gampe3ad5d5e2015-02-03 18:26:55 -0800217 117-nopatchoat \
218 118-noimage-dex2oat \
219 119-noimage-patchoat
Ian Rogers40e19122014-09-02 15:59:28 -0700220
221ifneq (,$(filter no-relocate,$(RELOCATE_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), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000224 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700225endif
226
227TEST_ART_BROKEN_NO_RELOCATE_TESTS :=
228
Ian Rogers40e19122014-09-02 15:59:28 -0700229# Tests that are broken with GC stress.
Mathieu Chartierbdeb9b72015-01-07 17:42:07 -0800230TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
Ian Rogers40e19122014-09-02 15:59:28 -0700231
232ifneq (,$(filter gcstress,$(GC_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100233 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700234 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000235 $(IMAGE_TYPES), $(PICTEST_TYPES), $(DBEUGGABLE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700236endif
237
238TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
239
Ian Rogersf5c44b32014-08-19 16:52:36 -0700240# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100241ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000242 $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), 115-native-bridge, \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700243 $(ALL_ADDRESS_SIZES))
244
Andreas Gampe3a913092015-01-10 00:26:17 -0800245# 130-hprof dumps the heap and runs hprof-conv to check whether the file is somewhat readable. This
246# is only possible on the host.
247# TODO: Turn off all the other combinations, this is more about testing actual ART code. A gtest is
248# very hard to write here, as (for a complete test) JDWP must be set up.
249ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
250 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000251 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),130-hprof,$(ALL_ADDRESS_SIZES))
Andreas Gampe3a913092015-01-10 00:26:17 -0800252
Alex Light03a112d2014-08-25 13:25:56 -0700253# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
254# Therefore we shouldn't run them in situations where we actually don't have these since they
255# explicitly test for them. These all also assume we have an image.
256TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
257 116-nodex2oat \
258 117-nopatchoat \
259 118-noimage-dex2oat \
260 119-noimage-patchoat
261
Ian Rogers40e19122014-09-02 15:59:28 -0700262ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100263 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
Ian Rogers40e19122014-09-02 15:59:28 -0700264 $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000265 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700266endif
Alex Light03a112d2014-08-25 13:25:56 -0700267
Alex Light03a112d2014-08-25 13:25:56 -0700268
Ian Rogers40e19122014-09-02 15:59:28 -0700269ifneq (,$(filter no-image,$(IMAGE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100270 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700271 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000272 $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700273endif
274
275ifneq (,$(filter relocate-no-patchoat,$(RELOCATE_TYPES)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100276 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Ian Rogers40e19122014-09-02 15:59:28 -0700277 $(COMPILER_TYPES), relocate-no-patchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000278 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Ian Rogers40e19122014-09-02 15:59:28 -0700279endif
Alex Light03a112d2014-08-25 13:25:56 -0700280
Ian Rogers86df3ac2014-08-27 10:54:11 -0700281TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
282
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800283# This test dynamically enables tracing to force a deoptimization. This makes the test meaningless
284# when already tracing, and writes an error message that we do not want to check for.
285TEST_ART_BROKEN_TRACING_RUN_TESTS := \
286 802-deoptimization
287
288ifneq (,$(filter trace,$(TRACE_TYPES)))
289 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
290 $(COMPILER_TYPES),$(RELOCATE_TYPES),trace,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000291 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Andreas Gampe9cb65bc2015-02-18 17:08:27 -0800292endif
293
294TEST_ART_BROKEN_TRACING_RUN_TESTS :=
295
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100296# The following tests use libarttest.so, which is linked against libartd.so, so will
297# not work when libart.so is the one loaded.
298# TODO: Find a way to run these tests in ndebug mode.
299TEST_ART_BROKEN_NDEBUG_TESTS := \
300 004-JniTest \
301 004-ReferenceMap \
302 004-SignalTest \
303 004-StackWalk \
304 004-UnsafeTest \
Nicolas Geoffray64dea7e2014-11-07 14:32:42 +0000305 051-thread \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100306 115-native-bridge \
307 116-nodex2oat \
308 117-nopatchoat \
309 118-noimage-dex2oat \
310 119-noimage-patchoat \
Nicolas Geoffray8c9200a2015-01-15 08:42:47 +0000311 131-structural-change \
Nicolas Geoffrayd845fd02015-03-03 12:43:45 +0000312 454-get-vreg \
313 455-set-vreg \
Nicolas Geoffray64d69ab2015-03-10 19:26:24 +0000314 457-regs \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100315
316ifneq (,$(filter ndebug,$(RUN_TYPES)))
317 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
318 $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000319 $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100320endif
321
322TEST_ART_BROKEN_NDEBUG_TESTS :=
323
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100324# Known broken tests for the default compiler (Quick).
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000325TEST_ART_BROKEN_DEFAULT_RUN_TESTS := \
326 457-regs
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100327
328ifneq (,$(filter default,$(COMPILER_TYPES)))
329 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
Nicolas Geoffray83cae422014-10-22 15:08:03 +0100330 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000331 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffraya3d05a42014-10-20 17:41:32 +0100332endif
333
334TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
335
Alexandre Rames5319def2014-10-23 10:03:10 +0100336# Known broken tests for the arm64 optimizing compiler backend.
Serban Constantinescu02d81cc2015-01-05 16:08:49 +0000337TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
Alexandre Rames5319def2014-10-23 10:03:10 +0100338
339ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
340 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
341 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000342 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS),64)
Alexandre Rames5319def2014-10-23 10:03:10 +0100343endif
344
345TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
346
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100347# Known broken tests for the optimizing compiler.
Nicolas Geoffrayaa8dd2f2015-01-23 17:48:28 +0000348TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
349TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS += 099-vmdebug # b/18098594
350TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS += 802-deoptimization # b/18547544
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100351
352ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
353 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
354 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000355 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100356endif
357
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000358# If ART_USE_OPTIMIZING_COMPILER is set to true, then the default core.art has been
359# compiled with the optimizing compiler.
360ifeq ($(ART_USE_OPTIMIZING_COMPILER),true)
361 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
362 default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000363 $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
Nicolas Geoffray5d672a62014-12-04 14:39:31 +0000364endif
365
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100366TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
367
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +0000368# Tests that should fail when the optimizing compiler compiles them non-debuggable.
369TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS := \
370 457-regs \
371
372ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
373 ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
374 optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
375 $(IMAGE_TYPES),$(PICTEST_TYPES),nondebuggable,$(TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
376endif
377
378TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
379
Alexandre Rames5319def2014-10-23 10:03:10 +0100380
Ian Rogersf5c44b32014-08-19 16:52:36 -0700381# Clear variables ahead of appending to them when defining tests.
382$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
383$(foreach target, $(TARGET_TYPES), \
384 $(foreach prebuild, $(PREBUILD_TYPES), \
385 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
386$(foreach target, $(TARGET_TYPES), \
387 $(foreach compiler, $(COMPILER_TYPES), \
388 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
389$(foreach target, $(TARGET_TYPES), \
390 $(foreach relocate, $(RELOCATE_TYPES), \
391 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
392$(foreach target, $(TARGET_TYPES), \
393 $(foreach trace, $(TRACE_TYPES), \
394 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
395$(foreach target, $(TARGET_TYPES), \
396 $(foreach gc, $(GC_TYPES), \
397 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
398$(foreach target, $(TARGET_TYPES), \
399 $(foreach jni, $(JNI_TYPES), \
400 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
401$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700402 $(foreach image, $(IMAGE_TYPES), \
403 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
404$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700405 $(foreach test, $(TEST_ART_RUN_TESTS), \
406 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
407$(foreach target, $(TARGET_TYPES), \
408 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
409 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100410$(foreach target, $(TARGET_TYPES), \
411 $(foreach run_type, $(RUN_TYPES), \
412 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000413$(foreach target, $(TARGET_TYPES), \
414 $(foreach debuggable_type, $(DEBUGGABLE_TYPES), \
415 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700416
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700417# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
418# only once).
419TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700420
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700421# Also need libarttest.
422TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
423ifdef TARGET_2ND_ARCH
424TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
425endif
426
Andreas Gampe855564b2014-07-25 02:32:19 -0700427# Also need libnativebridgetest.
428TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
429ifdef TARGET_2ND_ARCH
430TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
431endif
432
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700433# All tests require the host executables. The tests also depend on the core images, but on
434# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700435ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
436 $(ART_HOST_EXECUTABLES) \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700437 $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700438 $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700439 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700440
441ifneq ($(HOST_PREFER_32_BIT),true)
442ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -0700443 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe855564b2014-07-25 02:32:19 -0700444 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700445 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Ian Rogers665de8a2014-06-24 21:34:09 -0700446endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700447
Ian Rogersf5c44b32014-08-19 16:52:36 -0700448# Create a rule to build and run a tests following the form:
Calin Juravle9228b2a2014-10-22 15:54:34 +0100449# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
Mathieu Chartier3fc1b122015-02-26 10:58:08 -0800450# {4: interpreter default optimizing jit}-{5: relocate no-relocate relocate-no-patchoat}-
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100451# {6: trace or no-trace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000452# {9: no-image image picimage}-{10: pictest nopictest}-
453# {11: nondebuggable debuggable}-{12: test name}{13: 32 or 64}
Ian Rogersafd9acc2014-06-17 08:21:54 -0700454define define-test-art-run-test
Nicolas Geoffray611e1db2014-10-09 17:34:45 +0100455 run_test_options :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700456 prereq_rule :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700457 test_groups :=
458 uc_host_or_target :=
Alex Lightbfac14a2014-07-30 09:41:21 -0700459 ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
460 run_test_options += --always-clean
461 endif
Ian Rogersf5c44b32014-08-19 16:52:36 -0700462 ifeq ($(1),host)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700463 uc_host_or_target := HOST
Ian Rogersf5c44b32014-08-19 16:52:36 -0700464 test_groups := ART_RUN_TEST_HOST_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700465 run_test_options += --host
466 prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
467 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700468 ifeq ($(1),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700469 uc_host_or_target := TARGET
Ian Rogersf5c44b32014-08-19 16:52:36 -0700470 test_groups := ART_RUN_TEST_TARGET_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700471 prereq_rule := test-art-target-sync
472 else
Ian Rogersf5c44b32014-08-19 16:52:36 -0700473 $$(error found $(1) expected $(TARGET_TYPES))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700474 endif
475 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100476 ifeq ($(2),debug)
477 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
478 else
479 ifeq ($(2),ndebug)
480 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
481 run_test_options += -O
482 else
483 $$(error found $(2) expected $(RUN_TYPES))
484 endif
485 endif
486 ifeq ($(3),prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700487 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
488 run_test_options += --prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700489 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100490 ifeq ($(3),no-prebuild)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700491 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
492 run_test_options += --no-prebuild
Alex Lighta59dd802014-07-02 16:28:08 -0700493 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100494 ifeq ($(3),no-dex2oat)
Alex Light03a112d2014-08-25 13:25:56 -0700495 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
496 run_test_options += --no-prebuild --no-dex2oat
497 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100498 $$(error found $(3) expected $(PREBUILD_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700499 endif
Alex Lighta59dd802014-07-02 16:28:08 -0700500 endif
501 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100502 ifeq ($(4),optimizing)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700503 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700504 run_test_options += --optimizing
Ian Rogersafd9acc2014-06-17 08:21:54 -0700505 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100506 ifeq ($(4),interpreter)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700507 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700508 run_test_options += --interpreter
509 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100510 ifeq ($(4),default)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700511 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
Nicolas Geoffrayc9338b92014-12-03 13:36:10 +0000512 run_test_options += --quick
Ian Rogersafd9acc2014-06-17 08:21:54 -0700513 else
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800514 ifeq ($(4),jit)
Mathieu Chartier3fc1b122015-02-26 10:58:08 -0800515 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JIT_RULES
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800516 run_test_options += --jit
517 else
518 $$(error found $(4) expected $(COMPILER_TYPES))
519 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700520 endif
521 endif
522 endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700523
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100524 ifeq ($(5),relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700525 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
526 run_test_options += --relocate
Ian Rogersafd9acc2014-06-17 08:21:54 -0700527 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100528 ifeq ($(5),no-relocate)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700529 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
530 run_test_options += --no-relocate
531 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100532 ifeq ($(5),relocate-no-patchoat)
Alex Light03a112d2014-08-25 13:25:56 -0700533 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
534 run_test_options += --relocate --no-patchoat
535 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100536 $$(error found $(5) expected $(RELOCATE_TYPES))
Alex Light03a112d2014-08-25 13:25:56 -0700537 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700538 endif
539 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100540 ifeq ($(6),trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700541 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
Ian Rogers716e4f82014-07-16 11:18:03 -0700542 run_test_options += --trace
Ian Rogers716e4f82014-07-16 11:18:03 -0700543 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100544 ifeq ($(6),no-trace)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700545 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
Ian Rogers701aa642014-07-18 11:38:13 -0700546 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100547 $$(error found $(6) expected $(TRACE_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700548 endif
549 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100550 ifeq ($(7),gcverify)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700551 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700552 run_test_options += --gcverify
553 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100554 ifeq ($(7),gcstress)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700555 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700556 run_test_options += --gcstress
557 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100558 ifeq ($(7),cms)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700559 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
Ian Rogers8a14b752014-07-18 15:06:53 -0700560 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100561 $$(error found $(7) expected $(GC_TYPES))
Ian Rogers701aa642014-07-18 11:38:13 -0700562 endif
Ian Rogers716e4f82014-07-16 11:18:03 -0700563 endif
564 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100565 ifeq ($(8),forcecopy)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700566 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700567 run_test_options += --runtime-option -Xjniopts:forcecopy
568 ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
569 skip_test := true
570 endif
571 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100572 ifeq ($(8),checkjni)
Ian Rogers86df3ac2014-08-27 10:54:11 -0700573 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
Ian Rogersf5c44b32014-08-19 16:52:36 -0700574 run_test_options += --runtime-option -Xcheck:jni
575 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100576 ifeq ($(8),jni)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700577 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
578 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100579 $$(error found $(8) expected $(JNI_TYPES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700580 endif
581 endif
582 endif
Mathieu Chartiere2a12c02015-02-27 13:21:15 -0800583 ifeq ($(4),jit)
584 # Use interpreter image for JIT.
585 image_suffix := interpreter
586 else
587 image_suffix := $(4)
588 endif
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100589 ifeq ($(9),no-image)
Alex Light03a112d2014-08-25 13:25:56 -0700590 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
591 run_test_options += --no-image
Andreas Gampebf03e842014-10-29 20:46:17 -0700592 # Add the core dependency. This is required for pre-building.
593 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000594 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700595 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000596 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampebf03e842014-10-29 20:46:17 -0700597 endif
Alex Light03a112d2014-08-25 13:25:56 -0700598 else
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100599 ifeq ($(9),image)
Alex Light03a112d2014-08-25 13:25:56 -0700600 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
Andreas Gampec23c9c92014-10-28 14:47:25 -0700601 # Add the core dependency.
602 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000603 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700604 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000605 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700606 endif
Alex Light03a112d2014-08-25 13:25:56 -0700607 else
Andreas Gampec23c9c92014-10-28 14:47:25 -0700608 ifeq ($(9),picimage)
609 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
610 run_test_options += --pic-image
611 ifeq ($(1),host)
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000612 prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700613 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000614 prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_pic_$(13))
Andreas Gampec23c9c92014-10-28 14:47:25 -0700615 endif
616 else
617 $$(error found $(9) expected $(IMAGE_TYPES))
618 endif
Alex Light03a112d2014-08-25 13:25:56 -0700619 endif
620 endif
Andreas Gampec23c9c92014-10-28 14:47:25 -0700621 ifeq ($(10),pictest)
622 run_test_options += --pic-test
623 else
624 ifeq ($(10),nopictest)
625 # Nothing to be done.
626 else
627 $$(error found $(10) expected $(PICTEST_TYPES))
628 endif
629 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000630 ifeq ($(11),debuggable)
631 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUGGABLE_RULES
632 run_test_options += --debuggable
633 else
634 ifeq ($(11),nondebuggable)
635 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NONDEBUGGABLE_RULES
636 # Nothing to be done.
637 else
638 $$(error found $(11) expected $(DEBUGGABLE_TYPES))
639 endif
640 endif
641 # $(12) is the test name.
642 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(12))_RULES
643 ifeq ($(13),64)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700644 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
645 run_test_options += --64
646 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000647 ifeq ($(13),32)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700648 test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
649 else
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000650 $$(error found $(13) expected $(ALL_ADDRESS_SIZES))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700651 endif
652 endif
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000653 run_test_rule_name := test-art-$(1)-run-test-$(2)-$(3)-$(4)-$(5)-$(6)-$(7)-$(8)-$(9)-$(10)-$(11)-$(12)$(13)
Ian Rogersf5c44b32014-08-19 16:52:36 -0700654 run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
Ian Rogers5242c0a2014-07-18 11:02:19 -0700655 $$(run_test_options)
Nicolas Geoffrayc8f23fc2014-10-28 17:59:47 +0000656 ifneq ($(ART_TEST_ANDROID_ROOT),)
657 run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
658 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700659$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
660.PHONY: $$(run_test_rule_name)
Andreas Gampe3a913092015-01-10 00:26:17 -0800661$$(run_test_rule_name): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $(HOST_OUT_EXECUTABLES)/smali $(HOST_OUT_EXECUTABLES)/dexmerger $(HOST_OUT_EXECUTABLES)/hprof-conv $$(prereq_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700662 $(hide) $$(call ART_TEST_SKIP,$$@) && \
663 DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
Andreas Gampe8fda9f22014-10-03 16:15:37 -0700664 SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
665 DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000666 art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(12) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700667 && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
668 $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
669 echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
670 rm -r $(ART_HOST_TEST_DIR)) || true
671
Ian Rogersf5c44b32014-08-19 16:52:36 -0700672 $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700673
674 # Clear locally defined variables.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700675 uc_host_or_target :=
676 test_groups :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700677 run_test_options :=
678 run_test_rule_name :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700679 prereq_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700680endef # define-test-art-run-test
681
Ian Rogersf5c44b32014-08-19 16:52:36 -0700682$(foreach target, $(TARGET_TYPES), \
683 $(foreach test, $(TEST_ART_RUN_TESTS), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100684 $(foreach run_type, $(RUN_TYPES), \
685 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
686 $(foreach prebuild, $(PREBUILD_TYPES), \
687 $(foreach compiler, $(COMPILER_TYPES), \
688 $(foreach relocate, $(RELOCATE_TYPES), \
689 $(foreach trace, $(TRACE_TYPES), \
690 $(foreach gc, $(GC_TYPES), \
691 $(foreach jni, $(JNI_TYPES), \
692 $(foreach image, $(IMAGE_TYPES), \
Andreas Gampec23c9c92014-10-28 14:47:25 -0700693 $(foreach pictest, $(PICTEST_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000694 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
695 $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(debuggable),$(test),$(address_size))) \
696 )))))))))))))
Ian Rogersf5c44b32014-08-19 16:52:36 -0700697define-test-art-run-test :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700698
Ian Rogersafd9acc2014-06-17 08:21:54 -0700699# Define a phony rule whose purpose is to test its prerequisites.
Ian Rogersf5c44b32014-08-19 16:52:36 -0700700# $(1): host or target
Ian Rogersafd9acc2014-06-17 08:21:54 -0700701# $(2): list of prerequisites
Ian Rogersf5c44b32014-08-19 16:52:36 -0700702define define-test-art-run-test-group
Ian Rogersafd9acc2014-06-17 08:21:54 -0700703.PHONY: $(1)
704$(1): $(2)
705 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
706
Ian Rogersafd9acc2014-06-17 08:21:54 -0700707endef # define-test-art-run-test-group
708
Ian Rogersafd9acc2014-06-17 08:21:54 -0700709
Ian Rogersf5c44b32014-08-19 16:52:36 -0700710$(foreach target, $(TARGET_TYPES), $(eval \
711 $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
712$(foreach target, $(TARGET_TYPES), \
713 $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
714 $(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)))))
715$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100716 $(foreach run-type, $(RUN_TYPES), $(eval \
717 $(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)))))
718$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700719 $(foreach compiler, $(COMPILER_TYPES), $(eval \
720 $(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)))))
721$(foreach target, $(TARGET_TYPES), \
722 $(foreach relocate, $(RELOCATE_TYPES), $(eval \
723 $(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)))))
724$(foreach target, $(TARGET_TYPES), \
725 $(foreach trace, $(TRACE_TYPES), $(eval \
726 $(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)))))
727$(foreach target, $(TARGET_TYPES), \
728 $(foreach gc, $(GC_TYPES), $(eval \
729 $(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)))))
730$(foreach target, $(TARGET_TYPES), \
731 $(foreach jni, $(JNI_TYPES), $(eval \
732 $(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)))))
733$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000734 $(foreach debuggable, $(DEBUGGABLE_TYPES), $(eval \
735 $(call define-test-art-run-test-group,test-art-$(target)-run-test-$(debuggable),$(ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES)))))
736$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700737 $(foreach image, $(IMAGE_TYPES), $(eval \
738 $(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)))))
739$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700740 $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
741 $(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)))))
742$(foreach target, $(TARGET_TYPES), \
Ian Rogers86df3ac2014-08-27 10:54:11 -0700743 $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
Ian Rogersa3cf6ce2014-10-02 16:35:52 -0700744 $(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 -0700745
Ian Rogersf5c44b32014-08-19 16:52:36 -0700746# Clear variables now we're finished with them.
747$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
748$(foreach target, $(TARGET_TYPES), \
749 $(foreach prebuild, $(PREBUILD_TYPES), \
750 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
751$(foreach target, $(TARGET_TYPES), \
752 $(foreach compiler, $(COMPILER_TYPES), \
753 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
754$(foreach target, $(TARGET_TYPES), \
755 $(foreach relocate, $(RELOCATE_TYPES), \
756 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
757$(foreach target, $(TARGET_TYPES), \
758 $(foreach trace, $(TRACE_TYPES), \
759 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
760$(foreach target, $(TARGET_TYPES), \
761 $(foreach gc, $(GC_TYPES), \
762 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
763$(foreach target, $(TARGET_TYPES), \
764 $(foreach jni, $(JNI_TYPES), \
765 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
766$(foreach target, $(TARGET_TYPES), \
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000767 $(foreach debuggable, $(DEBUGGABLE_TYPES), \
768 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES :=)))
769$(foreach target, $(TARGET_TYPES), \
Alex Light03a112d2014-08-25 13:25:56 -0700770 $(foreach image, $(IMAGE_TYPES), \
771 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
772$(foreach target, $(TARGET_TYPES), \
Ian Rogersf5c44b32014-08-19 16:52:36 -0700773 $(foreach test, $(TEST_ART_RUN_TESTS), \
774 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
775$(foreach target, $(TARGET_TYPES), \
776 $(foreach address_size, $(ALL_ADDRESS_SIZES), \
777 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100778$(foreach target, $(TARGET_TYPES), \
779 $(foreach run_type, $(RUN_TYPES), \
780 $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700781define-test-art-run-test-group :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700782TARGET_TYPES :=
783PREBUILD_TYPES :=
784COMPILER_TYPES :=
785RELOCATE_TYPES :=
786TRACE_TYPES :=
787GC_TYPES :=
788JNI_TYPES :=
Alex Light03a112d2014-08-25 13:25:56 -0700789IMAGE_TYPES :=
Ian Rogers86df3ac2014-08-27 10:54:11 -0700790ADDRESS_SIZES_TARGET :=
791ADDRESS_SIZES_HOST :=
Ian Rogersf5c44b32014-08-19 16:52:36 -0700792ALL_ADDRESS_SIZES :=
Nicolas Geoffraybd2c63c2014-10-16 18:04:12 +0100793RUN_TYPES :=
Nicolas Geoffray43c162f2015-03-09 12:21:26 +0000794DEBUGGABLE_TYPES :=
Ian Rogers9fcaa4b2014-08-26 19:59:52 -0700795
796include $(LOCAL_PATH)/Android.libarttest.mk
797include art/test/Android.libnativebridgetest.mk