summaryrefslogtreecommitdiffstats
path: root/libartbase
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2018-12-03 18:47:23 +0000
committerVladimir Marko <vmarko@google.com>2018-12-04 17:17:19 +0000
commit7a85e70b2bf646d1d7a226fbb4e7fafb66871dd5 (patch)
tree790ee4c1cee812535c856a08355c50c2032c5cd4 /libartbase
parent6a98f89c4ad645b04d6c80d3d7e260c59bf6f193 (diff)
downloadart-7a85e70b2bf646d1d7a226fbb4e7fafb66871dd5.tar.gz
art-7a85e70b2bf646d1d7a226fbb4e7fafb66871dd5.tar.bz2
art-7a85e70b2bf646d1d7a226fbb4e7fafb66871dd5.zip
Reduce core image to 6 modules.
This was Revert^2 "Reduce core image to core-{oj,libart,simple}." but we're now keeping three additional modules, namely conscrypt, okhttp and bouncycastle. And we fix the boot class path used by vogar with the companion change https://android-review.googlesource.com/840810 . This reverts commit 00fe35e4021e9a8679eca3ffaede48fd89b56258. Change-Id: I6137edd91c03c17be50de200267eb9adc971e8fb Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 3 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Test: art/tools/run-libcore-tests.sh --mode=device --variant=X64 Bug: 119868597
Diffstat (limited to 'libartbase')
-rw-r--r--libartbase/base/common_art_test.cc46
-rw-r--r--libartbase/base/common_art_test.h6
2 files changed, 49 insertions, 3 deletions
diff --git a/libartbase/base/common_art_test.cc b/libartbase/base/common_art_test.cc
index 5a0b425bca..278203da23 100644
--- a/libartbase/base/common_art_test.cc
+++ b/libartbase/base/common_art_test.cc
@@ -24,6 +24,7 @@
#include "nativehelper/scoped_local_ref.h"
#include "android-base/stringprintf.h"
+#include "android-base/strings.h"
#include "android-base/unique_fd.h"
#include <unicode/uvernum.h>
@@ -328,9 +329,48 @@ static std::string GetDexFileName(const std::string& jar_prefix, bool host) {
}
std::vector<std::string> CommonArtTestImpl::GetLibCoreDexFileNames() {
- return std::vector<std::string>({GetDexFileName("core-oj", IsHost()),
- GetDexFileName("core-libart", IsHost()),
- GetDexFileName("core-simple", IsHost())});
+ // Note: This must match the TEST_CORE_JARS in Android.common_path.mk
+ // because that's what we use for compiling the core.art image.
+ static const char* const kLibcoreModules[] = {
+ "core-oj",
+ "core-libart",
+ "core-simple",
+ "conscrypt",
+ "okhttp",
+ "bouncycastle",
+ };
+
+ std::vector<std::string> result;
+ result.reserve(arraysize(kLibcoreModules));
+ for (const char* module : kLibcoreModules) {
+ result.push_back(GetDexFileName(module, IsHost()));
+ }
+ return result;
+}
+
+std::vector<std::string> CommonArtTestImpl::GetLibCoreDexLocations() {
+ std::vector<std::string> result = GetLibCoreDexFileNames();
+ if (IsHost()) {
+ // Strip the ANDROID_BUILD_TOP directory including the directory separator '/'.
+ const char* host_dir = getenv("ANDROID_BUILD_TOP");
+ CHECK(host_dir != nullptr);
+ std::string prefix = host_dir;
+ CHECK(!prefix.empty());
+ if (prefix.back() != '/') {
+ prefix += '/';
+ }
+ for (std::string& location : result) {
+ CHECK_GT(location.size(), prefix.size());
+ CHECK_EQ(location.compare(0u, prefix.size(), prefix), 0);
+ location.erase(0u, prefix.size());
+ }
+ }
+ return result;
+}
+
+std::string CommonArtTestImpl::GetClassPathOption(const char* option,
+ const std::vector<std::string>& class_path) {
+ return option + android::base::Join(class_path, ':');
}
std::string CommonArtTestImpl::GetTestAndroidRoot() {
diff --git a/libartbase/base/common_art_test.h b/libartbase/base/common_art_test.h
index 0f4800dfc5..3e2340f0a7 100644
--- a/libartbase/base/common_art_test.h
+++ b/libartbase/base/common_art_test.h
@@ -99,6 +99,12 @@ class CommonArtTestImpl {
// Gets the paths of the libcore dex files.
static std::vector<std::string> GetLibCoreDexFileNames();
+ // Gets the locations of the libcore dex files.
+ static std::vector<std::string> GetLibCoreDexLocations();
+
+ static std::string GetClassPathOption(const char* option,
+ const std::vector<std::string>& class_path);
+
// Returns bin directory which contains host's prebuild tools.
static std::string GetAndroidHostToolsDir();