Android.run-test.mk revision 4f38e1805fb906c42697c30685008d00261e11b9
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 := no-relocate
140ifeq ($(ART_TEST_RUN_TEST_RELOCATE),true)
141  RELOCATE_TYPES += 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
164ifeq ($(ART_TEST_RUN_TEST_IMAGE),true)
165IMAGE_TYPES := picimage
166endif
167ifeq ($(ART_TEST_RUN_TEST_NO_IMAGE),true)
168  IMAGE_TYPES += no-image
169endif
170ifeq ($(ART_TEST_RUN_TEST_MULTI_IMAGE),true)
171  IMAGE_TYPES := multipicimage
172endif
173PICTEST_TYPES := npictest
174ifeq ($(ART_TEST_PIC_TEST),true)
175  PICTEST_TYPES += pictest
176endif
177RUN_TYPES :=
178ifeq ($(ART_TEST_RUN_TEST_DEBUG),true)
179  RUN_TYPES += debug
180endif
181ifeq ($(ART_TEST_RUN_TEST_NDEBUG),true)
182  RUN_TYPES += ndebug
183endif
184DEBUGGABLE_TYPES := ndebuggable
185ifeq ($(ART_TEST_RUN_TEST_DEBUGGABLE),true)
186DEBUGGABLE_TYPES += debuggable
187endif
188ADDRESS_SIZES_TARGET := $(ART_PHONY_TEST_TARGET_SUFFIX)
189ADDRESS_SIZES_HOST := $(ART_PHONY_TEST_HOST_SUFFIX)
190ifeq ($(ART_TEST_RUN_TEST_2ND_ARCH),true)
191  ADDRESS_SIZES_TARGET += $(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
192  ADDRESS_SIZES_HOST += $(2ND_ART_PHONY_TEST_HOST_SUFFIX)
193endif
194ALL_ADDRESS_SIZES := 64 32
195
196# List all run test names with number arguments agreeing with the comment above.
197define all-run-test-names
198  $(foreach target, $(1), \
199    $(foreach run-type, $(2), \
200      $(foreach prebuild, $(3), \
201        $(foreach compiler, $(4), \
202          $(foreach relocate, $(5), \
203            $(foreach trace, $(6), \
204              $(foreach gc, $(7), \
205                $(foreach jni, $(8), \
206                  $(foreach image, $(9), \
207                    $(foreach pictest, $(10), \
208                      $(foreach debuggable, $(11), \
209                        $(foreach test, $(12), \
210                          $(foreach address_size, $(13), \
211                            test-art-$(target)-run-test-$(run-type)-$(prebuild)-$(compiler)-$(relocate)-$(trace)-$(gc)-$(jni)-$(image)-$(pictest)-$(debuggable)-$(test)$(address_size) \
212                    )))))))))))))
213endef  # all-run-test-names
214
215# To generate a full list or tests:
216# $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
217#        $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
218#        $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_RUN_TESTS),$(ALL_ADDRESS_SIZES))
219
220# Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE
221define name-to-var
222$(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
223endef  # name-to-var
224
225# Disable 115-native-bridge, it fails when run through make b/35984597.
226# Disable 153-reference-stress temporarily until a fix arrives. b/33389022.
227# Disable 080-oom-fragmentation due to flakes. b/33795328
228# Disable 497-inlining-and-class-loader and 542-unresolved-access-check until
229#     they are rewritten. These tests use a broken class loader that tries to
230#     register a dex file that's already registered with a different loader.
231#     b/34193123
232ART_TEST_RUN_TEST_SKIP += \
233  115-native-bridge \
234  153-reference-stress \
235  080-oom-fragmentation \
236  497-inlining-and-class-loader \
237  542-unresolved-access-check
238
239ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
240        $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
241        $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(ART_TEST_RUN_TEST_SKIP), $(ALL_ADDRESS_SIZES))
242
243
244# Disable 149-suspend-all-stress, its output is flaky (b/28988206).
245TEST_ART_BROKEN_ALL_TARGET_TESTS := \
246  149-suspend-all-stress \
247
248ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
249    $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
250    $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_ALL_TARGET_TESTS), \
251    $(ALL_ADDRESS_SIZES))
252
253TEST_ART_BROKEN_ALL_TARGET_TESTS :=
254
255# Tests that are timing sensitive and flaky on heavily loaded systems.
256TEST_ART_TIMING_SENSITIVE_RUN_TESTS := \
257  002-sleep \
258  053-wait-some \
259  055-enum-performance \
260  133-static-invoke-super
261
262# disable timing sensitive tests on "dist" builds.
263ifdef dist_goal
264  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
265        $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
266        $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_TIMING_SENSITIVE_RUN_TESTS), $(ALL_ADDRESS_SIZES))
267endif
268
269# 147-stripped-dex-fallback isn't supported on device because --strip-dex
270# requires the zip command.
271# 569-checker-pattern-replacement tests behaviour present only on host.
272TEST_ART_BROKEN_TARGET_TESTS := \
273  147-stripped-dex-fallback \
274  569-checker-pattern-replacement
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
355# 629 requires compilation.
356TEST_ART_BROKEN_INTERPRETER_ACCESS_CHECK_TESTS := \
357  137-cfi \
358  629-vdex-speed
359
360ifneq (,$(filter interp-ac,$(COMPILER_TYPES)))
361  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
362      interp-ac,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
363      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_INTERPRETER_ACCESS_CHECK_TESTS), $(ALL_ADDRESS_SIZES))
364endif
365
366TEST_ART_BROKEN_INTERPRETER_ACCESS_CHECK_TESTS :=
367
368# Tests that are broken with GC stress.
369# * 137-cfi needs to unwind a second forked process. We're using a primitive sleep to wait till we
370#   hope the second process got into the expected state. The slowness of gcstress makes this bad.
371# * 152-dead-large-object requires a heap larger than what gcstress uses.
372# * 908-gc-start-finish expects GCs only to be run at clear points. The reduced heap size makes
373#   this non-deterministic. Same for 913.
374# * 961-default-iface-resolution-gen and 964-default-iface-init-genare very long tests that often
375#   will take more than the timeout to run when gcstress is enabled. This is because gcstress
376#   slows down allocations significantly which these tests do a lot.
377# * 946-obsolete-throw: b/36335999.
378TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := \
379  137-cfi \
380  152-dead-large-object \
381  154-gc-loop \
382  908-gc-start-finish \
383  913-heaps \
384  961-default-iface-resolution-gen \
385  964-default-iface-init-gen \
386  946-obsolete-throw
387
388ifneq (,$(filter gcstress,$(GC_TYPES)))
389  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
390      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),gcstress,$(JNI_TYPES), \
391      $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(ALL_ADDRESS_SIZES))
392endif
393
394TEST_ART_BROKEN_GCSTRESS_RUN_TESTS :=
395
396# 115-native-bridge setup is complicated. Need to implement it correctly for the target.
397ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES),$(COMPILER_TYPES), \
398    $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), 115-native-bridge, \
399    $(ALL_ADDRESS_SIZES))
400
401# 130-hprof dumps the heap and runs hprof-conv to check whether the file is somewhat readable. This
402# is only possible on the host.
403# TODO: Turn off all the other combinations, this is more about testing actual ART code. A gtest is
404#       very hard to write here, as (for a complete test) JDWP must be set up.
405ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
406    $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
407    $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),130-hprof,$(ALL_ADDRESS_SIZES))
408
409# 131 is an old test. The functionality has been implemented at an earlier stage and is checked
410# in tests 138. Blacklisted for debug builds since these builds have duplicate classes checks which
411# punt to interpreter.
412ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),debug,$(PREBUILD_TYPES), \
413    $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
414    $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),131-structural-change,$(ALL_ADDRESS_SIZES))
415
416# 138-duplicate-classes-check. Turned on for debug builds since debug builds have duplicate classes
417# checks enabled, b/2133391.
418ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
419    $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
420    $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),138-duplicate-classes-check,$(ALL_ADDRESS_SIZES))
421
422# All these tests check that we have sane behavior if we don't have a patchoat or dex2oat.
423# Therefore we shouldn't run them in situations where we actually don't have these since they
424# explicitly test for them. These all also assume we have an image.
425# 147-stripped-dex-fallback is disabled because it requires --prebuild.
426# 554-jit-profile-file is disabled because it needs a primary oat file to know what it should save.
427# 629-vdex-speed requires compiled code.
428TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
429  116-nodex2oat \
430  117-nopatchoat \
431  118-noimage-dex2oat \
432  119-noimage-patchoat \
433  137-cfi \
434  138-duplicate-classes-check2 \
435  147-stripped-dex-fallback \
436  554-jit-profile-file \
437  616-cha \
438  616-cha-abstract \
439  912-classes \
440  629-vdex-speed
441
442# This test fails without an image.
443# 018, 961, 964, 968 often time out. b/34369284
444TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS := \
445  137-cfi \
446  138-duplicate-classes-check \
447  018-stack-overflow \
448  476-clinit-inline-static-invoke \
449  496-checker-inlining-class-loader \
450  637-checker-throw-inline \
451  616-cha \
452  616-cha-abstract \
453  912-classes \
454  961-default-iface-resolution-gen \
455  964-default-iface-init \
456  968-default-partial-compile-gen \
457
458ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
459  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \
460      $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
461      $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
462endif
463
464
465ifneq (,$(filter no-image,$(IMAGE_TYPES)))
466  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
467      $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
468      $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
469  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
470      $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),no-image, \
471      $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
472endif
473
474ifneq (,$(filter relocate-npatchoat,$(RELOCATE_TYPES)))
475  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
476      $(COMPILER_TYPES), relocate-npatchoat,$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
477      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_FALLBACK_RUN_TESTS),$(ALL_ADDRESS_SIZES))
478endif
479
480TEST_ART_BROKEN_FALLBACK_RUN_TESTS :=
481
482# 137:
483# This test unrolls and expects managed frames, but tracing means we run the interpreter.
484# 802 and 570-checker-osr:
485# This test dynamically enables tracing to force a deoptimization. This makes the test meaningless
486# when already tracing, and writes an error message that we do not want to check for.
487# 130 occasional timeout b/32383962.
488# 629 requires compilation.
489TEST_ART_BROKEN_TRACING_RUN_TESTS := \
490  087-gc-after-link \
491  130-hprof \
492  137-cfi \
493  141-class-unload \
494  570-checker-osr \
495  629-vdex-speed \
496  802-deoptimization
497
498ifneq (,$(filter trace stream,$(TRACE_TYPES)))
499  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
500      $(COMPILER_TYPES),$(RELOCATE_TYPES),trace stream,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
501      $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
502endif
503
504TEST_ART_BROKEN_TRACING_RUN_TESTS :=
505
506# These tests expect JIT compilation, which is suppressed when tracing.
507TEST_ART_BROKEN_JIT_TRACING_RUN_TESTS := \
508  604-hot-static-interface \
509  612-jit-dex-cache \
510  613-inlining-dex-cache \
511  616-cha \
512  626-set-resolved-string \
513
514ifneq (,$(filter trace stream,$(TRACE_TYPES)))
515  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
516      jit,$(RELOCATE_TYPES),trace stream,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
517      $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_JIT_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
518endif
519
520TEST_ART_BROKEN_JIT_TRACING_RUN_TESTS :=
521
522# Known broken tests for the interpreter.
523# CFI unwinding expects managed frames.
524# 629 requires compilation.
525TEST_ART_BROKEN_INTERPRETER_RUN_TESTS := \
526  137-cfi \
527  554-jit-profile-file \
528  629-vdex-speed
529
530ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
531  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
532      interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
533      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_INTERPRETER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
534endif
535
536TEST_ART_BROKEN_INTERPRETER_RUN_TESTS :=
537
538# Known broken tests for the JIT.
539# CFI unwinding expects managed frames, and the test does not iterate enough to even compile. JIT
540# also uses Generic JNI instead of the JNI compiler.
541# 154-gc-loop requires more deterministic GC behavior than what JIT does.
542# Test 906 iterates the heap filtering with different options. No instances should be created
543# between those runs to be able to have precise checks.
544# Test 629 requires compilation.
545# 912: b/34655682
546TEST_ART_BROKEN_JIT_RUN_TESTS := \
547  137-cfi \
548  154-gc-loop \
549  629-vdex-speed \
550  904-object-allocation \
551  906-iterate-heap \
552
553ifneq (,$(filter jit,$(COMPILER_TYPES)))
554  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
555      jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
556      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_JIT_RUN_TESTS),$(ALL_ADDRESS_SIZES))
557endif
558
559TEST_ART_BROKEN_JIT_RUN_TESTS :=
560
561# Known broken tests for the graph coloring register allocator.
562# These tests were based on the linear scan allocator, which makes different decisions than
563# the graph coloring allocator. (These attempt to test for code quality, not correctness.)
564TEST_ART_BROKEN_OPTIMIZING_GRAPH_COLOR := \
565  570-checker-select \
566  484-checker-register-hints
567
568ifneq (,$(filter regalloc_gc,$(COMPILER_TYPES)))
569  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
570      regalloc_gc,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
571      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
572      $(TEST_ART_BROKEN_OPTIMIZING_GRAPH_COLOR),$(ALL_ADDRESS_SIZES))
573endif
574
575# Known broken tests for the mips32 optimizing compiler backend.
576TEST_ART_BROKEN_OPTIMIZING_MIPS_RUN_TESTS := \
577
578ifeq (mips,$(TARGET_ARCH))
579  ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
580    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
581        $(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
582        $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
583        $(TEST_ART_BROKEN_OPTIMIZING_MIPS_RUN_TESTS),$(ALL_ADDRESS_SIZES))
584  endif
585endif
586
587TEST_ART_BROKEN_OPTIMIZING_MIPS_RUN_TESTS :=
588
589# Known broken tests for the mips64 optimizing compiler backend.
590TEST_ART_BROKEN_OPTIMIZING_MIPS64_RUN_TESTS := \
591
592ifeq (mips64,$(TARGET_ARCH))
593  ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
594    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
595        $(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
596        $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
597        $(TEST_ART_BROKEN_OPTIMIZING_MIPS64_RUN_TESTS),$(ALL_ADDRESS_SIZES))
598  endif
599endif
600
601TEST_ART_BROKEN_OPTIMIZING_MIPS64_RUN_TESTS :=
602
603# Tests that should fail when the optimizing compiler compiles them non-debuggable.
604TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS := \
605  454-get-vreg \
606  457-regs \
607  602-deoptimizeable
608
609ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
610  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
611      $(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
612      $(IMAGE_TYPES),$(PICTEST_TYPES),ndebuggable,$(TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
613endif
614
615TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
616
617# Tests that should fail when the optimizing compiler compiles them debuggable.
618TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS := \
619
620ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
621  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
622      $(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
623      $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
624endif
625
626TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
627
628# Tests that should fail in the read barrier configuration with the interpreter.
629TEST_ART_BROKEN_INTERPRETER_READ_BARRIER_RUN_TESTS :=
630
631# Tests that should fail in the read barrier configuration with the Optimizing compiler (AOT).
632TEST_ART_BROKEN_OPTIMIZING_READ_BARRIER_RUN_TESTS :=
633
634# Tests that should fail in the read barrier configuration with JIT (Optimizing compiler).
635TEST_ART_BROKEN_JIT_READ_BARRIER_RUN_TESTS :=
636
637# Tests failing in non-Baker read barrier configurations with the Optimizing compiler (AOT).
638# 537 and 641: Expect an array copy to be intrinsified, but calling-on-slowpath intrinsics are not yet
639#      handled in non-Baker read barrier configurations.
640TEST_ART_BROKEN_OPTIMIZING_NON_BAKER_READ_BARRIER_RUN_TESTS := \
641  537-checker-arraycopy \
642  641-checker-arraycopy
643
644# Tests failing in non-Baker read barrier configurations with JIT (Optimizing compiler).
645# 537 and 641: Expect an array copy to be intrinsified, but calling-on-slowpath intrinsics are not yet
646#      handled in non-Baker read barrier configurations.
647TEST_ART_BROKEN_JIT_NON_BAKER_READ_BARRIER_RUN_TESTS := \
648  537-checker-arraycopy \
649  641-checker-arraycopy
650
651ifeq ($(ART_USE_READ_BARRIER),true)
652  ifneq (,$(filter interpreter,$(COMPILER_TYPES)))
653    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
654        $(PREBUILD_TYPES),interpreter,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES), \
655        $(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
656        $(TEST_ART_BROKEN_INTERPRETER_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
657  endif
658
659  ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
660    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
661        $(PREBUILD_TYPES),$(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES), \
662        $(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
663        $(TEST_ART_BROKEN_OPTIMIZING_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
664    ifneq ($(ART_READ_BARRIER_TYPE),BAKER)
665      ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
666          $(PREBUILD_TYPES),$(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES), \
667          $(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
668          $(TEST_ART_BROKEN_OPTIMIZING_NON_BAKER_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
669    endif
670  endif
671
672  ifneq (,$(filter jit,$(COMPILER_TYPES)))
673    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
674        $(PREBUILD_TYPES),jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES), \
675        $(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
676        $(TEST_ART_BROKEN_JIT_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
677    ifneq ($(ART_READ_BARRIER_TYPE),BAKER)
678      ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
679          $(PREBUILD_TYPES),jit,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES), \
680          $(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
681          $(TEST_ART_BROKEN_JIT_NON_BAKER_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
682    endif
683  endif
684endif
685
686TEST_ART_BROKEN_OPTIMIZING_READ_BARRIER_RUN_TESTS :=
687TEST_ART_BROKEN_JIT_READ_BARRIER_RUN_TESTS :=
688
689TEST_ART_BROKEN_NPIC_RUN_TESTS := 596-app-images
690ifneq (,$(filter npictest,$(PICTEST_TYPES)))
691  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
692      ${COMPILER_TYPES},$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
693      $(IMAGE_TYPES),npictest,$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_NPIC_RUN_TESTS),$(ALL_ADDRESS_SIZES))
694endif
695
696# Tests that should fail in the heap poisoning configuration with the Optimizing compiler.
697# 055: Exceeds run time limits due to heap poisoning instrumentation (on ARM and ARM64 devices).
698TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS := \
699  055-enum-performance
700
701ifeq ($(ART_HEAP_POISONING),true)
702  ifneq (,$(filter $(OPTIMIZING_COMPILER_TYPES),$(COMPILER_TYPES)))
703    ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
704        $(PREBUILD_TYPES),$(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
705        $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
706        $(TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS),$(ALL_ADDRESS_SIZES))
707  endif
708endif
709
710TEST_ART_BROKEN_OPTIMIZING_HEAP_POISONING_RUN_TESTS :=
711
712# 909: Tests that check semantics for a non-debuggable app.
713# 137: relies on AOT code and debuggable makes us JIT always.
714TEST_ART_BROKEN_DEBUGGABLE_RUN_TESTS := \
715  137-cfi \
716  909-attach-agent \
717
718ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
719    $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
720    $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
721
722TEST_ART_BROKEN_DEBUGGABLE_RUN_TESTS :=
723
724# Tests incompatible with bisection bug search. Sorted by incompatibility reason.
725# 000 through 595 do not compile anything. 089 tests a build failure. 018 through 137
726# run dalvikvm more than once. 115 and 088 assume they are always compiled.
727# 055 tests performance which is degraded during bisecting.
728TEST_ART_INCOMPATIBLE_BISECTION_SEARCH_RUN_TESTS := \
729  000-nop \
730  134-nodex2oat-nofallback \
731  147-stripped-dex-fallback \
732  595-profile-saving \
733  \
734  089-many-methods \
735  \
736  018-stack-overflow \
737  116-nodex2oat \
738  117-nopatchoat \
739  118-noimage-dex2oat \
740  119-noimage-patchoat \
741  126-miranda-multidex \
742  137-cfi \
743  \
744  115-native-bridge \
745  088-monitor-verification \
746  \
747  055-enum-performance
748
749ifeq ($(ART_TEST_BISECTION),true)
750  ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
751      $(PREBUILD_TYPES),$(OPTIMIZING_COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
752      $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
753      $(TEST_ART_INCOMPATIBLE_BISECTION_SEARCH_RUN_TESTS),$(ALL_ADDRESS_SIZES))
754endif
755
756# Clear variables ahead of appending to them when defining tests.
757$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
758$(foreach target, $(TARGET_TYPES), \
759  $(foreach prebuild, $(PREBUILD_TYPES), \
760    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
761$(foreach target, $(TARGET_TYPES), \
762  $(foreach compiler, $(COMPILER_TYPES), \
763    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
764$(foreach target, $(TARGET_TYPES), \
765  $(foreach relocate, $(RELOCATE_TYPES), \
766    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
767$(foreach target, $(TARGET_TYPES), \
768  $(foreach trace, $(TRACE_TYPES), \
769    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
770$(foreach target, $(TARGET_TYPES), \
771  $(foreach gc, $(GC_TYPES), \
772    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
773$(foreach target, $(TARGET_TYPES), \
774  $(foreach jni, $(JNI_TYPES), \
775    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
776$(foreach target, $(TARGET_TYPES), \
777  $(foreach image, $(IMAGE_TYPES), \
778    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
779$(foreach target, $(TARGET_TYPES), \
780  $(foreach test, $(TEST_ART_RUN_TESTS), \
781    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
782$(foreach target, $(TARGET_TYPES), \
783  $(foreach address_size, $(ALL_ADDRESS_SIZES), \
784    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
785$(foreach target, $(TARGET_TYPES), \
786  $(foreach run_type, $(RUN_TYPES), \
787    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
788$(foreach target, $(TARGET_TYPES), \
789  $(foreach debuggable_type, $(DEBUGGABLE_TYPES), \
790    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable_type))_RULES :=)))
791
792# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
793# only once).
794TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
795
796# Also need libartagent.
797TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libartagent)
798TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libartagentd)
799ifdef TARGET_2ND_ARCH
800TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libartagent)
801TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libartagentd)
802endif
803
804# Also need libtiagent.
805TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtiagent)
806TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtiagentd)
807ifdef TARGET_2ND_ARCH
808TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtiagent)
809TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtiagentd)
810endif
811
812# Also need libarttest.
813TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libarttest)
814TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libarttestd)
815ifdef TARGET_2ND_ARCH
816TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libarttest)
817TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libarttestd)
818endif
819
820# Also need libnativebridgetest.
821TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libnativebridgetest)
822ifdef TARGET_2ND_ARCH
823TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libnativebridgetest)
824endif
825
826# Also need libopenjdkjvmti.
827TEST_ART_TARGET_SYNC_DEPS += libopenjdkjvmti
828TEST_ART_TARGET_SYNC_DEPS += libopenjdkjvmtid
829
830TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar
831TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar
832TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/okhttp-testdex.jar
833TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/bouncycastle-testdex.jar
834TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/conscrypt-testdex.jar
835
836# All tests require the host executables. The tests also depend on the core images, but on
837# specific version depending on the compiler.
838ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
839  $(ART_HOST_EXECUTABLES) \
840  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagent) \
841  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagentd) \
842  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagent) \
843  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagentd) \
844  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttest) \
845  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttestd) \
846  $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetest) \
847  $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
848  $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
849  $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \
850  $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \
851  $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \
852
853ifneq ($(HOST_PREFER_32_BIT),true)
854ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
855  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagent) \
856  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagentd) \
857  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagent) \
858  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagentd) \
859  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttest) \
860  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttestd) \
861  $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetest) \
862  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
863  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
864  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \
865  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \
866  $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \
867
868endif
869
870# Host executables.
871host_prereq_rules := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
872
873# Classpath for Jack compilation for host.
874host_prereq_rules += $(HOST_JACK_CLASSPATH_DEPENDENCIES)
875
876# Required for dx, jasmin, smali, dexmerger, jack.
877host_prereq_rules += $(TEST_ART_RUN_TEST_DEPENDENCIES)
878
879host_prereq_rules += $(HOST_OUT_EXECUTABLES)/hprof-conv
880
881# Classpath for Jack compilation for target.
882target_prereq_rules := $(TARGET_JACK_CLASSPATH_DEPENDENCIES)
883
884# Sync test files to the target, depends upon all things that must be pushed
885#to the target.
886target_prereq_rules += test-art-target-sync
887
888define core-image-dependencies
889  image_suffix := $(3)
890  ifeq ($(3),regalloc_gc)
891    image_suffix:=optimizing
892  else
893    ifeq ($(3),jit)
894      image_suffix:=interpreter
895    endif
896  endif
897  ifeq ($(2),no-image)
898    $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_$(4))
899  else
900    ifeq ($(2),picimage)
901      $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_$(4))
902    else
903      ifeq ($(2),multipicimage)
904        $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_multi_$(4))
905      endif
906    endif
907  endif
908endef
909
910COMPILER_TYPES_2 := optimizing
911COMPILER_TYPES_2 += interpreter
912COMPILER_TYPES_2 += jit
913COMPILER_TYPES_2 += regalloc_gc
914COMPILER_TYPES_2 += interp-ac
915ALL_ADDRESS_SIZES_2 := 32 64
916IMAGE_TYPES_2 := picimage
917IMAGE_TYPES_2 += no-image
918IMAGE_TYPES_2 += npicimage
919IMAGE_TYPES_2 += multinpicimage
920IMAGE_TYPES_2 += multipicimage
921
922# Add core image dependencies required for given target - HOST or TARGET,
923# IMAGE_TYPE, COMPILER_TYPE and ADDRESS_SIZE to the prereq_rules.
924$(foreach target, $(TARGET_TYPES), \
925  $(foreach image, $(IMAGE_TYPES_2), \
926    $(foreach compiler, $(COMPILER_TYPES_2), \
927      $(foreach address_size, $(ALL_ADDRESS_SIZES_2), $(eval \
928        $(call core-image-dependencies,$(target),$(image),$(compiler),$(address_size)))))))
929
930test-art-host-run-test-dependencies : $(host_prereq_rules)
931test-art-target-run-test-dependencies : $(target_prereq_rules)
932test-art-run-test-dependencies : test-art-host-run-test-dependencies test-art-target-run-test-dependencies
933
934host_prereq_rules :=
935target_prereq_rules :=
936
937# Create a rule to build and run a tests following the form:
938# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
939#    {4: interpreter optimizing jit interp-ac}-
940#    {5: relocate nrelocate relocate-npatchoat}-
941#    {6: trace or ntrace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
942#    {9: no-image image picimage}-{10: pictest npictest}-
943#    {11: ndebuggable debuggable}-{12: test name}{13: 32 or 64}
944define define-test-art-run-test
945  run_test_options :=
946  prereq_rule :=
947  test_groups :=
948  uc_host_or_target :=
949  jack_classpath :=
950  ifeq ($(ART_TEST_WITH_STRACE),true)
951    run_test_options += --strace
952  endif
953  ifeq ($(ART_TEST_RUN_TEST_ALWAYS_CLEAN),true)
954    run_test_options += --always-clean
955  endif
956  ifeq ($(ART_TEST_BISECTION),true)
957    run_test_options += --bisection-search
958  endif
959  ifeq ($(1),host)
960    uc_host_or_target := HOST
961    test_groups := ART_RUN_TEST_HOST_RULES
962    run_test_options += --host
963    prereq_rule := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) $(HOST_JACK_CLASSPATH_DEPENDENCIES)
964    jack_classpath := $(HOST_JACK_CLASSPATH)
965  else
966    ifeq ($(1),target)
967      uc_host_or_target := TARGET
968      test_groups := ART_RUN_TEST_TARGET_RULES
969      prereq_rule := test-art-target-sync $(TARGET_JACK_CLASSPATH_DEPENDENCIES)
970      jack_classpath := $(TARGET_JACK_CLASSPATH)
971    else
972      $$(error found $(1) expected $(TARGET_TYPES))
973    endif
974  endif
975  ifeq ($(2),debug)
976    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUG_RULES
977  else
978    ifeq ($(2),ndebug)
979      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELEASE_RULES
980      run_test_options += -O
981    else
982      $$(error found $(2) expected $(RUN_TYPES))
983    endif
984  endif
985  ifeq ($(3),prebuild)
986    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PREBUILD_RULES
987    run_test_options += --prebuild
988  else
989    ifeq ($(3),no-prebuild)
990      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_PREBUILD_RULES
991      run_test_options += --no-prebuild
992    else
993      ifeq ($(3),no-dex2oat)
994        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_DEX2OAT_RULES
995        run_test_options += --no-prebuild --no-dex2oat
996      else
997        $$(error found $(3) expected $(PREBUILD_TYPES))
998      endif
999    endif
1000  endif
1001  ifeq ($(4),optimizing)
1002    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_RULES
1003    run_test_options += --optimizing
1004  else ifeq ($(4),regalloc_gc)
1005    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_OPTIMIZING_GRAPH_COLOR_RULES
1006    run_test_options += --optimizing -Xcompiler-option --register-allocation-strategy=graph-color
1007  else
1008    ifeq ($(4),interpreter)
1009      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
1010      run_test_options += --interpreter
1011    else ifeq ($(4),interp-ac)
1012      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_ACCESS_CHECKS_RULES
1013      run_test_options += --interpreter --verify-soft-fail
1014    else
1015      ifeq ($(4),jit)
1016        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JIT_RULES
1017        run_test_options += --jit
1018      else
1019        $$(error found $(4) expected $(COMPILER_TYPES))
1020      endif
1021    endif
1022  endif
1023
1024  ifeq ($(5),relocate)
1025    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_RULES
1026    run_test_options += --relocate
1027  else
1028    ifeq ($(5),no-relocate)
1029      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_RELOCATE_RULES
1030      run_test_options += --no-relocate
1031    else
1032      ifeq ($(5),relocate-npatchoat)
1033        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_RELOCATE_NO_PATCHOAT_RULES
1034        run_test_options += --relocate --no-patchoat
1035      else
1036        $$(error found $(5) expected $(RELOCATE_TYPES))
1037      endif
1038    endif
1039  endif
1040  ifeq ($(6),trace)
1041    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
1042    run_test_options += --trace
1043  else
1044    ifeq ($(6),ntrace)
1045      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES
1046    else
1047      ifeq ($(6),stream)
1048        # Group streaming under normal tracing rules.
1049        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES
1050        run_test_options += --trace --stream
1051      else
1052        $$(error found $(6) expected $(TRACE_TYPES))
1053      endif
1054    endif
1055  endif
1056  ifeq ($(7),gcverify)
1057    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCVERIFY_RULES
1058    run_test_options += --gcverify
1059  else
1060    ifeq ($(7),gcstress)
1061      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_GCSTRESS_RULES
1062      run_test_options += --gcstress
1063    else
1064      ifeq ($(7),cms)
1065        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CMS_RULES
1066      else
1067        $$(error found $(7) expected $(GC_TYPES))
1068      endif
1069    endif
1070  endif
1071  ifeq ($(8),forcecopy)
1072    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_FORCECOPY_RULES
1073    run_test_options += --runtime-option -Xjniopts:forcecopy
1074    ifneq ($$(ART_TEST_JNI_FORCECOPY),true)
1075      skip_test := true
1076    endif
1077  else
1078    ifeq ($(8),checkjni)
1079      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_CHECKJNI_RULES
1080      run_test_options += --runtime-option -Xcheck:jni
1081    else
1082      ifeq ($(8),jni)
1083        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_JNI_RULES
1084      else
1085        $$(error found $(8) expected $(JNI_TYPES))
1086      endif
1087    endif
1088  endif
1089  image_suffix := $(4)
1090  ifeq ($(4),regalloc_gc)
1091    # Graph coloring tests share the image_suffix with optimizing tests.
1092    image_suffix := optimizing
1093  else
1094    ifeq ($(4),jit)
1095      # JIT tests share the image_suffix with interpreter tests.
1096      image_suffix := interpreter
1097    endif
1098  endif
1099  ifeq ($(9),no-image)
1100    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
1101    run_test_options += --no-image
1102    # Add the core dependency. This is required for pre-building.
1103    # Use the PIC image, as it is the default in run-test, to match dependencies.
1104    ifeq ($(1),host)
1105      prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_$(13))
1106    else
1107      prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_$(13))
1108    endif
1109  else
1110    ifeq ($(9),picimage)
1111      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
1112      ifeq ($(1),host)
1113        prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_$(13))
1114      else
1115        prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_$(13))
1116      endif
1117    else
1118      ifeq ($(9),multipicimage)
1119        test_groups += ART_RUN_TEST_$$(uc_host_or_target)_PICIMAGE_RULES
1120        run_test_options += --multi-image
1121        ifeq ($(1),host)
1122          prereq_rule += $$(HOST_CORE_IMAGE_$$(image_suffix)_multi_$(13))
1123        else
1124          prereq_rule += $$(TARGET_CORE_IMAGE_$$(image_suffix)_multi_$(13))
1125        endif
1126      else
1127        $$(error found $(9) expected $(IMAGE_TYPES))
1128      endif
1129    endif
1130  endif
1131  ifeq ($(10),pictest)
1132    run_test_options += --pic-test
1133  else
1134    ifeq ($(10),npictest)
1135      # Nothing to be done.
1136    else
1137      $$(error found $(10) expected $(PICTEST_TYPES))
1138    endif
1139  endif
1140  ifeq ($(11),debuggable)
1141    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_DEBUGGABLE_RULES
1142    run_test_options += --debuggable
1143  else
1144    ifeq ($(11),ndebuggable)
1145    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NONDEBUGGABLE_RULES
1146      # Nothing to be done.
1147    else
1148      $$(error found $(11) expected $(DEBUGGABLE_TYPES))
1149    endif
1150  endif
1151  # $(12) is the test name.
1152  test_groups += ART_RUN_TEST_$$(uc_host_or_target)_$(call name-to-var,$(12))_RULES
1153  ifeq ($(13),64)
1154    test_groups += ART_RUN_TEST_$$(uc_host_or_target)_64_RULES
1155    run_test_options += --64
1156  else
1157    ifeq ($(13),32)
1158      test_groups += ART_RUN_TEST_$$(uc_host_or_target)_32_RULES
1159    else
1160      $$(error found $(13) expected $(ALL_ADDRESS_SIZES))
1161    endif
1162  endif
1163  # Override of host instruction-set-features. Required to test advanced x86 intrinsics. The
1164  # conditionals aren't really correct, they will fail to do the right thing on a 32-bit only
1165  # host. However, this isn't common enough to worry here and make the conditions complicated.
1166  ifneq ($(DEX2OAT_HOST_INSTRUCTION_SET_FEATURES),)
1167    ifeq ($(13),64)
1168      run_test_options += --instruction-set-features $(DEX2OAT_HOST_INSTRUCTION_SET_FEATURES)
1169    endif
1170  endif
1171  ifneq ($($(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES),)
1172    ifeq ($(13),32)
1173      run_test_options += --instruction-set-features $($(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES)
1174    endif
1175  endif
1176  run_test_rule_name := test-art-$(1)-run-test-$(2)-$(3)-$(4)-$(5)-$(6)-$(7)-$(8)-$(9)-$(10)-$(11)-$(12)$(13)
1177  run_test_options := --output-path $(ART_HOST_TEST_DIR)/run-test-output/$$(run_test_rule_name) \
1178      $$(run_test_options)
1179  ifneq ($(ART_TEST_ANDROID_ROOT),)
1180    run_test_options := --android-root $(ART_TEST_ANDROID_ROOT) $$(run_test_options)
1181  endif
1182  ifeq ($(ART_TEST_QUIET),true)
1183    run_test_options += --quiet
1184  endif
1185$$(run_test_rule_name): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options)
1186$$(run_test_rule_name): PRIVATE_JACK_CLASSPATH := $$(jack_classpath)
1187.PHONY: $$(run_test_rule_name)
1188$$(run_test_rule_name): $(TEST_ART_RUN_TEST_DEPENDENCIES) $(HOST_OUT_EXECUTABLES)/hprof-conv $$(prereq_rule) | $(TEST_ART_RUN_TEST_ORDERONLY_DEPENDENCIES)
1189	$(hide) $$(call ART_TEST_SKIP,$$@) && \
1190	  DX=$(abspath $(DX)) \
1191	    JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \
1192	    SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \
1193	    DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \
1194	    JACK_VERSION=$(JACK_DEFAULT_VERSION) \
1195	    JACK=$(abspath $(JACK)) \
1196	    JACK_VERSION=$(JACK_DEFAULT_VERSION) \
1197	    JACK_CLASSPATH=$$(PRIVATE_JACK_CLASSPATH) \
1198	    art/test/run-test $$(PRIVATE_RUN_TEST_OPTIONS) $(12) \
1199	      && $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
1200	$$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \
1201	  echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \
1202	  rm -r $(ART_HOST_TEST_DIR)) || true
1203
1204  $$(foreach test_group,$$(test_groups), $$(eval $$(value test_group) += $$(run_test_rule_name)))
1205
1206  # Clear locally defined variables.
1207  uc_host_or_target :=
1208  test_groups :=
1209  run_test_options :=
1210  run_test_rule_name :=
1211  prereq_rule :=
1212  jack_classpath :=
1213endef  # define-test-art-run-test
1214
1215$(foreach target, $(TARGET_TYPES), \
1216  $(foreach test, $(TEST_ART_RUN_TESTS), \
1217    $(foreach run_type, $(RUN_TYPES), \
1218      $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), \
1219        $(foreach prebuild, $(PREBUILD_TYPES), \
1220          $(foreach compiler, $(COMPILER_TYPES), \
1221            $(foreach relocate, $(RELOCATE_TYPES), \
1222              $(foreach trace, $(TRACE_TYPES), \
1223                $(foreach gc, $(GC_TYPES), \
1224                  $(foreach jni, $(JNI_TYPES), \
1225                    $(foreach image, $(IMAGE_TYPES), \
1226                      $(foreach pictest, $(PICTEST_TYPES), \
1227                        $(foreach debuggable, $(DEBUGGABLE_TYPES), \
1228                          $(eval $(call define-test-art-run-test,$(target),$(run_type),$(prebuild),$(compiler),$(relocate),$(trace),$(gc),$(jni),$(image),$(pictest),$(debuggable),$(test),$(address_size))) \
1229                  )))))))))))))
1230define-test-art-run-test :=
1231
1232# Define a phony rule whose purpose is to test its prerequisites.
1233# $(1): host or target
1234# $(2): list of prerequisites
1235define define-test-art-run-test-group
1236.PHONY: $(1)
1237$(1): $(2)
1238	$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
1239
1240endef  # define-test-art-run-test-group
1241
1242
1243$(foreach target, $(TARGET_TYPES), $(eval \
1244  $(call define-test-art-run-test-group,test-art-$(target)-run-test,$(ART_RUN_TEST_$(call name-to-var,$(target))_RULES))))
1245$(foreach target, $(TARGET_TYPES), \
1246  $(foreach prebuild, $(PREBUILD_TYPES), $(eval \
1247    $(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)))))
1248$(foreach target, $(TARGET_TYPES), \
1249  $(foreach run-type, $(RUN_TYPES), $(eval \
1250    $(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)))))
1251$(foreach target, $(TARGET_TYPES), \
1252  $(foreach compiler, $(COMPILER_TYPES), $(eval \
1253    $(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)))))
1254$(foreach target, $(TARGET_TYPES), \
1255  $(foreach relocate, $(RELOCATE_TYPES), $(eval \
1256    $(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)))))
1257$(foreach target, $(TARGET_TYPES), \
1258  $(foreach trace, $(TRACE_TYPES), $(eval \
1259    $(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)))))
1260$(foreach target, $(TARGET_TYPES), \
1261  $(foreach gc, $(GC_TYPES), $(eval \
1262    $(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)))))
1263$(foreach target, $(TARGET_TYPES), \
1264  $(foreach jni, $(JNI_TYPES), $(eval \
1265    $(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)))))
1266$(foreach target, $(TARGET_TYPES), \
1267  $(foreach debuggable, $(DEBUGGABLE_TYPES), $(eval \
1268    $(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)))))
1269$(foreach target, $(TARGET_TYPES), \
1270  $(foreach image, $(IMAGE_TYPES), $(eval \
1271    $(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)))))
1272$(foreach target, $(TARGET_TYPES), \
1273  $(foreach test, $(TEST_ART_RUN_TESTS), $(eval \
1274    $(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)))))
1275$(foreach target, $(TARGET_TYPES), \
1276  $(foreach address_size, $(ADDRESS_SIZES_$(call name-to-var,$(target))), $(eval \
1277    $(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)))))
1278
1279# Clear variables now we're finished with them.
1280$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))
1281$(foreach target, $(TARGET_TYPES), \
1282  $(foreach prebuild, $(PREBUILD_TYPES), \
1283    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(prebuild))_RULES :=)))
1284$(foreach target, $(TARGET_TYPES), \
1285  $(foreach compiler, $(COMPILER_TYPES), \
1286    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(compiler))_RULES :=)))
1287$(foreach target, $(TARGET_TYPES), \
1288  $(foreach relocate, $(RELOCATE_TYPES), \
1289    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(relocate))_RULES :=)))
1290$(foreach target, $(TARGET_TYPES), \
1291  $(foreach trace, $(TRACE_TYPES), \
1292    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(trace))_RULES :=)))
1293$(foreach target, $(TARGET_TYPES), \
1294  $(foreach gc, $(GC_TYPES), \
1295    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(gc))_RULES :=)))
1296$(foreach target, $(TARGET_TYPES), \
1297  $(foreach jni, $(JNI_TYPES), \
1298    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(jni))_RULES :=)))
1299$(foreach target, $(TARGET_TYPES), \
1300  $(foreach debuggable, $(DEBUGGABLE_TYPES), \
1301    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(debuggable))_RULES :=)))
1302$(foreach target, $(TARGET_TYPES), \
1303  $(foreach image, $(IMAGE_TYPES), \
1304    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(image))_RULES :=)))
1305$(foreach target, $(TARGET_TYPES), \
1306  $(foreach test, $(TEST_ART_RUN_TESTS), \
1307    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(test))_RULES :=)))
1308$(foreach target, $(TARGET_TYPES), \
1309  $(foreach address_size, $(ALL_ADDRESS_SIZES), \
1310    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(address_size))_RULES :=)))
1311$(foreach target, $(TARGET_TYPES), \
1312  $(foreach run_type, $(RUN_TYPES), \
1313    $(eval ART_RUN_TEST_$(call name-to-var,$(target))_$(call name-to-var,$(run_type))_RULES :=)))
1314define-test-art-run-test-group :=
1315TARGET_TYPES :=
1316PREBUILD_TYPES :=
1317COMPILER_TYPES :=
1318RELOCATE_TYPES :=
1319TRACE_TYPES :=
1320GC_TYPES :=
1321JNI_TYPES :=
1322IMAGE_TYPES :=
1323ADDRESS_SIZES_TARGET :=
1324ADDRESS_SIZES_HOST :=
1325ALL_ADDRESS_SIZES :=
1326RUN_TYPES :=
1327DEBUGGABLE_TYPES :=
1328
1329LOCAL_PATH :=
1330