diff options
Diffstat (limited to 'dexlayout/dexlayout_test.cc')
-rw-r--r-- | dexlayout/dexlayout_test.cc | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/dexlayout/dexlayout_test.cc b/dexlayout/dexlayout_test.cc index 63dc9728f1..42b64c3888 100644 --- a/dexlayout/dexlayout_test.cc +++ b/dexlayout/dexlayout_test.cc @@ -36,8 +36,8 @@ class DexLayoutTest : public CommonRuntimeTest { dex_file_ = GetLibCoreDexFileNames()[0]; } - // Runs FullPlainOutput test. - bool FullPlainOutputExec(std::string* error_msg) { + // Runs test with given arguments. + bool Exec(std::string* error_msg) { // TODO: dexdump2 -> dexdump ? ScratchFile dexdump_output; std::string dexdump_filename = dexdump_output.GetFilename(); @@ -67,41 +67,6 @@ class DexLayoutTest : public CommonRuntimeTest { return true; } - // Runs FullPlainOutput test. - bool DexFileOutputExec(std::string* error_msg) { - ScratchFile dexlayout_output; - std::string dexlayout_filename = dexlayout_output.GetFilename(); - std::string dexlayout = GetTestAndroidRoot() + "/bin/dexlayout"; - EXPECT_TRUE(OS::FileExists(dexlayout.c_str())) << dexlayout << " should be a valid file path"; - std::vector<std::string> dexlayout_exec_argv = - { dexlayout, "-d", "-f", "-h", "-l", "plain", "-w", "-o", dexlayout_filename, dex_file_ }; - - if (!::art::Exec(dexlayout_exec_argv, error_msg)) { - return false; - } - - size_t last_slash = dexlayout_filename.rfind("/"); - std::string scratch_directory = dexlayout_filename.substr(0, last_slash + 1); - std::vector<std::string> unzip_exec_argv = - { "/usr/bin/unzip", dex_file_, "classes.dex", "-d", scratch_directory}; - if (!::art::Exec(unzip_exec_argv, error_msg)) { - return false; - } - - std::vector<std::string> diff_exec_argv = - { "/usr/bin/diff", scratch_directory + "classes.dex" , dex_file_ + ".out" }; - if (!::art::Exec(diff_exec_argv, error_msg)) { - return false; - } - - std::vector<std::string> rm_exec_argv = { "/bin/rm", scratch_directory + "classes.dex" }; - if (!::art::Exec(rm_exec_argv, error_msg)) { - return false; - } - - return true; - } - std::string dex_file_; }; @@ -110,14 +75,7 @@ TEST_F(DexLayoutTest, FullPlainOutput) { // Disable test on target. TEST_DISABLED_FOR_TARGET(); std::string error_msg; - ASSERT_TRUE(FullPlainOutputExec(&error_msg)) << error_msg; -} - -TEST_F(DexLayoutTest, DexFileOutput) { - // Disable test on target. - TEST_DISABLED_FOR_TARGET(); - std::string error_msg; - ASSERT_TRUE(DexFileOutputExec(&error_msg)) << error_msg; + ASSERT_TRUE(Exec(&error_msg)) << error_msg; } } // namespace art |