Re-enable dex2oat_test copying dex test case for target
Also clean up some comments.
Bug: 70934104
Test: mm test-art-target-gtest-dex2oat_test -j64
Test: mm test-art-host-gtest-dex2oat_test -j64
Change-Id: I8b42848a85644e265ef7392c601757ee9ffa6157
diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc
index 12cfd24..6d3658f 100644
--- a/dex2oat/dex2oat_test.cc
+++ b/dex2oat/dex2oat_test.cc
@@ -1850,23 +1850,25 @@
GenerateOdexForTest(dex_location,
odex_location,
CompilerFilter::Filter::kQuicken,
- { "--dump-timings", "--dm-file=" + dm_file.GetFilename() },
+ { "--dump-timings",
+ "--dm-file=" + dm_file.GetFilename(),
+ // Pass -Xuse-stderr-logger have dex2oat output in output_ on target.
+ "--runtime-arg",
+ "-Xuse-stderr-logger" },
true, // expect_success
false, // use_fd
[](const OatFile& o) {
CHECK(o.ContainsDexCode());
});
- if (!kIsTargetBuild) {
- // The output_ variable is not correctly set for target, TODO: investigate.
- std::istringstream iss(output_);
- std::string line;
- bool found_fast_verify = false;
- const std::string kFastVerifyString = "Fast Verify";
- while (std::getline(iss, line) && !found_fast_verify) {
- found_fast_verify = found_fast_verify || line.find(kFastVerifyString) != std::string::npos;
- }
- EXPECT_TRUE(found_fast_verify) << "Expected to find " << kFastVerifyString << "\n" << output_;
+ // Check the output for "Fast verify", this is printed from --dump-timings.
+ std::istringstream iss(output_);
+ std::string line;
+ bool found_fast_verify = false;
+ const std::string kFastVerifyString = "Fast Verify";
+ while (std::getline(iss, line) && !found_fast_verify) {
+ found_fast_verify = found_fast_verify || line.find(kFastVerifyString) != std::string::npos;
}
+ EXPECT_TRUE(found_fast_verify) << "Expected to find " << kFastVerifyString << "\n" << output_;
}
} // namespace art
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index 09f9010..ee872db 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -3348,9 +3348,8 @@
vdex_dex_files_offset_ = vdex_size_;
- extract_dex_files_into_vdex_ = copy_dex_files;
// If extraction is enabled, only do it if not all the dex files are aligned and uncompressed.
- if (extract_dex_files_into_vdex_) {
+ if (copy_dex_files) {
extract_dex_files_into_vdex_ = false;
for (OatDexFile& oat_dex_file : oat_dex_files_) {
if (!oat_dex_file.source_.IsZipEntry()) {
@@ -3363,6 +3362,8 @@
break;
}
}
+ } else {
+ extract_dex_files_into_vdex_ = false;
}
if (extract_dex_files_into_vdex_) {