blob: 5480860c6f2b4591114b756840d2ac76660a597a [file] [log] [blame]
Ian Rogersafd9acc2014-06-17 08:21:54 -07001# Copyright (C) 2011 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16LOCAL_PATH := $(call my-dir)
Shubham Ajmera6f3d5902017-02-06 06:39:11 +000017
Ian Rogersafd9acc2014-06-17 08:21:54 -070018include art/build/Android.common_test.mk
19
Nicolas Geoffray07f2bc12015-05-29 13:40:25 +010020# Dependencies for actually running a run-test.
Sebastien Hertz19ac0272015-02-24 17:39:50 +010021TEST_ART_RUN_TEST_DEPENDENCIES := \
Alex Lightcc917d92018-02-22 13:28:28 -080022 $(HOST_OUT_EXECUTABLES)/d8 \
David Brazdil11b67b22018-01-18 16:41:40 +000023 $(HOST_OUT_EXECUTABLES)/hiddenapi \
Sebastien Hertz19ac0272015-02-24 17:39:50 +010024 $(HOST_OUT_EXECUTABLES)/jasmin \
Orion Hodson64fe3be2018-06-15 12:50:22 +010025 $(HOST_OUT_EXECUTABLES)/smali
Sebastien Hertz19ac0272015-02-24 17:39:50 +010026
Martin Stjernholmd6be5da2019-07-16 17:14:46 +010027# We need the ART Testing APEX (which is a superset of the Release
28# and Debug APEXes) -- which contains dex2oat, dalvikvm, their
Roland Levillain8d5a2152019-07-02 19:40:28 +010029# dependencies and ART gtests -- on the target, as well as the core
30# images (all images as we sync only once).
Martin Stjernholm84e5bb92019-09-05 19:56:46 +010031ART_TEST_TARGET_RUN_TEST_DEPENDENCIES := $(TESTING_ART_APEX) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -070032
Alex Light7233c7e2016-07-28 10:07:45 -070033# Also need libartagent.
Nicolas Geoffray375d4eb2018-10-12 15:23:56 +010034ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libartagent-target libartagentd-target
Alex Light7233c7e2016-07-28 10:07:45 -070035
Alex Light49948e92016-08-11 15:35:28 -070036# Also need libtiagent.
Nicolas Geoffray375d4eb2018-10-12 15:23:56 +010037ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libtiagent-target libtiagentd-target
Alex Light49948e92016-08-11 15:35:28 -070038
Alex Light8f2c6d42017-04-10 16:27:35 -070039# Also need libtistress.
Nicolas Geoffray375d4eb2018-10-12 15:23:56 +010040ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libtistress-target libtistressd-target
Alex Light8f2c6d42017-04-10 16:27:35 -070041
Andreas Gampe1c83cbc2014-07-22 18:52:29 -070042# Also need libarttest.
Nicolas Geoffray375d4eb2018-10-12 15:23:56 +010043ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libarttest-target libarttestd-target
Andreas Gampe1c83cbc2014-07-22 18:52:29 -070044
Andreas Gampe855564b2014-07-25 02:32:19 -070045# Also need libnativebridgetest.
David Srbecky68fa4ca2019-04-30 16:51:13 +010046ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libnativebridgetest-target libnativebridgetestd-target
Andreas Gampe855564b2014-07-25 02:32:19 -070047
Andreas Gampe2ea4ec02019-09-11 11:36:01 -070048# Also need signal_dumper.
49ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += signal_dumper-target
50
Andreas Gampe63fc30e2014-10-24 21:58:16 -070051# All tests require the host executables. The tests also depend on the core images, but on
52# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -070053ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
54 $(ART_HOST_EXECUTABLES) \
Nicolas Geoffraya6fbe392017-03-25 14:05:28 +000055 $(HOST_OUT_EXECUTABLES)/hprof-conv \
Andreas Gampe148c1602019-06-10 16:47:46 -070056 $(HOST_OUT_EXECUTABLES)/signal_dumper \
Colin Cross83072062019-10-02 16:06:58 -070057 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagent) \
58 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagentd) \
59 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistress) \
60 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistressd) \
61 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagent) \
62 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagentd) \
63 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttest) \
64 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttestd) \
65 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetest) \
66 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetestd) \
Victor Chang65ae6692019-10-11 14:17:21 +010067 $(ART_HOST_OUT_SHARED_LIBRARIES)/libicu_jni$(ART_HOST_SHLIB_EXTENSION) \
Narayan Kamath67ef2c92015-11-16 10:17:35 +000068 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe10edbb12016-01-06 17:59:49 -080069 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampef2c5dbd2016-11-17 22:50:33 -080070 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \
71 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \
72 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \
Nicolas Geoffrayd31cff12020-03-27 14:29:45 +000073 $(ART_HOST_DEX_DEPENDENCIES) \
Nicolas Geoffray15259602020-07-30 09:31:15 +010074 $(HOST_I18N_DATA)
Ian Rogers665de8a2014-06-24 21:34:09 -070075
76ifneq ($(HOST_PREFER_32_BIT),true)
77ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Colin Cross83072062019-10-02 16:06:58 -070078 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagent) \
79 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagentd) \
80 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistress) \
81 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistressd) \
82 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagent) \
83 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagentd) \
84 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttest) \
85 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttestd) \
86 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetest) \
87 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetestd) \
Victor Chang65ae6692019-10-11 14:17:21 +010088 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libicu_jni$(ART_HOST_SHLIB_EXTENSION) \
Narayan Kamath67ef2c92015-11-16 10:17:35 +000089 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe10edbb12016-01-06 17:59:49 -080090 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampef2c5dbd2016-11-17 22:50:33 -080091 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \
92 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \
93 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \
94
Ian Rogers665de8a2014-06-24 21:34:09 -070095endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070096
Martin Stjernholm21dafaf2021-02-17 20:39:45 +000097ifeq (true,$(my_art_module_source_build))
98 test-art-host-run-test-dependencies : \
David Srbecky928d28e2020-04-01 17:50:51 +010099 $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) $(TEST_ART_RUN_TEST_DEPENDENCIES) \
100 $(HOST_BOOT_IMAGE_JARS) $(HOST_BOOT_IMAGE) $(2ND_HOST_BOOT_IMAGE)
Martin Stjernholm21dafaf2021-02-17 20:39:45 +0000101 .PHONY: test-art-host-run-test-dependencies
102 test-art-run-test-dependencies : test-art-host-run-test-dependencies
103endif
104
Roland Levillainf69c1892020-01-30 13:25:32 +0000105test-art-target-run-test-dependencies :
Dan Willemsen03b03462018-06-18 20:29:18 -0700106.PHONY: test-art-target-run-test-dependencies
Martin Stjernholm21dafaf2021-02-17 20:39:45 +0000107test-art-run-test-dependencies : test-art-target-run-test-dependencies
Dan Willemsen03b03462018-06-18 20:29:18 -0700108.PHONY: test-art-run-test-dependencies
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000109
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700110# Create a rule to build and run a test group of the following form:
111# test-art-{1: host target}-run-test
112define define-test-art-host-or-target-run-test-group
113 build_target := test-art-$(1)-run-test
114 .PHONY: $$(build_target)
115
116 $$(build_target) : args := --$(1) --verbose
117 $$(build_target) : test-art-$(1)-run-test-dependencies
118 ./art/test/testrunner/testrunner.py $$(args)
119 build_target :=
120 args :=
Martin Stjernholm21dafaf2021-02-17 20:39:45 +0000121
122 test-art-run-test : $(build_target)
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700123endef # define-test-art-host-or-target-run-test-group
124
Martin Stjernholm21dafaf2021-02-17 20:39:45 +0000125$(eval $(call define-test-art-host-or-target-run-test-group,target))
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700126
Martin Stjernholm21dafaf2021-02-17 20:39:45 +0000127ifeq (true,$(my_art_module_source_build))
128 $(eval $(call define-test-art-host-or-target-run-test-group,host))
129endif
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700130
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700131define-test-art-host-or-target-run-test-group :=
Alex Light7233c7e2016-07-28 10:07:45 -0700132LOCAL_PATH :=