Build and install the Testing Runtime APEX in ART device testing.
Replace the Debug Runtime APEX with the Testing Runtime APEX for ART
device testing.
This change does not change the behavior of ART device testing per se,
as test rules have not been updated (yet) to make use of the
additional files (ART gtests) included only in the Testing Runtime
APEX.
Test: ART (chroot-based) device testing
Bug: 129534335
Change-Id: I1b9dfcb9fe483584b4065908c1b2e24d19703b52
diff --git a/CleanSpec.mk b/CleanSpec.mk
index a9b086a..f59de64 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -82,6 +82,10 @@
# Remove ART test target artifacts.
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/nativetest*/)
+# Remove all APEX artifacts after the change to use the Testing
+# Runtime APEX in lieu of the Debug Runtime APEX for ART testing.
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/apex)
+
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/build/Android.common_path.mk b/build/Android.common_path.mk
index b0bd7fd..a78d489 100644
--- a/build/Android.common_path.mk
+++ b/build/Android.common_path.mk
@@ -150,9 +150,9 @@
# Release Runtime APEX, included by default in "user" builds.
RELEASE_RUNTIME_APEX := com.android.runtime.release
# Debug Runtime APEX, included by default in "userdebug" and "eng"
-# builds and used in ART device testing and benchmarking.
+# builds and used in ART device benchmarking.
DEBUG_RUNTIME_APEX := com.android.runtime.debug
-# Testing Runtime APEX (not used yet).
+# Testing Runtime APEX, used in ART device testing.
TESTING_RUNTIME_APEX := com.android.runtime.testing
endif # ART_ANDROID_COMMON_PATH_MK
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 0c64733..f793dee 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -286,7 +286,7 @@
$(HOST_OUT_EXECUTABLES)/dexoptanalyzerd
ART_GTEST_dexoptanalyzer_test_TARGET_DEPS := \
$(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
- $(DEBUG_RUNTIME_APEX) # For dexoptanalyzerd.
+ $(TESTING_RUNTIME_APEX) # For dexoptanalyzerd.
ART_GTEST_image_space_test_HOST_DEPS := \
$(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
@@ -298,21 +298,21 @@
$(HOST_OUT_EXECUTABLES)/dex2oatd
ART_GTEST_dex2oat_test_TARGET_DEPS := \
$(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
- $(DEBUG_RUNTIME_APEX) # For dex2oatd.
+ $(TESTING_RUNTIME_APEX) # For dex2oatd.
ART_GTEST_dex2oat_image_test_HOST_DEPS := \
$(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
$(HOST_OUT_EXECUTABLES)/dex2oatd
ART_GTEST_dex2oat_image_test_TARGET_DEPS := \
$(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
- $(DEBUG_RUNTIME_APEX) # For dex2oatd.
+ $(TESTING_RUNTIME_APEX) # For dex2oatd.
# TODO: document why this is needed.
ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
# The dexdiag test requires the dexdiag utility.
ART_GTEST_dexdiag_test_HOST_DEPS := $(HOST_OUT_EXECUTABLES)/dexdiag
-ART_GTEST_dexdiag_test_TARGET_DEPS := $(DEBUG_RUNTIME_APEX) # For dexdiag.
+ART_GTEST_dexdiag_test_TARGET_DEPS := $(TESTING_RUNTIME_APEX) # For dexdiag.
# The dexdump test requires an image and the dexdump utility.
# TODO: rename into dexdump when migration completes
@@ -356,7 +356,7 @@
ART_GTEST_dexlist_test_TARGET_DEPS := \
$(TARGET_CORE_IMAGE_DEFAULT_64) \
$(TARGET_CORE_IMAGE_DEFAULT_32) \
- $(DEBUG_RUNTIME_APEX) # For dexlist.
+ $(TESTING_RUNTIME_APEX) # For dexlist.
# The imgdiag test has dependencies on core.oat since it needs to load it during the test.
# For the host, also add the installed tool (in the base size, that should suffice). For the
@@ -388,7 +388,7 @@
ART_GTEST_oatdump_test_TARGET_DEPS := \
$(TARGET_CORE_IMAGE_DEFAULT_64) \
$(TARGET_CORE_IMAGE_DEFAULT_32) \
- $(DEBUG_RUNTIME_APEX) # For oatdumpd, dexdump, dex2oatd.
+ $(TESTING_RUNTIME_APEX) # For oatdumpd, dexdump, dex2oatd.
ART_GTEST_oatdump_image_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS)
ART_GTEST_oatdump_image_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS)
ART_GTEST_oatdump_app_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS)
@@ -396,7 +396,7 @@
# Profile assistant tests requires profman utility.
ART_GTEST_profile_assistant_test_HOST_DEPS := $(HOST_OUT_EXECUTABLES)/profmand
-ART_GTEST_profile_assistant_test_TARGET_DEPS := $(DEBUG_RUNTIME_APEX) # For profmand.
+ART_GTEST_profile_assistant_test_TARGET_DEPS := $(TESTING_RUNTIME_APEX) # For profmand.
ART_GTEST_hiddenapi_test_HOST_DEPS := \
$(HOST_CORE_IMAGE_DEFAULT_64) \
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index 6f182b1..7b9c083 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -25,11 +25,11 @@
$(HOST_OUT_EXECUTABLES)/jasmin \
$(HOST_OUT_EXECUTABLES)/smali
-# We need the Debug Runtime APEX (which is a superset of the Release
-# Runtime APEX) -- which contains dex2oat and dalvikvm and their
-# dependencies -- on the target, as well as the core images (all images
-# as we sync only once).
-ART_TEST_TARGET_RUN_TEST_DEPENDENCIES := $(DEBUG_RUNTIME_APEX) $(TARGET_CORE_IMG_OUTS)
+# We need the Testing Runtime APEX (which is a superset of the Release
+# and Debug Runtime APEXes) -- which contains dex2oat, dalvikvm, their
+# dependencies and ART gtests -- on the target, as well as the core
+# images (all images as we sync only once).
+ART_TEST_TARGET_RUN_TEST_DEPENDENCIES := $(TESTING_RUNTIME_APEX) $(TARGET_CORE_IMG_OUTS)
# Also need libartagent.
ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libartagent-target libartagentd-target
diff --git a/tools/buildbot-build.sh b/tools/buildbot-build.sh
index 9ef5fdf..62fa47c 100755
--- a/tools/buildbot-build.sh
+++ b/tools/buildbot-build.sh
@@ -81,8 +81,8 @@
# These targets are needed for the chroot environment.
make_command+=" crash_dump event-log-tags"
fi
- # Build the Debug Runtime APEX (which is a superset of the Release Runtime APEX).
- make_command+=" com.android.runtime.debug"
+ # Build the Testing Runtime APEX (which is a superset of the Release and Debug Runtime APEXes).
+ make_command+=" com.android.runtime.testing"
# Build the system linker configuration, which is needed to use the
# Runtime APEX's linker configuration.
make_command+=" ld.config.txt "
diff --git a/tools/buildbot-sync.sh b/tools/buildbot-sync.sh
index 65be158..6fac2d0 100755
--- a/tools/buildbot-sync.sh
+++ b/tools/buildbot-sync.sh
@@ -140,10 +140,10 @@
"$ART_TEST_CHROOT/system/etc/public.libraries.txt"
echo -e "${green}Activating Runtime APEX...${nc}"
-# Manually "activate" the flattened Debug Runtime APEX by syncing it to the
+# Manually "activate" the flattened Testing Runtime APEX by syncing it to the
# /apex directory in the chroot.
#
-# We copy the files from `/system/apex/com.android.runtime.debug` to
+# We copy the files from `/system/apex/com.android.runtime.testing` to
# `/apex/com.android.runtime` in the chroot directory, instead of simply using a
# symlink, as Bionic's linker relies on the real path name of a binary
# (e.g. `/apex/com.android.runtime/bin/dex2oat`) to select the linker
@@ -153,7 +153,7 @@
# As a workaround, one can run `export TARGET_FLATTEN_APEX=true` before building
# a target to have its APEX packages flattened.
adb shell rm -rf "$ART_TEST_CHROOT/apex/com.android.runtime"
-adb shell cp -a "$ART_TEST_CHROOT/system/apex/com.android.runtime.debug" \
+adb shell cp -a "$ART_TEST_CHROOT/system/apex/com.android.runtime.testing" \
"$ART_TEST_CHROOT/apex/com.android.runtime"
echo -e "${green}Activating Time Zone Data APEX...${nc}"