summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2023-07-26 11:24:17 +0100
committer Jiakai Zhang <jiakaiz@google.com> 2023-07-26 16:46:11 +0000
commit0eb638e59e26d99d1cc5bfa5af59d5797743c7c5 (patch)
tree024429e944f58d27aad81086d66735815d2341f2
parent363b1bac22b03b5f9f3ff8e040d1e50c1c58d279 (diff)
Update tests to adapt the new ART boot image for host tests.
This new ART boot image includes core-icu4j and consrypt. This CL also changes generate-boot-image to add core-icu4j and consrypt to the ART boot image generated on device for target tests, to keep host tests and target tests consistent with each other. Bug: 290583827 Test: m test-art-host-gtest Test: m build-art-target-golem Test: m build-art-host-golem Test: atest ArtGtestsTargetChroot Change-Id: I6742c478bc9673b6185b346b5501f27fc62b68aa
-rw-r--r--build/Android.gtest.mk8
-rw-r--r--runtime/gc/space/image_space_test.cc9
-rw-r--r--test/generate-boot-image/generate-boot-image.cc4
3 files changed, 6 insertions, 15 deletions
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 770e988eb5..434145d39c 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -40,14 +40,12 @@ icu_data_file := $(firstword $(wildcard external/icu/icu4c/source/stubdata/icu*.
my_files += $(foreach infix,_ _VDEX_,$(foreach suffix,$(HOST_ARCH) $(HOST_2ND_ARCH), \
$(DEXPREOPT_IMAGE$(infix)BUILT_INSTALLED_art_host_$(suffix))))
# `dexpreopt_bootjars.go` uses a single source of input regardless of variants, so we should use the
-# same source for `CORE_IMG_JARS` to avoid checksum mismatches on the oat files. We can still use
-# the host variant of `conscrypt` and `core-icu4j` because they don't go into the primary boot image
-# that is used in host gtests, and hence can't lead to checksum mismatches.
+# same source to avoid checksum mismatches on the oat files.
my_files += \
$(foreach jar,$(CORE_IMG_JARS),\
$(OUT_DIR)/soong/dexpreopt_$(TARGET_ARCH)/dex_artjars_input/$(jar).jar:apex/com.android.art/javalib/$(jar).jar) \
- $(HOST_OUT_JAVA_LIBRARIES)/conscrypt-hostdex.jar:apex/com.android.conscrypt/javalib/conscrypt.jar\
- $(HOST_OUT_JAVA_LIBRARIES)/core-icu4j-hostdex.jar:apex/com.android.i18n/javalib/core-icu4j.jar \
+ $(OUT_DIR)/soong/dexpreopt_$(TARGET_ARCH)/dex_artjars_input/conscrypt.jar:apex/com.android.conscrypt/javalib/conscrypt.jar\
+ $(OUT_DIR)/soong/dexpreopt_$(TARGET_ARCH)/dex_artjars_input/core-icu4j.jar:apex/com.android.i18n/javalib/core-icu4j.jar \
$(icu_data_file):com.android.i18n/etc/icu/$(notdir $(icu_data_file))
# Create phony module that will copy all the data files into testcases directory.
diff --git a/runtime/gc/space/image_space_test.cc b/runtime/gc/space/image_space_test.cc
index fa9a255ccb..2e5e678008 100644
--- a/runtime/gc/space/image_space_test.cc
+++ b/runtime/gc/space/image_space_test.cc
@@ -58,17 +58,10 @@ TEST_F(ImageSpaceTest, StringDeduplication) {
int mkdir_result = mkdir(image_dir.c_str(), 0700);
ASSERT_EQ(0, mkdir_result);
- // Prepare boot class path variables, exclude core-icu4j and conscrypt
- // which are not in the primary boot image.
+ // Prepare boot class path variables.
std::vector<std::string> bcp = GetLibCoreDexFileNames();
std::vector<std::string> bcp_locations = GetLibCoreDexLocations();
CHECK_EQ(bcp.size(), bcp_locations.size());
- ASSERT_NE(std::string::npos, bcp.back().find("conscrypt"));
- bcp.pop_back();
- bcp_locations.pop_back();
- ASSERT_NE(std::string::npos, bcp.back().find("core-icu4j"));
- bcp.pop_back();
- bcp_locations.pop_back();
std::string base_bcp_string = android::base::Join(bcp, ':');
std::string base_bcp_locations_string = android::base::Join(bcp_locations, ':');
std::string base_image_location = GetImageLocation();
diff --git a/test/generate-boot-image/generate-boot-image.cc b/test/generate-boot-image/generate-boot-image.cc
index 64390c3163..671aa379f1 100644
--- a/test/generate-boot-image/generate-boot-image.cc
+++ b/test/generate-boot-image/generate-boot-image.cc
@@ -78,7 +78,7 @@ Supported options:
--instruction-set=ISA: The instruction set option to pass to dex2oat. Required when running on
host. The default on target is based on the ISA of this binary.
--core-only=true|false: If true, only compile ART jars. Otherwise, also compile core-icu4j and
- conscrypt. Default: true
+ conscrypt. Default: false
)";
struct Options {
@@ -91,7 +91,7 @@ struct Options {
std::string android_root = "";
std::string profile_file = "";
std::string instruction_set = "";
- bool core_only = true;
+ bool core_only = false;
};
[[noreturn]] void Usage(const std::string& message) {