summaryrefslogtreecommitdiff
path: root/dexlayout
diff options
context:
space:
mode:
authorRoland Levillain <rpl@google.com>2019-03-29 20:20:16 +0000
committerRoland Levillain <rpl@google.com>2019-04-12 13:47:09 +0100
commitfb6a5c00ef02cda7ea919d717daaf46abd0414e4 (patch)
tree9ecfaac9bee174b3b31e0294c46c4d32a5f7b714 /dexlayout
parentf160394fda141184f0ec3d139ec5ca810f142bda (diff)
Add and use art::GetAndroidRuntimeBinDir.
This method returns the location of the directory containing the Android Runtime binaries, which is expected to be the Android Runtime APEX's bin directory on target and the Android Root's bin directory on host (at least for now). Also remove art::CommonArtTestImpl::GetTestAndroidRoot as it is no longer used. Test: ART gtests on host and target Bug: 121117762 Change-Id: I4593bbd4d675ca9d3f7b708482aac82c1892a9ad
Diffstat (limited to 'dexlayout')
-rw-r--r--dexlayout/dexdiag_test.cc14
-rw-r--r--dexlayout/dexlayout_test.cc4
2 files changed, 7 insertions, 11 deletions
diff --git a/dexlayout/dexdiag_test.cc b/dexlayout/dexdiag_test.cc
index e220f39f1b..0791e9a563 100644
--- a/dexlayout/dexdiag_test.cc
+++ b/dexlayout/dexdiag_test.cc
@@ -39,18 +39,14 @@ class DexDiagTest : public CommonArtTest {
// Path to the dexdiag(d?)[32|64] binary.
std::string GetDexDiagFilePath() {
- std::string root = GetTestAndroidRoot();
-
- root += "/bin/";
- root += kDexDiagBinaryName;
-
- std::string root32 = root + "32";
+ std::string path = GetAndroidRuntimeBinDir() + '/' + kDexDiagBinaryName;
+ std::string path32 = path + "32";
// If we have both a 32-bit and a 64-bit build, the 32-bit file will have a 32 suffix.
- if (OS::FileExists(root32.c_str()) && !Is64BitInstructionSet(kRuntimeISA)) {
- return root32;
+ if (OS::FileExists(path32.c_str()) && !Is64BitInstructionSet(kRuntimeISA)) {
+ return path32;
} else {
// This is a 64-bit build or only a single build exists.
- return root;
+ return path;
}
}
diff --git a/dexlayout/dexlayout_test.cc b/dexlayout/dexlayout_test.cc
index fb1c8461e8..5ee63b5feb 100644
--- a/dexlayout/dexlayout_test.cc
+++ b/dexlayout/dexlayout_test.cc
@@ -253,14 +253,14 @@ static void WriteFileBase64(const char* base64, const char* location) {
class DexLayoutTest : public CommonArtTest {
protected:
std::string GetDexLayoutPath() {
- return GetTestAndroidRoot() + "/bin/dexlayoutd";
+ return GetAndroidRuntimeBinDir() + "/dexlayoutd";
}
// Runs FullPlainOutput test.
bool FullPlainOutputExec(std::string* error_msg) {
ScratchFile dexdump_output;
const std::string& dexdump_filename = dexdump_output.GetFilename();
- std::string dexdump = GetTestAndroidRoot() + "/bin/dexdump";
+ std::string dexdump = GetAndroidRuntimeBinDir() + "/dexdump";
EXPECT_TRUE(OS::FileExists(dexdump.c_str())) << dexdump << " should be a valid file path";
ScratchFile dexlayout_output;