Update host tests to point to a dedicated boot image directory.
On device the boot image files are in the APEX, but on host they're
created by the global code in dexpreopt_config.go and installed by make
in the same location irrespective of the ART APEX in use (release or
debug). That location is now moved to
$(ANDROID_HOST_OUT)/apex/art_boot_images to avoid conflict with the
APEX paths (because the release APEX is moving from
com.android.art.release to com.android.art).
Test: art/test/testrunner/run_build_test_target.py art-test
Test: art/build/apex/runtests.sh
Test: art/tools/buildbot-build.sh {--host,--target}
Test: art/tools/run-gtests.sh
Test: m test-art-host-gtest
Test: art/test/testrunner/testrunner.py --target --64 --optimizing
Test: m build-art-target-golem
Bug: 169639321
Change-Id: I932a15539e170d3c6c78515b22dd4b91ce1c57b4
diff --git a/libartbase/base/common_art_test.cc b/libartbase/base/common_art_test.cc
index efc223c..4e0dd84 100644
--- a/libartbase/base/common_art_test.cc
+++ b/libartbase/base/common_art_test.cc
@@ -547,10 +547,21 @@
return OpenDexFile(GetTestDexFileName(name).c_str());
}
+std::string CommonArtTestImpl::GetImageDirectory() {
+ std::string path;
+ if (IsHost()) {
+ const char* host_dir = getenv("ANDROID_HOST_OUT");
+ CHECK(host_dir != nullptr);
+ path = std::string(host_dir) + "/apex/art_boot_images";
+ } else {
+ path = std::string(kAndroidArtApexDefaultPath);
+ }
+ return path + "/javalib";
+}
+
std::string CommonArtTestImpl::GetCoreFileLocation(const char* suffix) {
CHECK(suffix != nullptr);
- std::string prefix(IsHost() ? GetAndroidRoot() : "");
- return StringPrintf("%s%s/javalib/boot.%s", prefix.c_str(), kAndroidArtApexDefaultPath, suffix);
+ return GetImageDirectory() + "/boot." + suffix;
}
std::string CommonArtTestImpl::CreateClassPath(
diff --git a/libartbase/base/common_art_test.h b/libartbase/base/common_art_test.h
index b4e0c5a..f627fc9 100644
--- a/libartbase/base/common_art_test.h
+++ b/libartbase/base/common_art_test.h
@@ -298,6 +298,7 @@
std::string CreateClassPathWithChecksums(
const std::vector<std::unique_ptr<const DexFile>>& dex_files);
+ static std::string GetImageDirectory();
static std::string GetCoreFileLocation(const char* suffix);
std::vector<std::unique_ptr<const DexFile>> loaded_dex_files_;
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index 1d37a42..16f0d58 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -505,16 +505,6 @@
return res.StandardSuccess();
}
-std::string CommonRuntimeTestImpl::GetImageDirectory() {
- std::string prefix;
- if (IsHost()) {
- const char* host_dir = getenv("ANDROID_HOST_OUT");
- CHECK(host_dir != nullptr);
- prefix = host_dir;
- }
- return prefix + kAndroidArtApexDefaultPath + "/javalib";
-}
-
std::string CommonRuntimeTestImpl::GetImageLocation() {
return GetImageDirectory() + "/boot.art";
}
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index 47031a3..cc23620 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -205,7 +205,6 @@
virtual void FinalizeSetup();
// Returns the directory where the pre-compiled boot.art can be found.
- static std::string GetImageDirectory();
static std::string GetImageLocation();
static std::string GetSystemImageFile();
diff --git a/test/run-test b/test/run-test
index 7221832..2c4b125 100755
--- a/test/run-test
+++ b/test/run-test
@@ -676,7 +676,7 @@
elif [ "$runtime" = "art" ]; then
if [ "$target_mode" = "no" ]; then
guess_host_arch_name
- run_args+=(--boot "${ANDROID_HOST_OUT}/apex/com.android.art/javalib/boot.art")
+ run_args+=(--boot "${ANDROID_HOST_OUT}/apex/art_boot_images/javalib/boot.art")
run_args+=(--runtime-option "-Djava.library.path=${host_lib_root}/lib${suffix64}:${host_lib_root}/nativetest${suffix64}")
else
guess_target_arch_name