Fixes for gtests in eng-prod
Bug: 147817558
Test: art/art-host-gtest on forrest
Change-Id: I0ecfbc81fe6998d4c8c69ce6fbeb35bdd5908b55
diff --git a/libartbase/base/common_art_test.cc b/libartbase/base/common_art_test.cc
index a087aa5..fd6da87 100644
--- a/libartbase/base/common_art_test.cc
+++ b/libartbase/base/common_art_test.cc
@@ -301,11 +301,17 @@
// Get prebuilt binary tool.
// The paths need to be updated when Android prebuilts update.
std::string CommonArtTestImpl::GetAndroidTool(const char* name, InstructionSet) {
- std::string path = GetAndroidBuildTop() + "prebuilts/clang/host/linux-x86/clang-r383902b/bin/";
+#ifdef ART_TARGET_ANDROID
+ UNUSED(name);
+ LOG(FATAL) << "There are no prebuilt tools available when running on target.";
+ UNREACHABLE();
+#else
+ std::string path = GetAndroidBuildTop() + ART_CLANG_PATH + "/bin/";
CHECK(OS::DirectoryExists(path.c_str())) << path;
path += name;
CHECK(OS::FileExists(path.c_str())) << path;
return path;
+#endif
}
std::string CommonArtTestImpl::GetCoreArtLocation() {
@@ -322,7 +328,7 @@
MemMap::Init();
static constexpr bool kVerifyChecksum = true;
const ArtDexFileLoader dex_file_loader;
- std::string filename(location);
+ std::string filename(IsHost() ? GetAndroidBuildTop() + location : location);
if (!dex_file_loader.Open(filename.c_str(),
std::string(location),
/* verify= */ true,