Android.run-test.mk revision a5c61bf479453e7e195888afb4e62a9872d6be7c
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_build_dir := $(call intermediates-dir-for,JAVA_LIBRARIES,art-run-tests)/DATA
30art_run_tests_install_dir := $(call intermediates-dir-for,PACKAGING,art-run-tests)/DATA
31
32# A generated list of prerequisites that call 'run-test --build-only', the actual prerequisite is
33# an empty file touched in the intermediate directory.
34TEST_ART_RUN_TEST_BUILD_RULES :=
35
36# Dependencies for actually running a run-test.
37TEST_ART_RUN_TEST_DEPENDENCIES := \
38  $(DX) \
39  $(HOST_OUT_EXECUTABLES)/jasmin \
40  $(HOST_OUT_EXECUTABLES)/smali \
41  $(HOST_OUT_EXECUTABLES)/dexmerger \
42  $(JACK)
43
44TEST_ART_RUN_TEST_ORDERONLY_DEPENDENCIES := setup-jack-server
45
46ifeq ($(ART_TEST_DEBUG_GC),true)
47  ART_TEST_WITH_STRACE := true
48endif
49
50ifeq ($(ART_TEST_BISECTION),true)
51  # Need to keep rebuilding the test to bisection search it.
52  ART_TEST_RUN_TEST_NO_PREBUILD := true
53  ART_TEST_RUN_TEST_PREBUILD := false
54  # Bisection search writes to standard output.
55  ART_TEST_QUIET := false
56endif
57
58# Helper to create individual build targets for tests. Must be called with $(eval).
59# $(1): the test number
60define define-build-art-run-test
61  dmart_target := $(art_run_tests_build_dir)/art-run-tests/$(1)/touch
62  dmart_install_target := $(art_run_tests_install_dir)/art-run-tests/$(1)/touch
63  run_test_options = --build-only
64  ifeq ($(ART_TEST_QUIET),true)
65    run_test_options += --quiet
66  endif
67$$(dmart_target): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
68$$(dmart_target): $(TEST_ART_RUN_TEST_DEPENDENCIES) $(TARGET_JACK_CLASSPATH_DEPENDENCIES) | $(TEST_ART_RUN_TEST_ORDERONLY_DEPENDENCIES)
69	$(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@)
70	$(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
71	  SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
72	  DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
73	  JACK_VERSION=$(JACK_DEFAULT_VERSION) \
74	  JACK=$(abspath $(JACK)) \
75	  JACK_VERSION=$(JACK_DEFAULT_VERSION) \
76	  JACK_CLASSPATH=$(TARGET_JACK_CLASSPATH) \
77	  $(LOCAL_PATH)/run-test $$(PRIVATE_RUN_TEST_OPTIONS) --output-path $$(abspath $$(dir $$@)) $(1)
78	$(hide) touch $$@
79
80$$(dmart_install_target): $$(dmart_target)
81	$(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@)
82	$(hide) cp $$(dir $$<)/* $$(dir $$@)/
83
84  TEST_ART_RUN_TEST_BUILD_RULES += $$(dmart_install_target)
85  dmart_target :=
86  dmart_install_target :=
87  run_test_options :=
88endef
89$(foreach test, $(TEST_ART_RUN_TESTS), $(eval $(call define-build-art-run-test,$(test))))
90
91include $(CLEAR_VARS)
92LOCAL_MODULE_TAGS := tests
93LOCAL_MODULE := art-run-tests
94LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES)
95# The build system use this flag to pick up files generated by declare-make-art-run-test.
96LOCAL_PICKUP_FILES := $(art_run_tests_install_dir)
97
98include $(BUILD_PHONY_PACKAGE)
99
100# Clear temp vars.
101art_run_tests_build_dir :=
102art_run_tests_install_dir :=
103define-build-art-run-test :=
104TEST_ART_RUN_TEST_BUILD_RULES :=
105
106########################################################################
107# General rules to build and run a run-test.
108
109TARGET_TYPES := host target
110PREBUILD_TYPES :=
111ifeq ($(ART_TEST_RUN_TEST_PREBUILD),true)
112  PREBUILD_TYPES += prebuild
113endif
114ifeq ($(ART_TEST_RUN_TEST_NO_PREBUILD),true)
115  PREBUILD_TYPES += no-prebuild
116endif
117ifeq ($(ART_TEST_RUN_TEST_NO_DEX2OAT),true)
118  PREBUILD_TYPES += no-dex2oat
119endif
120COMPILER_TYPES :=
121ifeq ($(ART_TEST_INTERPRETER_ACCESS_CHECKS),true)
122  COMPILER_TYPES += interp-ac
123endif
124ifeq ($(ART_TEST_INTERPRETER),true)
125  COMPILER_TYPES += interpreter
126endif
127ifeq ($(ART_TEST_JIT),true)
128  COMPILER_TYPES += jit
129endif
130OPTIMIZING_COMPILER_TYPES :=
131ifeq ($(ART_TEST_OPTIMIZING),true)
132  COMPILER_TYPES += optimizing
133  OPTIMIZING_COMPILER_TYPES += optimizing
134endif
135ifeq ($(ART_TEST_OPTIMIZING_GRAPH_COLOR),true)
136  COMPILER_TYPES += regalloc_gc
137  OPTIMIZING_COMPILER_TYPES += regalloc_gc
138endif
139RELOCATE_TYPES := relocate
140ifeq ($(ART_TEST_RUN_TEST_NO_RELOCATE),true)
141  RELOCATE_TYPES += no-relocate
142endif
143ifeq ($(ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT),true)
144  RELOCATE_TYPES += relocate-npatchoat
145endif
146TRACE_TYPES := ntrace
147ifeq ($(ART_TEST_TRACE),true)
148  TRACE_TYPES += trace
149endif
150ifeq ($(ART_TEST_TRACE_STREAM),true)
151  TRACE_TYPES += stream
152endif
153GC_TYPES := cms
154ifeq ($(ART_TEST_GC_STRESS),true)
155  GC_TYPES += gcstress
156endif
157ifeq ($(ART_TEST_GC_VERIFY),true)
158  GC_TYPES += gcverify
159endif
160JNI_TYPES := checkjni
161ifeq ($(ART_TEST_JNI_FORCECOPY),true)
162  JNI_TYPES += forcecopy
163endif
164IMAGE_TYPES := picimage
165ifeq ($(ART_TEST_RUN_TEST_NO_IMAGE),true)
166  IMAGE_TYPES += no-image
167endif
168ifeq ($(ART_TEST_RUN_TEST_MULTI_IMAGE),true)
169  IMAGE_TYPES := multipicimage
170endif
171ifeq ($(ART_TEST_NPIC_IMAGE),true)
172  IMAGE_TYPES += npicimage
173  ifeq ($(ART_TEST_RUN_TEST_MULTI_IMAGE),true)
174    IMAGE_TYPES := multinpicimage
175  endif
176endif
177PICTEST_TYPES := npictest
178ifeq ($(ART_TEST_PIC_TEST),true)
179  PICTEST_TYPES += pictest
180endif
181RUN_TYPES :=
182ifeq ($(ART_TEST_RUN_TEST_DEBUG),true)
183  RUN_TYPES += debug
184endif
185ifeq ($(ART_TEST_RUN_TEST_NDEBUG),true)
186  RUN_TYPES += ndebug
187endif
188DEBUGGABLE_TYPES := ndebuggable
189ifeq ($(ART_TEST_RUN_TEST_DEBUGGABLE),true)
190DEBUGGABLE_TYPES += debuggable
191endif
192ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX)
193ADDRESS_SIZES_HOST := $(ART_PHONY_TEST_HOST_SUFFIX)
194ifeq ($(ART_TEST_RUN_TEST_2ND_ARCH),true)
195  ADDRESS_SIZES_TARGET += $(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
196  ADDRESS_SIZES_HOST += $(2ND_ART_PHONY_TEST_HOST_SUFFIX)
197endif
198ALL_ADDRESS_SIZES := 64 32
199
200# List all run test names with number arguments agreeing with the comment above.
201define all-run-test-names
202  $(foreach target, $(1), \
203    $(foreach run-type, $(2), \
204      $(foreach prebuild, $(3), \
205        $(foreach compiler, $(4), \
206          $(foreach relocate, $(5), \
207            $(foreach trace, $(6), \
208              $(foreach gc, $(7), \
209                $(foreach jni, $(8), \
210                  $(foreach image, $(9), \
211                    $(foreach pictest, $(10), \
212                      $(foreach debuggable, $(11), \
213                        $(foreach test, $(12), \
214                          $(foreach address_size, $(13), \
215                            test-art-$(target)-run-test-$(run-type)-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(image)-$(pictest)-$(debuggable)-$(test)$(address_size) \
216                    )))))))))))))
217endef  # all-run-test-names
218
219# To generate a full list or tests:
220# $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
221#        $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
222#        $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_RUN_TESTS),$(ALL_ADDRESS_SIZES))
223
224# Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE
225define name-to-var
226$(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
227endef  # name-to-var
228
229ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
230        $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
231        $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(ART_TEST_RUN_TEST_SKIP), $(ALL_ADDRESS_SIZES))
232
233
234# Disable 149-suspend-all-stress, its output is flaky (b/28988206).
235# Disable 577-profile-foreign-dex (b/27454772).
236TEST_ART_BROKEN_ALL_TARGET_TESTS := \
237  149-suspend-all-stress \
238  577-profile-foreign-dex \
239
240ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
241    $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
242    $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_ALL_TARGET_TESTS), \
243    $(ALL_ADDRESS_SIZES))
244
245TEST_ART_BROKEN_ALL_TARGET_TESTS :=
246
247# Tests that are timing sensitive and flaky on heavily loaded systems.
248TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \
249  002-sleep \
250  053-wait-some \
251  055-enum-performance \
252  133-static-invoke-super
253
254# disable timing sensitive tests on "dist" builds.
255ifdef dist_goal
256  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
257        $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
258        $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES))
259endif
260
261# 147-stripped-dex-fallback isn't supported on device because --strip-dex
262# requires the zip command.
263# 569-checker-pattern-replacement tests behaviour present only on host.
264# 90{2,3,4,5,6,7} are not supported in current form due to linker
265# restrictions. See b/31681198
266TEST_ART_BROKEN_TARGET_TESTS := \
267  147-stripped-dex-fallback \
268  569-checker-pattern-replacement \
269  902-hello-transformation \
270  903-hello-tagging \
271  904-object-allocation \
272  905-object-free \
273  906-iterate-heap \
274  907-get-loaded-classes \
275
276ifneq (,$(filter target,$(TARGET_TYPES)))
277  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
278      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
279      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TARGET_TESTS), $(ALL_ADDRESS_SIZES))
280endif
281
282TEST_ART_BROKEN_TARGET_TESTS :=
283
284# Tests that require python3.
285TEST_ART_PYTHON3_DEPENDENCY_RUN_TESTS := \
286  960-default-smali \
287  961-default-iface-resolution-gen \
288  964-default-iface-init-gen \
289  968-default-partial-compile-gen \
290  969-iface-super \
291  970-iface-super-resolution-gen \
292  971-iface-super
293
294# Check if we have python3 to run our tests.
295ifeq ($(wildcard /usr/bin/python3),)
296  $(warning "No python3 found. Disabling tests: $(TEST_ART_PYTHON3_DEPENDENCY_RUN_TESTS)")
297
298  # Currently disable tests requiring python3 when it is not installed.
299  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
300        $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
301        $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_PYTHON3_DEPENDENCY_RUN_TESTS), $(ALL_ADDRESS_SIZES))
302endif
303
304TEST_ART_TIMING_SENSITIVE_RUN_TESTS :=
305
306# Note 116-nodex2oat is not broken per-se it just doesn't (and isn't meant to) work with --prebuild.
307TEST_ART_BROKEN_PREBUILD_RUN_TESTS := \
308  116-nodex2oat \
309  118-noimage-dex2oat \
310  134-nodex2oat-nofallback
311
312ifneq (,$(filter prebuild,$(PREBUILD_TYPES)))
313  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),prebuild, \
314      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
315      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_PREBUILD_RUN_TESTS), $(ALL_ADDRESS_SIZES))
316endif
317
318TEST_ART_BROKEN_PREBUILD_RUN_TESTS :=
319
320# 554-jit-profile-file is disabled because it needs a primary oat file to know what it should save.
321# 529 and 555: b/27784033
322TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
323  117-nopatchoat \
324  147-stripped-dex-fallback \
325  554-jit-profile-file \
326  529-checker-unresolved \
327  555-checker-regression-x86const \
328  608-checker-unresolved-lse
329
330ifneq (,$(filter no-prebuild,$(PREBUILD_TYPES)))
331  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-prebuild, \
332      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
333      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_PREBUILD_TESTS), $(ALL_ADDRESS_SIZES))
334endif
335
336TEST_ART_BROKEN_NO_PREBUILD_TESTS :=
337
338# Note 117-nopatchoat is not broken per-se it just doesn't work (and isn't meant to) without
339# --prebuild --relocate
340TEST_ART_BROKEN_NO_RELOCATE_TESTS := \
341  117-nopatchoat \
342  118-noimage-dex2oat \
343  119-noimage-patchoat \
344  554-jit-profile-file
345
346ifneq (,$(filter no-relocate,$(RELOCATE_TYPES)))
347  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
348      $(COMPILER_TYPES), no-relocate,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
349      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_RELOCATE_TESTS), $(ALL_ADDRESS_SIZES))
350endif
351
352TEST_ART_BROKEN_NO_RELOCATE_TESTS :=
353
354# Temporarily disable some broken tests when forcing access checks in interpreter b/22414682
355TEST_ART_BROKEN_INTERPRETER_ACCESS_CHECK_TESTS := \
356  137-cfi
357
358ifneq (,$(filter interp-ac,$(COMPILER_TYPES)))
359  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
360      interp-ac,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
361      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_INTERPRETER_ACCESS_CHECK_TESTS), $(ALL_ADDRESS_SIZES))
362endif
363
364TEST_ART_BROKEN_INTERPRETER_ACCESS_CHECK_TESTS :=
365
366# Tests that are broken with GC stress.
367# * 137-cfi needs to unwind a second forked process. We're using a primitive sleep to wait till we
368#   hope the second process got into the expected state. The slowness of gcstress makes this bad.
369# * 961-default-iface-resolution-gen and 964-default-iface-init-genare very long tests that often
370#   will take more than the timeout to run when gcstress is enabled. This is because gcstress
371#   slows down allocations significantly which these tests do a lot.
372TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := \
373  137-cfi \
374  961-default-iface-resolution-gen \
375  964-default-iface-init-gen
376
377ifneq (,$(filter gcstress,$(GC_TYPES)))
378  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
379      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
380      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
381endif
382
383TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
384
385# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
386ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
387    $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), 115-native-bridge, \
388    $(ALL_ADDRESS_SIZES))
389
390# 130-hprof dumps the heap and runs hprof-conv to check whether the file is somewhat readable. This
391# is only possible on the host.
392# TODO: Turn off all the other combinations, this is more about testing actual ART code. A gtest is
393#       very hard to write here, as (for a complete test) JDWP must be set up.
394ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
395    $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
396    $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),130-hprof,$(ALL_ADDRESS_SIZES))
397
398# 131 is an old test. The functionality has been implemented at an earlier stage and is checked
399# in tests 138. Blacklisted for debug builds since these builds have duplicate classes checks which
400# punt to interpreter.
401ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),debug,$(PREBUILD_TYPES), \
402    $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
403    $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),131-structural-change,$(ALL_ADDRESS_SIZES))
404
405# 138-duplicate-classes-check. Turned on for debug builds since debug builds have duplicate classes
406# checks enabled, b/2133391.
407ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
408    $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
409    $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),138-duplicate-classes-check,$(ALL_ADDRESS_SIZES))
410
411# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
412# Therefore we shouldn't run them in situations where we actually don't have these since they
413# explicitly test for them. These all also assume we have an image.
414# 147-stripped-dex-fallback is disabled because it requires --prebuild.
415# 554-jit-profile-file is disabled because it needs a primary oat file to know what it should save.
416TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
417  116-nodex2oat \
418  117-nopatchoat \
419  118-noimage-dex2oat \
420  119-noimage-patchoat \
421  137-cfi \
422  138-duplicate-classes-check2 \
423  147-stripped-dex-fallback \
424  554-jit-profile-file
425
426# This test fails without an image.
427TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS := \
428  137-cfi \
429  138-duplicate-classes-check
430
431ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
432  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
433      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
434      $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
435endif
436
437
438ifneq (,$(filter no-image,$(IMAGE_TYPES)))
439  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
440      $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
441      $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
442  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
443      $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
444      $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
445endif
446
447ifneq (,$(filter relocate-npatchoat,$(RELOCATE_TYPES)))
448  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
449      $(COMPILER_TYPES), relocate-npatchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
450      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
451endif
452
453TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
454
455# 137:
456# This test unrolls and expects managed frames, but tracing means we run the interpreter.
457# 802 and 570-checker-osr:
458# This test dynamically enables tracing to force a deoptimization. This makes the test meaningless
459# when already tracing, and writes an error message that we do not want to check for.
460TEST_ART_BROKEN_TRACING_RUN_TESTS := \
461  087-gc-after-link \
462  137-cfi \
463  141-class-unload \
464  570-checker-osr \
465  802-deoptimization
466
467ifneq (,$(filter trace stream,$(TRACE_TYPES)))
468  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
469      $(COMPILER_TYPES),$(RELOCATE_TYPES),trace stream,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
470      $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
471endif
472
473# Known broken tests for the interpreter.
474# CFI unwinding expects managed frames.
475TEST_ART_BROKEN_INTERPRETER_RUN_TESTS := \
476  137-cfi \
477  554-jit-profile-file
478
479ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
480  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
481      interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
482      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_INTERPRETER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
483endif
484
485TEST_ART_BROKEN_INTERPRETER_RUN_TESTS :=
486
487# Known broken tests for the JIT.
488# CFI unwinding expects managed frames, and the test does not iterate enough to even compile. JIT
489# also uses Generic JNI instead of the JNI compiler.
490# Test 906 iterates the heap filtering with different options. No instances should be created
491# between those runs to be able to have precise checks.
492TEST_ART_BROKEN_JIT_RUN_TESTS := \
493  137-cfi \
494  904-object-allocation \
495  906-iterate-heap \
496
497ifneq (,$(filter jit,$(COMPILER_TYPES)))
498  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
499      jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
500      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_JIT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
501endif
502
503TEST_ART_BROKEN_JIT_RUN_TESTS :=
504
505# Known broken tests for the graph coloring register allocator.
506# These tests were based on the linear scan allocator, which makes different decisions than
507# the graph coloring allocator. (These attempt to test for code quality, not correctness.)
508TEST_ART_BROKEN_OPTIMIZING_GRAPH_COLOR := \
509  570-checker-select \
510  484-checker-register-hints
511
512ifneq (,$(filter regalloc_gc,$(COMPILER_TYPES)))
513  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
514      regalloc_gc,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
515      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
516      $(TEST_ART_BROKEN_OPTIMIZING_GRAPH_COLOR),$(ALL_ADDRESS_SIZES))
517endif
518
519# Known broken tests for the ARM VIXL backend.
520# Android.arm_vixl.mk defines TEST_ART_BROKEN_OPTIMIZING_ARM_VIXL_RUN_TESTS.
521include $(LOCAL_PATH)/Android.arm_vixl.mk
522
523ifdef ART_USE_VIXL_ARM_BACKEND
524  ifeq (arm,$(filter arm,$(TARGET_ARCH) $(TARGET_2ND_ARCH)))
525    ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
526      ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
527          $(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
528          $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
529          $(TEST_ART_BROKEN_OPTIMIZING_ARM_VIXL_RUN_TESTS),32)
530    endif
531  endif
532  # TODO(VIXL): These two tests currently fail, but adding them to `ART_TEST_KNOWN_BROKEN` breaks
533  # `export ART_USE_VIXL_ARM_BACKEND=true && mma -j6 test-art-target-gtest dist`
534  #ART_TEST_KNOWN_BROKEN += test-art-target-gtest-dex2oat_test32
535  #ART_TEST_KNOWN_BROKEN += test-art-target-gtest-image_test32
536endif
537
538
539# Known broken tests for the mips32 optimizing compiler backend.
540TEST_ART_BROKEN_OPTIMIZING_MIPS_RUN_TESTS := \
541
542ifeq (mips,$(TARGET_ARCH))
543  ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
544    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
545        $(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
546        $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
547        $(TEST_ART_BROKEN_OPTIMIZING_MIPS_RUN_TESTS),$(ALL_ADDRESS_SIZES))
548  endif
549endif
550
551TEST_ART_BROKEN_OPTIMIZING_MIPS_RUN_TESTS :=
552
553# Known broken tests for the mips64 optimizing compiler backend.
554TEST_ART_BROKEN_OPTIMIZING_MIPS64_RUN_TESTS := \
555
556ifeq (mips64,$(TARGET_ARCH))
557  ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
558    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
559        $(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
560        $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
561        $(TEST_ART_BROKEN_OPTIMIZING_MIPS64_RUN_TESTS),$(ALL_ADDRESS_SIZES))
562  endif
563endif
564
565TEST_ART_BROKEN_OPTIMIZING_MIPS64_RUN_TESTS :=
566
567# Tests that should fail when the optimizing compiler compiles them non-debuggable.
568TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS := \
569  454-get-vreg \
570  457-regs \
571
572ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
573  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
574      $(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
575      $(IMAGE_TYPES),$(PICTEST_TYPES),ndebuggable,$(TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
576endif
577
578TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
579
580# Tests that should fail when the optimizing compiler compiles them debuggable.
581TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS := \
582
583ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
584  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
585      $(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
586      $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
587endif
588
589TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
590
591# Tests that should fail in the read barrier configuration with the interpreter.
592TEST_ART_BROKEN_INTERPRETER_READ_BARRIER_RUN_TESTS :=
593
594# Tests that should fail in the read barrier configuration with the Optimizing compiler (AOT).
595# 484: Baker's fast path based read barrier compiler instrumentation generates code containing
596#      more parallel moves on x86, thus some Checker assertions may fail.
597# 527: On ARM64 and ARM, the read barrier instrumentation does not support the HIntermediateAddress
598#      instruction yet (b/26601270).
599TEST_ART_BROKEN_OPTIMIZING_READ_BARRIER_RUN_TESTS := \
600  484-checker-register-hints \
601  527-checker-array-access-split
602
603# Tests that should fail in the read barrier configuration with JIT (Optimizing compiler).
604TEST_ART_BROKEN_JIT_READ_BARRIER_RUN_TESTS :=
605
606# Tests failing in non-Baker read barrier configurations with the Optimizing compiler (AOT).
607# 537: Expects an array copy to be intrinsified, but calling-on-slowpath intrinsics are not yet
608#      handled in non-Baker read barrier configurations.
609TEST_ART_BROKEN_OPTIMIZING_NON_BAKER_READ_BARRIER_RUN_TESTS := \
610  537-checker-arraycopy
611
612# Tests failing in non-Baker read barrier configurations with JIT (Optimizing compiler).
613# 537: Expects an array copy to be intrinsified, but calling-on-slowpath intrinsics are not yet
614#      handled in non-Baker read barrier configurations.
615TEST_ART_BROKEN_JIT_NON_BAKER_READ_BARRIER_RUN_TESTS := \
616  537-checker-arraycopy
617
618ifeq ($(ART_USE_READ_BARRIER),true)
619  ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
620    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
621        $(PREBUILD_TYPES),interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES), \
622        $(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
623        $(TEST_ART_BROKEN_INTERPRETER_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
624  endif
625
626  ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
627    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
628        $(PREBUILD_TYPES),$(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES), \
629        $(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
630        $(TEST_ART_BROKEN_OPTIMIZING_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
631    ifneq ($(ART_READ_BARRIER_TYPE),BAKER)
632      ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
633          $(PREBUILD_TYPES),$(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES), \
634          $(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
635          $(TEST_ART_BROKEN_OPTIMIZING_NON_BAKER_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
636    endif
637  endif
638
639  ifneq (,$(filter jit,$(COMPILER_TYPES)))
640    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
641        $(PREBUILD_TYPES),jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES), \
642        $(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
643        $(TEST_ART_BROKEN_JIT_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
644    ifneq ($(ART_READ_BARRIER_TYPE),BAKER)
645      ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
646          $(PREBUILD_TYPES),jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES), \
647          $(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
648          $(TEST_ART_BROKEN_JIT_NON_BAKER_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
649    endif
650  endif
651endif
652
653TEST_ART_BROKEN_OPTIMIZING_READ_BARRIER_RUN_TESTS :=
654TEST_ART_BROKEN_JIT_READ_BARRIER_RUN_TESTS :=
655
656TEST_ART_BROKEN_NPIC_RUN_TESTS := 596-app-images
657ifneq (,$(filter npictest,$(PICTEST_TYPES)))
658  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
659      ${COMPILER_TYPES},$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
660      $(IMAGE_TYPES),npictest,$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_NPIC_RUN_TESTS),$(ALL_ADDRESS_SIZES))
661endif
662
663# Tests that should fail in the heap poisoning configuration with the Optimizing compiler.
664# 055: Exceeds run time limits due to heap poisoning instrumentation (on ARM and ARM64 devices).
665TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS := \
666  055-enum-performance
667
668ifeq ($(ART_HEAP_POISONING),true)
669  ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
670    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
671        $(PREBUILD_TYPES),$(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
672        $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
673        $(TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
674  endif
675endif
676
677TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS :=
678
679# Tests incompatible with bisection bug search. Sorted by incompatibility reason.
680# 000 through 595 do not compile anything. 089 tests a build failure. 018 through 137
681# run dalvikvm more than once. 115 and 088 assume they are always compiled.
682# 055 tests performance which is degraded during bisecting.
683TEST_ART_INCOMPATIBLE_BISECTION_SEARCH_RUN_TESTS := \
684  000-nop \
685  134-nodex2oat-nofallback \
686  147-stripped-dex-fallback \
687  595-profile-saving \
688  \
689  089-many-methods \
690  \
691  018-stack-overflow \
692  116-nodex2oat \
693  117-nopatchoat \
694  118-noimage-dex2oat \
695  119-noimage-patchoat \
696  126-miranda-multidex \
697  137-cfi \
698  \
699  115-native-bridge \
700  088-monitor-verification \
701  \
702  055-enum-performance
703
704ifeq ($(ART_TEST_BISECTION),true)
705  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
706      $(PREBUILD_TYPES),$(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
707      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
708      $(TEST_ART_INCOMPATIBLE_BISECTION_SEARCH_RUN_TESTS),$(ALL_ADDRESS_SIZES))
709endif
710
711# Clear variables ahead of appending to them when defining tests.
712$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
713$(foreach target, $(TARGET_TYPES), \
714  $(foreach prebuild, $(PREBUILD_TYPES), \
715    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
716$(foreach target, $(TARGET_TYPES), \
717  $(foreach compiler, $(COMPILER_TYPES), \
718    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
719$(foreach target, $(TARGET_TYPES), \
720  $(foreach relocate, $(RELOCATE_TYPES), \
721    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
722$(foreach target, $(TARGET_TYPES), \
723  $(foreach trace, $(TRACE_TYPES), \
724    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
725$(foreach target, $(TARGET_TYPES), \
726  $(foreach gc, $(GC_TYPES), \
727    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
728$(foreach target, $(TARGET_TYPES), \
729  $(foreach jni, $(JNI_TYPES), \
730    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
731$(foreach target, $(TARGET_TYPES), \
732  $(foreach image, $(IMAGE_TYPES), \
733    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
734$(foreach target, $(TARGET_TYPES), \
735  $(foreach test, $(TEST_ART_RUN_TESTS), \
736    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
737$(foreach target, $(TARGET_TYPES), \
738  $(foreach address_size, $(ALL_ADDRESS_SIZES), \
739    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
740$(foreach target, $(TARGET_TYPES), \
741  $(foreach run_type, $(RUN_TYPES), \
742    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
743$(foreach target, $(TARGET_TYPES), \
744  $(foreach debuggable_type, $(DEBUGGABLE_TYPES), \
745    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable_type))_RULES :=)))
746
747# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
748# only once).
749TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
750
751# Also need libartagent.
752TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libartagent)
753TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libartagentd)
754ifdef TARGET_2ND_ARCH
755TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libartagent)
756TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libartagentd)
757endif
758
759# Also need libtiagent.
760TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtiagent)
761TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtiagentd)
762ifdef TARGET_2ND_ARCH
763TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtiagent)
764TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtiagentd)
765endif
766
767# Also need libarttest.
768TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libarttest)
769TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libarttestd)
770ifdef TARGET_2ND_ARCH
771TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libarttest)
772TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libarttestd)
773endif
774
775# Also need libnativebridgetest.
776TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libnativebridgetest)
777ifdef TARGET_2ND_ARCH
778TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libnativebridgetest)
779endif
780
781# All tests require the host executables. The tests also depend on the core images, but on
782# specific version depending on the compiler.
783ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
784  $(ART_HOST_EXECUTABLES) \
785  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagent) \
786  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagentd) \
787  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagent) \
788  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagentd) \
789  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttest) \
790  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttestd) \
791  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetest) \
792  $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
793  $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
794  $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION)
795
796ifneq ($(HOST_PREFER_32_BIT),true)
797ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
798  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagent) \
799  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagentd) \
800  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagent) \
801  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagentd) \
802  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttest) \
803  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttestd) \
804  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetest) \
805  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
806  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
807  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION)
808endif
809
810# Create a rule to build and run a tests following the form:
811# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
812#    {4: interpreter optimizing jit interp-ac}-
813#    {5: relocate nrelocate relocate-npatchoat}-
814#    {6: trace or ntrace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
815#    {9: no-image image picimage}-{10: pictest npictest}-
816#    {11: ndebuggable debuggable}-{12: test name}{13: 32 or 64}
817define define-test-art-run-test
818  run_test_options :=
819  prereq_rule :=
820  test_groups :=
821  uc_host_or_target :=
822  jack_classpath :=
823  ifeq ($(ART_TEST_WITH_STRACE),true)
824    run_test_options += --strace
825  endif
826  ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
827    run_test_options += --always-clean
828  endif
829  ifeq ($(ART_TEST_BISECTION),true)
830    run_test_options += --bisection-search
831  endif
832  ifeq ($(1),host)
833    uc_host_or_target := HOST
834    test_groups := ART_RUN_TEST_HOST_RULES
835    run_test_options += --host
836    prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) $(HOST_JACK_CLASSPATH_DEPENDENCIES)
837    jack_classpath := $(HOST_JACK_CLASSPATH)
838  else
839    ifeq ($(1),target)
840      uc_host_or_target := TARGET
841      test_groups := ART_RUN_TEST_TARGET_RULES
842      prereq_rule := test-art-target-sync $(TARGET_JACK_CLASSPATH_DEPENDENCIES)
843      jack_classpath := $(TARGET_JACK_CLASSPATH)
844    else
845      $$(error found $(1) expected $(TARGET_TYPES))
846    endif
847  endif
848  ifeq ($(2),debug)
849    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
850  else
851    ifeq ($(2),ndebug)
852      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
853      run_test_options += -O
854    else
855      $$(error found $(2) expected $(RUN_TYPES))
856    endif
857  endif
858  ifeq ($(3),prebuild)
859    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
860    run_test_options += --prebuild
861  else
862    ifeq ($(3),no-prebuild)
863      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
864      run_test_options += --no-prebuild
865    else
866      ifeq ($(3),no-dex2oat)
867        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
868        run_test_options += --no-prebuild --no-dex2oat
869      else
870        $$(error found $(3) expected $(PREBUILD_TYPES))
871      endif
872    endif
873  endif
874  ifeq ($(4),optimizing)
875    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
876    run_test_options += --optimizing
877  else ifeq ($(4),regalloc_gc)
878    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_GRAPH_COLOR_RULES
879    run_test_options += --optimizing -Xcompiler-option --register-allocation-strategy=graph-color
880  else
881    ifeq ($(4),interpreter)
882      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
883      run_test_options += --interpreter
884    else ifeq ($(4),interp-ac)
885      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_ACCESS_CHECKS_RULES
886      run_test_options += --interpreter --verify-soft-fail
887    else
888      ifeq ($(4),jit)
889        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JIT_RULES
890        run_test_options += --jit
891      else
892        $$(error found $(4) expected $(COMPILER_TYPES))
893      endif
894    endif
895  endif
896
897  ifeq ($(5),relocate)
898    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
899    run_test_options += --relocate
900  else
901    ifeq ($(5),no-relocate)
902      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
903      run_test_options += --no-relocate
904    else
905      ifeq ($(5),relocate-npatchoat)
906        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
907        run_test_options += --relocate --no-patchoat
908      else
909        $$(error found $(5) expected $(RELOCATE_TYPES))
910      endif
911    endif
912  endif
913  ifeq ($(6),trace)
914    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
915    run_test_options += --trace
916  else
917    ifeq ($(6),ntrace)
918      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
919    else
920      ifeq ($(6),stream)
921        # Group streaming under normal tracing rules.
922        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
923        run_test_options += --trace --stream
924      else
925        $$(error found $(6) expected $(TRACE_TYPES))
926      endif
927    endif
928  endif
929  ifeq ($(7),gcverify)
930    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
931    run_test_options += --gcverify
932  else
933    ifeq ($(7),gcstress)
934      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
935      run_test_options += --gcstress
936    else
937      ifeq ($(7),cms)
938        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
939      else
940        $$(error found $(7) expected $(GC_TYPES))
941      endif
942    endif
943  endif
944  ifeq ($(8),forcecopy)
945    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
946    run_test_options += --runtime-option -Xjniopts:forcecopy
947    ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
948      skip_test := true
949    endif
950  else
951    ifeq ($(8),checkjni)
952      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
953      run_test_options += --runtime-option -Xcheck:jni
954    else
955      ifeq ($(8),jni)
956        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
957      else
958        $$(error found $(8) expected $(JNI_TYPES))
959      endif
960    endif
961  endif
962  image_suffix := $(4)
963  ifeq ($(4),regalloc_gc)
964    # Graph coloring tests share the image_suffix with optimizing tests.
965    image_suffix := optimizing
966  else
967    ifeq ($(4),jit)
968      # JIT tests share the image_suffix with interpreter tests.
969      image_suffix := interpreter
970    endif
971  endif
972  ifeq ($(9),no-image)
973    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
974    run_test_options += --no-image
975    # Add the core dependency. This is required for pre-building.
976    ifeq ($(1),host)
977      prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
978    else
979      prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
980    endif
981  else
982    ifeq ($(9),npicimage)
983      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
984      run_test_options += --npic-image
985      # Add the core dependency.
986      ifeq ($(1),host)
987        prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
988      else
989        prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_$(13))
990      endif
991    else
992      ifeq ($(9),picimage)
993        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
994        ifeq ($(1),host)
995          prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_pic_$(13))
996        else
997          prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_pic_$(13))
998        endif
999      else
1000        ifeq ($(9),multinpicimage)
1001          test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
1002          run_test_options += --npic-image --multi-image
1003                ifeq ($(1),host)
1004                        prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_no-pic_multi_$(13))
1005                else
1006                        prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_no-pic_multi_$(13))
1007                endif
1008        else
1009          ifeq ($(9),multipicimage)
1010            test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
1011                        run_test_options += --multi-image
1012                        ifeq ($(1),host)
1013                        prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_pic_multi_$(13))
1014                        else
1015                        prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_pic_multi_$(13))
1016                        endif
1017          else
1018            $$(error found $(9) expected $(IMAGE_TYPES))
1019          endif
1020        endif
1021      endif
1022    endif
1023  endif
1024  ifeq ($(10),pictest)
1025    run_test_options += --pic-test
1026  else
1027    ifeq ($(10),npictest)
1028      # Nothing to be done.
1029    else
1030      $$(error found $(10) expected $(PICTEST_TYPES))
1031    endif
1032  endif
1033  ifeq ($(11),debuggable)
1034    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUGGABLE_RULES
1035    run_test_options += --debuggable
1036  else
1037    ifeq ($(11),ndebuggable)
1038    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NONDEBUGGABLE_RULES
1039      # Nothing to be done.
1040    else
1041      $$(error found $(11) expected $(DEBUGGABLE_TYPES))
1042    endif
1043  endif
1044  # $(12) is the test name.
1045  test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(12))_RULES
1046  ifeq ($(13),64)
1047    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
1048    run_test_options += --64
1049  else
1050    ifeq ($(13),32)
1051      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
1052    else
1053      $$(error found $(13) expected $(ALL_ADDRESS_SIZES))
1054    endif
1055  endif
1056  # Override of host instruction-set-features. Required to test advanced x86 intrinsics. The
1057  # conditionals aren't really correct, they will fail to do the right thing on a 32-bit only
1058  # host. However, this isn't common enough to worry here and make the conditions complicated.
1059  ifneq ($(DEX2OAT_HOST_INSTRUCTION_SET_FEATURES),)
1060    ifeq ($(13),64)
1061      run_test_options += --instruction-set-features $(DEX2OAT_HOST_INSTRUCTION_SET_FEATURES)
1062    endif
1063  endif
1064  ifneq ($($(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES),)
1065    ifeq ($(13),32)
1066      run_test_options += --instruction-set-features $($(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES)
1067    endif
1068  endif
1069  run_test_rule_name := test-art-$(1)-run-test-$(2)-$(3)-$(4)-$(5)-$(6)-$(7)-$(8)-$(9)-$(10)-$(11)-$(12)$(13)
1070  run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
1071      $$(run_test_options)
1072  ifneq ($(ART_TEST_ANDROID_ROOT),)
1073    run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
1074  endif
1075  ifeq ($(ART_TEST_QUIET),true)
1076    run_test_options += --quiet
1077  endif
1078$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
1079$$(run_test_rule_name): PRIVATE_JACK_CLASSPATH := $$(jack_classpath)
1080.PHONY: $$(run_test_rule_name)
1081$$(run_test_rule_name): $(TEST_ART_RUN_TEST_DEPENDENCIES) $(HOST_OUT_EXECUTABLES)/hprof-conv $$(prereq_rule) | $(TEST_ART_RUN_TEST_ORDERONLY_DEPENDENCIES)
1082	$(hide) $$(call ART_TEST_SKIP,$$@) && \
1083	  DX=$(abspath $(DX)) \
1084	    JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
1085	    SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
1086	    DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
1087	    JACK_VERSION=$(JACK_DEFAULT_VERSION) \
1088	    JACK=$(abspath $(JACK)) \
1089	    JACK_VERSION=$(JACK_DEFAULT_VERSION) \
1090	    JACK_CLASSPATH=$$(PRIVATE_JACK_CLASSPATH) \
1091	    art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(12) \
1092	      && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
1093	$$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
1094	  echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
1095	  rm -r $(ART_HOST_TEST_DIR)) || true
1096
1097  $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
1098
1099  # Clear locally defined variables.
1100  uc_host_or_target :=
1101  test_groups :=
1102  run_test_options :=
1103  run_test_rule_name :=
1104  prereq_rule :=
1105  jack_classpath :=
1106endef  # define-test-art-run-test
1107
1108$(foreach target, $(TARGET_TYPES), \
1109  $(foreach test, $(TEST_ART_RUN_TESTS), \
1110    $(foreach run_type, $(RUN_TYPES), \
1111      $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
1112        $(foreach prebuild, $(PREBUILD_TYPES), \
1113          $(foreach compiler, $(COMPILER_TYPES), \
1114            $(foreach relocate, $(RELOCATE_TYPES), \
1115              $(foreach trace, $(TRACE_TYPES), \
1116                $(foreach gc, $(GC_TYPES), \
1117                  $(foreach jni, $(JNI_TYPES), \
1118                    $(foreach image, $(IMAGE_TYPES), \
1119                      $(foreach pictest, $(PICTEST_TYPES), \
1120                        $(foreach debuggable, $(DEBUGGABLE_TYPES), \
1121                          $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(debuggable),$(test),$(address_size))) \
1122                  )))))))))))))
1123define-test-art-run-test :=
1124
1125# Define a phony rule whose purpose is to test its prerequisites.
1126# $(1): host or target
1127# $(2): list of prerequisites
1128define define-test-art-run-test-group
1129.PHONY: $(1)
1130$(1): $(2)
1131	$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
1132
1133endef  # define-test-art-run-test-group
1134
1135
1136$(foreach target, $(TARGET_TYPES), $(eval \
1137  $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
1138$(foreach target, $(TARGET_TYPES), \
1139  $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
1140    $(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)))))
1141$(foreach target, $(TARGET_TYPES), \
1142  $(foreach run-type, $(RUN_TYPES), $(eval \
1143    $(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)))))
1144$(foreach target, $(TARGET_TYPES), \
1145  $(foreach compiler, $(COMPILER_TYPES), $(eval \
1146    $(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)))))
1147$(foreach target, $(TARGET_TYPES), \
1148  $(foreach relocate, $(RELOCATE_TYPES), $(eval \
1149    $(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)))))
1150$(foreach target, $(TARGET_TYPES), \
1151  $(foreach trace, $(TRACE_TYPES), $(eval \
1152    $(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)))))
1153$(foreach target, $(TARGET_TYPES), \
1154  $(foreach gc, $(GC_TYPES), $(eval \
1155    $(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)))))
1156$(foreach target, $(TARGET_TYPES), \
1157  $(foreach jni, $(JNI_TYPES), $(eval \
1158    $(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)))))
1159$(foreach target, $(TARGET_TYPES), \
1160  $(foreach debuggable, $(DEBUGGABLE_TYPES), $(eval \
1161    $(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)))))
1162$(foreach target, $(TARGET_TYPES), \
1163  $(foreach image, $(IMAGE_TYPES), $(eval \
1164    $(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)))))
1165$(foreach target, $(TARGET_TYPES), \
1166  $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
1167    $(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)))))
1168$(foreach target, $(TARGET_TYPES), \
1169  $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
1170    $(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)))))
1171
1172# Clear variables now we're finished with them.
1173$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
1174$(foreach target, $(TARGET_TYPES), \
1175  $(foreach prebuild, $(PREBUILD_TYPES), \
1176    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
1177$(foreach target, $(TARGET_TYPES), \
1178  $(foreach compiler, $(COMPILER_TYPES), \
1179    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
1180$(foreach target, $(TARGET_TYPES), \
1181  $(foreach relocate, $(RELOCATE_TYPES), \
1182    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
1183$(foreach target, $(TARGET_TYPES), \
1184  $(foreach trace, $(TRACE_TYPES), \
1185    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
1186$(foreach target, $(TARGET_TYPES), \
1187  $(foreach gc, $(GC_TYPES), \
1188    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
1189$(foreach target, $(TARGET_TYPES), \
1190  $(foreach jni, $(JNI_TYPES), \
1191    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
1192$(foreach target, $(TARGET_TYPES), \
1193  $(foreach debuggable, $(DEBUGGABLE_TYPES), \
1194    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES :=)))
1195$(foreach target, $(TARGET_TYPES), \
1196  $(foreach image, $(IMAGE_TYPES), \
1197    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
1198$(foreach target, $(TARGET_TYPES), \
1199  $(foreach test, $(TEST_ART_RUN_TESTS), \
1200    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
1201$(foreach target, $(TARGET_TYPES), \
1202  $(foreach address_size, $(ALL_ADDRESS_SIZES), \
1203    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
1204$(foreach target, $(TARGET_TYPES), \
1205  $(foreach run_type, $(RUN_TYPES), \
1206    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
1207define-test-art-run-test-group :=
1208TARGET_TYPES :=
1209PREBUILD_TYPES :=
1210COMPILER_TYPES :=
1211RELOCATE_TYPES :=
1212TRACE_TYPES :=
1213GC_TYPES :=
1214JNI_TYPES :=
1215IMAGE_TYPES :=
1216ADDRESS_SIZES_TARGET :=
1217ADDRESS_SIZES_HOST :=
1218ALL_ADDRESS_SIZES :=
1219RUN_TYPES :=
1220DEBUGGABLE_TYPES :=
1221
1222LOCAL_PATH :=
1223