summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dex2oat/dex2oat_cts_test.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/dex2oat/dex2oat_cts_test.cc b/dex2oat/dex2oat_cts_test.cc
index 0b5ee5be7d..15f100e561 100644
--- a/dex2oat/dex2oat_cts_test.cc
+++ b/dex2oat/dex2oat_cts_test.cc
@@ -19,6 +19,15 @@
namespace art {
+// Test the binary with the same bitness as the test. This is also done to avoid
+// the symlink /apex/com.android.art/bin/dex2oat, which we don't have selinux
+// permission to read on S.
+#if defined(__LIB64__)
+constexpr const char* kDex2oatBinary = "dex2oat64";
+#else
+constexpr const char* kDex2oatBinary = "dex2oat32";
+#endif
+
class Dex2oatCtsTest : public CommonArtTest, public Dex2oatScratchDirs {
public:
void SetUp() override {
@@ -37,8 +46,8 @@ class Dex2oatCtsTest : public CommonArtTest, public Dex2oatScratchDirs {
int Dex2Oat(const std::vector<std::string>& dex2oat_args,
std::string* output,
std::string* error_msg) {
- // This command line should work regardless of bitness, ISA, etc.
- std::vector<std::string> argv = {std::string(kAndroidArtApexDefaultPath) + "/bin/dex2oat"};
+ std::vector<std::string> argv = {std::string(kAndroidArtApexDefaultPath) + "/bin/" +
+ kDex2oatBinary};
argv.insert(argv.end(), dex2oat_args.begin(), dex2oat_args.end());
// We must set --android-root.