summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/Android.gtest.mk4
-rw-r--r--runtime/common_runtime_test.cc25
-rw-r--r--runtime/common_runtime_test.h3
3 files changed, 19 insertions, 13 deletions
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 99f7a2afb8..3d16c49fe4 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -442,8 +442,8 @@ define define-art-gtest-rule-target
$$(ART_TARGET_NATIVETEST_OUT)/$$(TARGET_$(2)ARCH)/$(1) \
$$($(2)TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so \
$$($(2)TARGET_OUT_SHARED_LIBRARIES)/libopenjdk.so \
- $$(TARGET_OUT_JAVA_LIBRARIES)/core-libart.jar \
- $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj.jar
+ $$(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar \
+ $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar
.PHONY: $$(gtest_rule)
$$(gtest_rule): test-art-target-sync
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index 403dd4c0df..624abb9f6d 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -436,17 +436,26 @@ void CommonRuntimeTest::TearDown() {
}
}
-std::vector<std::string> CommonRuntimeTest::GetLibCoreDexFileNames() {
- return std::vector<std::string>({GetDexFileName("core-oj"), GetDexFileName("core-libart")});
-}
-
-std::string CommonRuntimeTest::GetDexFileName(const std::string& jar_prefix) {
- if (IsHost()) {
+static std::string GetDexFileName(const std::string& jar_prefix, bool host) {
+ std::string path;
+ if (host) {
const char* host_dir = getenv("ANDROID_HOST_OUT");
CHECK(host_dir != nullptr);
- return StringPrintf("%s/framework/%s-hostdex.jar", host_dir, jar_prefix.c_str());
+ path = host_dir;
+ } else {
+ path = GetAndroidRoot();
}
- return StringPrintf("%s/framework/%s.jar", GetAndroidRoot(), jar_prefix.c_str());
+
+ std::string suffix = host
+ ? "-hostdex" // The host version.
+ : "-testdex"; // The unstripped target version.
+
+ return StringPrintf("%s/framework/%s%s.jar", path.c_str(), jar_prefix.c_str(), suffix.c_str());
+}
+
+std::vector<std::string> CommonRuntimeTest::GetLibCoreDexFileNames() {
+ return std::vector<std::string>({GetDexFileName("core-oj", IsHost()),
+ GetDexFileName("core-libart", IsHost())});
}
std::string CommonRuntimeTest::GetTestAndroidRoot() {
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index 8d9e6281c0..7223b6ec6b 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -118,9 +118,6 @@ class CommonRuntimeTest : public testing::Test {
// initializers, initialize well-known classes, and creates the heap thread pool.
virtual void FinalizeSetup();
- // Gets the path of the specified dex file for host or target.
- static std::string GetDexFileName(const std::string& jar_prefix);
-
std::string GetTestAndroidRoot();
std::string GetTestDexFileName(const char* name);