Android.run-test.mk revision 94329d31d2a99c9aff889b88ba4b675135409b82
1# 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
24########################################################################
25# The art-run-tests module, used to build all run-tests into an image.
26
27# 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
39$$(dmart_target): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $(HOST_OUT_EXECUTABLES)/smali $(HOST_OUT_EXECUTABLES)/dexmerger
40	$(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@)
41	$(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
42	  SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
43	  DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
44	  $(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
50$(foreach test, $(TEST_ART_RUN_TESTS), $(eval $(call define-build-art-run-test,$(test))))
51
52include $(CLEAR_VARS)
53LOCAL_MODULE_TAGS := tests
54LOCAL_MODULE := art-run-tests
55LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES)
56# 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.
62art_run_tests_dir :=
63define-build-art-run-test :=
64TEST_ART_RUN_TEST_BUILD_RULES :=
65
66########################################################################
67# General rules to build and run a run-test.
68
69TARGET_TYPES := host target
70PREBUILD_TYPES :=
71ifeq ($(ART_TEST_RUN_TEST_PREBUILD),true)
72  PREBUILD_TYPES += prebuild
73endif
74ifeq ($(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_JIT),true)
88  COMPILER_TYPES += jit
89endif
90ifeq ($(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-npatchoat
99endif
100TRACE_TYPES := ntrace
101ifeq ($(ART_TEST_TRACE),true)
102  TRACE_TYPES += trace
103endif
104GC_TYPES := cms
105ifeq ($(ART_TEST_GC_STRESS),true)
106  GC_TYPES += gcstress
107endif
108ifeq ($(ART_TEST_GC_VERIFY),true)
109  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
119ifeq ($(ART_TEST_PIC_IMAGE),true)
120  IMAGE_TYPES += picimage
121endif
122PICTEST_TYPES := npictest
123ifeq ($(ART_TEST_PIC_TEST),true)
124  PICTEST_TYPES += pictest
125endif
126RUN_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
133DEBUGGABLE_TYPES := ndebuggable
134ifeq ($(ART_TEST_RUN_TEST_DEBUGGABLE),true)
135DEBUGGABLE_TYPES += debuggable
136endif
137ADDRESS_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
143ALL_ADDRESS_SIZES := 64 32
144
145# List all run test names with number arguments agreeing with the comment above.
146define all-run-test-names
147  $(foreach target, $(1), \
148    $(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), \
156                    $(foreach pictest, $(10), \
157                      $(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                    )))))))))))))
162endef  # all-run-test-names
163
164# To generate a full list or tests:
165# $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
166#        $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
167#        $(DEBUGGABLE_TYPES) $(TEST_ART_RUN_TESTS), $(ALL_ADDRESS_SIZES)
168
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 \
177  055-enum-performance \
178  133-static-invoke-super
179
180 # disable timing sensitive tests on "dist" builds.
181ifdef dist_goal
182  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
183        $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
184        $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES))
185endif
186
187TEST_ART_TIMING_SENSITIVE_RUN_TESTS :=
188
189# Note 116-nodex2oat is not broken per-se it just doesn't (and isn't meant to) work with --prebuild.
190TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \
191  116-nodex2oat \
192  118-noimage-dex2oat \
193  134-nodex2oat-nofallback
194
195ifneq (,$(filter prebuild,$(PREBUILD_TYPES)))
196  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),prebuild, \
197      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
198      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES))
199endif
200
201TEST_ART_BROKEN_PREBUILD_RUN_TESTS :=
202
203TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
204  117-nopatchoat
205
206ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES)))
207  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-prebuild, \
208      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
209      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES))
210endif
211
212TEST_ART_BROKEN_NO_PREBUILD_TESTS :=
213
214# 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 := \
217  117-nopatchoat \
218  118-noimage-dex2oat \
219  119-noimage-patchoat
220
221ifneq (,$(filter no-relocate,$(RELOCATE_TYPES)))
222  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
223      $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
224      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES))
225endif
226
227TEST_ART_BROKEN_NO_RELOCATE_TESTS :=
228
229# Tests that are broken with GC stress.
230TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
231
232ifneq (,$(filter gcstress,$(GC_TYPES)))
233  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
234      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
235      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DBEUGGABLE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
236endif
237
238TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
239
240# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
241ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
242    $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), 115-native-bridge, \
243    $(ALL_ADDRESS_SIZES))
244
245# 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), \
251    $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),130-hprof,$(ALL_ADDRESS_SIZES))
252
253# 131 is an old test. The functionality has been implemented at an earlier stage and is checked
254# in tests 138.
255ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
256    $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
257    $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),131-structural-change,$(ALL_ADDRESS_SIZES))
258
259# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
260# Therefore we shouldn't run them in situations where we actually don't have these since they
261# explicitly test for them. These all also assume we have an image.
262TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
263  116-nodex2oat \
264  117-nopatchoat \
265  118-noimage-dex2oat \
266  119-noimage-patchoat \
267  138-duplicate-classes-check2
268
269# This test fails without an image.
270TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS := \
271  138-duplicate-classes-check
272
273ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
274  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
275      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
276      $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
277endif
278
279
280ifneq (,$(filter no-image,$(IMAGE_TYPES)))
281  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
282      $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
283      $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
284  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
285      $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
286      $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
287endif
288
289ifneq (,$(filter relocate-npatchoat,$(RELOCATE_TYPES)))
290  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
291      $(COMPILER_TYPES), relocate-npatchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
292      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
293endif
294
295TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
296
297# This test dynamically enables tracing to force a deoptimization. This makes the test meaningless
298# when already tracing, and writes an error message that we do not want to check for.
299TEST_ART_BROKEN_TRACING_RUN_TESTS := \
300  802-deoptimization
301
302ifneq (,$(filter trace,$(TRACE_TYPES)))
303  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
304      $(COMPILER_TYPES),$(RELOCATE_TYPES),trace,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
305      $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
306endif
307
308TEST_ART_BROKEN_TRACING_RUN_TESTS :=
309
310# The following tests use libarttest.so, which is linked against libartd.so, so will
311# not work when libart.so is the one loaded.
312# TODO: Find a way to run these tests in ndebug mode.
313TEST_ART_BROKEN_NDEBUG_TESTS := \
314  004-JniTest \
315  004-ReferenceMap \
316  004-SignalTest \
317  004-StackWalk \
318  004-UnsafeTest \
319  051-thread \
320  115-native-bridge \
321  116-nodex2oat \
322  117-nopatchoat \
323  118-noimage-dex2oat \
324  119-noimage-patchoat \
325  131-structural-change \
326  454-get-vreg \
327  455-set-vreg \
328  457-regs \
329  461-get-reference-vreg \
330  466-get-live-vreg \
331
332ifneq (,$(filter ndebug,$(RUN_TYPES)))
333  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
334      $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
335      $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES))
336endif
337
338TEST_ART_BROKEN_NDEBUG_TESTS :=
339
340# Known broken tests for the default compiler (Quick).
341TEST_ART_BROKEN_DEFAULT_RUN_TESTS := \
342  457-regs
343
344ifneq (,$(filter default,$(COMPILER_TYPES)))
345  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
346      default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
347      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_DEFAULT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
348endif
349
350TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
351
352# Known broken tests for Quick's and Optimizing's ARM back ends.
353TEST_ART_BROKEN_ARM_RUN_TESTS := 477-long-to-float-conversion-precision  # b/20413424
354
355ifeq ($(TARGET_ARCH),arm)
356  ifneq (,$(filter 32,$(ALL_ADDRESS_SIZES)))
357    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
358        $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
359        $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_ARM_RUN_TESTS),32)
360  endif
361endif
362
363ifdef TARGET_2ND_ARCH
364  ifeq ($(TARGET_2ND_ARCH),arm)
365    ifneq (,$(filter 32,$(ALL_ADDRESS_SIZES)))
366      ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
367          $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
368          $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_ARM_RUN_TESTS),32)
369    endif
370  endif
371endif
372
373TEST_ART_BROKEN_ARM_RUN_TESTS :=
374
375# Known broken tests for the arm64 optimizing compiler backend.
376TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
377
378ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
379  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
380      optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
381      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS),64)
382endif
383
384TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS :=
385
386# Known broken tests for the optimizing compiler.
387TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
388TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS += 099-vmdebug # b/18098594
389TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS += 802-deoptimization # b/18547544
390
391ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
392  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
393      optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
394      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
395endif
396
397# If ART_USE_OPTIMIZING_COMPILER is set to true, then the default core.art has been
398# compiled with the optimizing compiler.
399ifeq ($(ART_USE_OPTIMIZING_COMPILER),true)
400  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
401      default,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
402      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
403endif
404
405TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS :=
406
407# Tests that should fail when the optimizing compiler compiles them non-debuggable.
408TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS := \
409  454-get-vreg \
410  455-set-vreg \
411  457-regs \
412
413ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
414  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
415      optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
416      $(IMAGE_TYPES),$(PICTEST_TYPES),ndebuggable,$(TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
417endif
418
419TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
420
421# Tests that should fail when the optimizing compiler compiles them debuggable.
422TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS := \
423
424ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
425  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
426      optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
427      $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
428endif
429
430TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
431
432
433# Clear variables ahead of appending to them when defining tests.
434$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
435$(foreach target, $(TARGET_TYPES), \
436  $(foreach prebuild, $(PREBUILD_TYPES), \
437    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
438$(foreach target, $(TARGET_TYPES), \
439  $(foreach compiler, $(COMPILER_TYPES), \
440    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
441$(foreach target, $(TARGET_TYPES), \
442  $(foreach relocate, $(RELOCATE_TYPES), \
443    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
444$(foreach target, $(TARGET_TYPES), \
445  $(foreach trace, $(TRACE_TYPES), \
446    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
447$(foreach target, $(TARGET_TYPES), \
448  $(foreach gc, $(GC_TYPES), \
449    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
450$(foreach target, $(TARGET_TYPES), \
451  $(foreach jni, $(JNI_TYPES), \
452    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
453$(foreach target, $(TARGET_TYPES), \
454  $(foreach image, $(IMAGE_TYPES), \
455    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
456$(foreach target, $(TARGET_TYPES), \
457  $(foreach test, $(TEST_ART_RUN_TESTS), \
458    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
459$(foreach target, $(TARGET_TYPES), \
460  $(foreach address_size, $(ALL_ADDRESS_SIZES), \
461    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
462$(foreach target, $(TARGET_TYPES), \
463  $(foreach run_type, $(RUN_TYPES), \
464    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
465$(foreach target, $(TARGET_TYPES), \
466  $(foreach debuggable_type, $(DEBUGGABLE_TYPES), \
467    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable_type))_RULES :=)))
468
469# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
470# only once).
471TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
472
473# Also need libarttest.
474TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
475ifdef TARGET_2ND_ARCH
476TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
477endif
478
479# Also need libnativebridgetest.
480TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libnativebridgetest.so
481ifdef TARGET_2ND_ARCH
482TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libnativebridgetest.so
483endif
484
485# All tests require the host executables. The tests also depend on the core images, but on
486# specific version depending on the compiler.
487ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
488  $(ART_HOST_EXECUTABLES) \
489  $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
490  $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
491  $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
492
493ifneq ($(HOST_PREFER_32_BIT),true)
494ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
495  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \
496  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \
497  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
498endif
499
500# Create a rule to build and run a tests following the form:
501# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
502#    {4: interpreter default optimizing jit}-{5: relocate nrelocate relocate-npatchoat}-
503#    {6: trace or ntrace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
504#    {9: no-image image picimage}-{10: pictest npictest}-
505#    {11: ndebuggable debuggable}-{12: test name}{13: 32 or 64}
506define define-test-art-run-test
507  run_test_options :=
508  prereq_rule :=
509  test_groups :=
510  uc_host_or_target :=
511  ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
512    run_test_options += --always-clean
513  endif
514  ifeq ($(1),host)
515    uc_host_or_target := HOST
516    test_groups := ART_RUN_TEST_HOST_RULES
517    run_test_options += --host
518    prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
519  else
520    ifeq ($(1),target)
521      uc_host_or_target := TARGET
522      test_groups := ART_RUN_TEST_TARGET_RULES
523      prereq_rule := test-art-target-sync
524    else
525      $$(error found $(1) expected $(TARGET_TYPES))
526    endif
527  endif
528  ifeq ($(2),debug)
529    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
530  else
531    ifeq ($(2),ndebug)
532      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
533      run_test_options += -O
534    else
535      $$(error found $(2) expected $(RUN_TYPES))
536    endif
537  endif
538  ifeq ($(3),prebuild)
539    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
540    run_test_options += --prebuild
541  else
542    ifeq ($(3),no-prebuild)
543      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
544      run_test_options += --no-prebuild
545    else
546      ifeq ($(3),no-dex2oat)
547        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
548        run_test_options += --no-prebuild --no-dex2oat
549      else
550        $$(error found $(3) expected $(PREBUILD_TYPES))
551      endif
552    endif
553  endif
554  ifeq ($(4),optimizing)
555    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
556    run_test_options += --optimizing
557  else
558    ifeq ($(4),interpreter)
559      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
560      run_test_options += --interpreter
561    else
562      ifeq ($(4),default)
563        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEFAULT_RULES
564        run_test_options += --quick
565      else
566        ifeq ($(4),jit)
567          test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JIT_RULES
568          run_test_options += --jit
569        else
570          $$(error found $(4) expected $(COMPILER_TYPES))
571        endif
572      endif
573    endif
574  endif
575
576  ifeq ($(5),relocate)
577    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
578    run_test_options += --relocate
579  else
580    ifeq ($(5),no-relocate)
581      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
582      run_test_options += --no-relocate
583    else
584      ifeq ($(5),relocate-npatchoat)
585        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
586        run_test_options += --relocate --no-patchoat
587      else
588        $$(error found $(5) expected $(RELOCATE_TYPES))
589      endif
590    endif
591  endif
592  ifeq ($(6),trace)
593    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
594    run_test_options += --trace
595  else
596    ifeq ($(6),ntrace)
597      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
598    else
599      $$(error found $(6) expected $(TRACE_TYPES))
600    endif
601  endif
602  ifeq ($(7),gcverify)
603    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
604    run_test_options += --gcverify
605  else
606    ifeq ($(7),gcstress)
607      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
608      run_test_options += --gcstress
609    else
610      ifeq ($(7),cms)
611        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
612      else
613        $$(error found $(7) expected $(GC_TYPES))
614      endif
615    endif
616  endif
617  ifeq ($(8),forcecopy)
618    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
619    run_test_options += --runtime-option -Xjniopts:forcecopy
620    ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
621      skip_test := true
622    endif
623  else
624    ifeq ($(8),checkjni)
625      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
626      run_test_options += --runtime-option -Xcheck:jni
627    else
628      ifeq ($(8),jni)
629        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
630      else
631        $$(error found $(8) expected $(JNI_TYPES))
632      endif
633    endif
634  endif
635  ifeq ($(4),jit)
636    # Use interpreter image for JIT.
637    image_suffix := interpreter
638  else
639    image_suffix := $(4)
640  endif
641  ifeq ($(9),no-image)
642    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
643    run_test_options += --no-image
644    # Add the core dependency. This is required for pre-building.
645    ifeq ($(1),host)
646      prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
647    else
648      prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
649    endif
650  else
651    ifeq ($(9),image)
652      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
653      # Add the core dependency.
654      ifeq ($(1),host)
655        prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
656      else
657        prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
658      endif
659    else
660      ifeq ($(9),picimage)
661        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
662        run_test_options += --pic-image
663        ifeq ($(1),host)
664          prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_pic_$(13))
665        else
666          prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_pic_$(13))
667        endif
668      else
669        $$(error found $(9) expected $(IMAGE_TYPES))
670      endif
671    endif
672  endif
673  ifeq ($(10),pictest)
674    run_test_options += --pic-test
675  else
676    ifeq ($(10),npictest)
677      # Nothing to be done.
678    else
679      $$(error found $(10) expected $(PICTEST_TYPES))
680    endif
681  endif
682  ifeq ($(11),debuggable)
683    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUGGABLE_RULES
684    run_test_options += --debuggable
685  else
686    ifeq ($(11),ndebuggable)
687    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NONDEBUGGABLE_RULES
688      # Nothing to be done.
689    else
690      $$(error found $(11) expected $(DEBUGGABLE_TYPES))
691    endif
692  endif
693  # $(12) is the test name.
694  test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(12))_RULES
695  ifeq ($(13),64)
696    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
697    run_test_options += --64
698  else
699    ifeq ($(13),32)
700      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
701    else
702      $$(error found $(13) expected $(ALL_ADDRESS_SIZES))
703    endif
704  endif
705  run_test_rule_name := test-art-$(1)-run-test-$(2)-$(3)-$(4)-$(5)-$(6)-$(7)-$(8)-$(9)-$(10)-$(11)-$(12)$(13)
706  run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
707      $$(run_test_options)
708  ifneq ($(ART_TEST_ANDROID_ROOT),)
709    run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
710  endif
711$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
712.PHONY: $$(run_test_rule_name)
713$$(run_test_rule_name): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin $(HOST_OUT_EXECUTABLES)/smali $(HOST_OUT_EXECUTABLES)/dexmerger $(HOST_OUT_EXECUTABLES)/hprof-conv $$(prereq_rule)
714	$(hide) $$(call ART_TEST_SKIP,$$@) && \
715	  DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
716	    SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
717	    DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
718	    art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(12) \
719	      && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
720	$$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
721	  echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
722	  rm -r $(ART_HOST_TEST_DIR)) || true
723
724  $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
725
726  # Clear locally defined variables.
727  uc_host_or_target :=
728  test_groups :=
729  run_test_options :=
730  run_test_rule_name :=
731  prereq_rule :=
732endef  # define-test-art-run-test
733
734$(foreach target, $(TARGET_TYPES), \
735  $(foreach test, $(TEST_ART_RUN_TESTS), \
736    $(foreach run_type, $(RUN_TYPES), \
737      $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
738        $(foreach prebuild, $(PREBUILD_TYPES), \
739          $(foreach compiler, $(COMPILER_TYPES), \
740            $(foreach relocate, $(RELOCATE_TYPES), \
741              $(foreach trace, $(TRACE_TYPES), \
742                $(foreach gc, $(GC_TYPES), \
743                  $(foreach jni, $(JNI_TYPES), \
744                    $(foreach image, $(IMAGE_TYPES), \
745                      $(foreach pictest, $(PICTEST_TYPES), \
746                        $(foreach debuggable, $(DEBUGGABLE_TYPES), \
747                          $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(debuggable),$(test),$(address_size))) \
748                  )))))))))))))
749define-test-art-run-test :=
750
751# Define a phony rule whose purpose is to test its prerequisites.
752# $(1): host or target
753# $(2): list of prerequisites
754define define-test-art-run-test-group
755.PHONY: $(1)
756$(1): $(2)
757	$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
758
759endef  # define-test-art-run-test-group
760
761
762$(foreach target, $(TARGET_TYPES), $(eval \
763  $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
764$(foreach target, $(TARGET_TYPES), \
765  $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
766    $(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)))))
767$(foreach target, $(TARGET_TYPES), \
768  $(foreach run-type, $(RUN_TYPES), $(eval \
769    $(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)))))
770$(foreach target, $(TARGET_TYPES), \
771  $(foreach compiler, $(COMPILER_TYPES), $(eval \
772    $(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)))))
773$(foreach target, $(TARGET_TYPES), \
774  $(foreach relocate, $(RELOCATE_TYPES), $(eval \
775    $(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)))))
776$(foreach target, $(TARGET_TYPES), \
777  $(foreach trace, $(TRACE_TYPES), $(eval \
778    $(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)))))
779$(foreach target, $(TARGET_TYPES), \
780  $(foreach gc, $(GC_TYPES), $(eval \
781    $(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)))))
782$(foreach target, $(TARGET_TYPES), \
783  $(foreach jni, $(JNI_TYPES), $(eval \
784    $(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)))))
785$(foreach target, $(TARGET_TYPES), \
786  $(foreach debuggable, $(DEBUGGABLE_TYPES), $(eval \
787    $(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)))))
788$(foreach target, $(TARGET_TYPES), \
789  $(foreach image, $(IMAGE_TYPES), $(eval \
790    $(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)))))
791$(foreach target, $(TARGET_TYPES), \
792  $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
793    $(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)))))
794$(foreach target, $(TARGET_TYPES), \
795  $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
796    $(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)))))
797
798# Clear variables now we're finished with them.
799$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
800$(foreach target, $(TARGET_TYPES), \
801  $(foreach prebuild, $(PREBUILD_TYPES), \
802    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
803$(foreach target, $(TARGET_TYPES), \
804  $(foreach compiler, $(COMPILER_TYPES), \
805    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
806$(foreach target, $(TARGET_TYPES), \
807  $(foreach relocate, $(RELOCATE_TYPES), \
808    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
809$(foreach target, $(TARGET_TYPES), \
810  $(foreach trace, $(TRACE_TYPES), \
811    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
812$(foreach target, $(TARGET_TYPES), \
813  $(foreach gc, $(GC_TYPES), \
814    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
815$(foreach target, $(TARGET_TYPES), \
816  $(foreach jni, $(JNI_TYPES), \
817    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
818$(foreach target, $(TARGET_TYPES), \
819  $(foreach debuggable, $(DEBUGGABLE_TYPES), \
820    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES :=)))
821$(foreach target, $(TARGET_TYPES), \
822  $(foreach image, $(IMAGE_TYPES), \
823    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
824$(foreach target, $(TARGET_TYPES), \
825  $(foreach test, $(TEST_ART_RUN_TESTS), \
826    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
827$(foreach target, $(TARGET_TYPES), \
828  $(foreach address_size, $(ALL_ADDRESS_SIZES), \
829    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
830$(foreach target, $(TARGET_TYPES), \
831  $(foreach run_type, $(RUN_TYPES), \
832    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
833define-test-art-run-test-group :=
834TARGET_TYPES :=
835PREBUILD_TYPES :=
836COMPILER_TYPES :=
837RELOCATE_TYPES :=
838TRACE_TYPES :=
839GC_TYPES :=
840JNI_TYPES :=
841IMAGE_TYPES :=
842ADDRESS_SIZES_TARGET :=
843ADDRESS_SIZES_HOST :=
844ALL_ADDRESS_SIZES :=
845RUN_TYPES :=
846DEBUGGABLE_TYPES :=
847
848include $(LOCAL_PATH)/Android.libarttest.mk
849include art/test/Android.libnativebridgetest.mk
850