Lines Matching refs:std

54   int GenerateOdexForTestWithStatus(const std::string& dex_location,  in GenerateOdexForTestWithStatus()
55 const std::string& odex_location, in GenerateOdexForTestWithStatus()
57 std::string* error_msg, in GenerateOdexForTestWithStatus()
58 const std::vector<std::string>& extra_args = {}, in GenerateOdexForTestWithStatus()
60 std::unique_ptr<File> oat_file;
61 std::vector<std::string> args;
66 args.push_back("--oat-fd=" + std::to_string(oat_file->Fd()));
84 void GenerateOdexForTest(const std::string& dex_location, in GenerateOdexForTest()
85 const std::string& odex_location, in GenerateOdexForTest()
87 const std::vector<std::string>& extra_args = {}, in GenerateOdexForTest()
90 std::string error_msg;
99 ASSERT_TRUE(success) << error_msg << std::endl << output_;
102 std::unique_ptr<OatFile> odex_file(OatFile::Open(odex_location.c_str(),
119 std::unique_ptr<OatFile> odex_file(OatFile::Open(odex_location.c_str(),
137 int Dex2Oat(const std::vector<std::string>& dex2oat_args, std::string* error_msg) { in Dex2Oat()
140 const std::vector<gc::space::ImageSpace*>& image_spaces = in Dex2Oat()
146 std::string image_location = image_spaces[0]->GetImageLocation(); in Dex2Oat()
148 std::vector<std::string> argv; in Dex2Oat()
153 std::string class_path = runtime->GetClassPathString(); in Dex2Oat()
181 std::vector<std::string> compiler_options = runtime->GetCompilerOptions(); in Dex2Oat()
189 argv.push_back("--android-root=" + std::string(android_root)); in Dex2Oat()
208 std::vector<const char*> c_args; in Dex2Oat()
209 for (const std::string& str : argv) { in Dex2Oat()
223 output_ += std::string(buffer, bytes_read); in Dex2Oat()
234 std::string output_ = "";
235 std::string error_msg_ = "";
241 void RunTest(bool use_fd, bool expect_use, const std::vector<std::string>& extra_args = {}) { in RunTest()
242 std::string dex_location = GetScratchDir() + "/Dex2OatSwapTest.jar";
243 std::string odex_location = GetOdexDir() + "/Dex2OatSwapTest.odex";
247 std::vector<std::string> copy(extra_args);
249 std::unique_ptr<ScratchFile> sf;
254 std::string swap_location = GetOdexDir() + "/Dex2OatSwapTest.odex.swap";
264 virtual std::string GetTestDexFileName() { in GetTestDexFileName()
285 EXPECT_NE(output_.find("Large app, accepted running with swap."), std::string::npos) in CheckHostResult()
288 EXPECT_EQ(output_.find("Large app, accepted running with swap."), std::string::npos) in CheckHostResult()
311 EXPECT_NE(output_.find("dex2oat took"), std::string::npos) << output_; in CheckHostValidity()
344 EXPECT_NE(output_.find("Large app, accepted running with swap."), std::string::npos) in CheckHostResult()
347 EXPECT_EQ(output_.find("Large app, accepted running with swap."), std::string::npos) in CheckHostResult()
353 std::string GetTestDexFileName() OVERRIDE { in GetTestDexFileName()
363 native_alloc_1_ = std::numeric_limits<size_t>::max(); in GrabResult1()
374 swap_2_ = std::numeric_limits<size_t>::max(); in GrabResult2()
380 std::regex native_alloc_regex("dex2oat took.*native alloc=[^ ]+ \\(([0-9]+)B\\)"); in ParseNativeAlloc()
381 std::smatch native_alloc_match; in ParseNativeAlloc()
382 bool found = std::regex_search(output_, native_alloc_match, native_alloc_regex); in ParseNativeAlloc()
392 std::istringstream stream(native_alloc_match[1].str()); in ParseNativeAlloc()
400 std::regex swap_regex("dex2oat took[^\\n]+swap=[^ ]+ \\(([0-9]+)B\\)"); in ParseSwap()
401 std::smatch swap_match; in ParseSwap()
402 bool found = std::regex_search(output_, swap_match, swap_regex); in ParseSwap()
417 std::istringstream stream(swap_match[1].str()); in ParseSwap()
441 std::string output_1 = output_; in TEST_F()
449 std::string output_2 = output_; in TEST_F()
469 const std::vector<std::string>& extra_args = {}) { in RunTest()
470 std::string dex_location = GetScratchDir() + "/DexNoOat.jar";
471 std::string odex_location = GetOdexDir() + "/DexOdexNoOat.odex";
482 void CheckResult(const std::string& dex_location, in CheckResult()
483 const std::string& odex_location, in CheckResult()
487 std::string error_msg; in CheckResult()
488 std::unique_ptr<OatFile> odex_file(OatFile::Open(odex_location.c_str(), in CheckResult()
506 std::unique_ptr<const DexFile> dex_file = oat_dex_file->OpenDexFile(&error_msg); in CheckResult()
509 ASSERT_LT(class_def_count, std::numeric_limits<uint16_t>::max()); in CheckResult()
540 std::string::npos) in CheckHostResult()
544 std::string::npos) in CheckHostResult()
565 EXPECT_NE(output_.find("dex2oat took"), std::string::npos) << output_; in CheckHostValidity()
602 void GenerateProfile(const std::string& test_profile, in GenerateProfile()
603 const std::string& dex_location, in GenerateProfile()
610 std::string profile_key = ProfileCompilationInfo::GetProfileDexFileKey(dex_location); in GenerateProfile()
619 void CompileProfileOdex(const std::string& dex_location, in CompileProfileOdex()
620 const std::string& odex_location, in CompileProfileOdex()
621 const std::string& app_image_file_name, in CompileProfileOdex()
624 const std::vector<std::string>& extra_args = {}, in CompileProfileOdex()
626 const std::string profile_location = GetScratchDir() + "/primary.prof";
628 std::string error_msg;
629 std::vector<std::unique_ptr<const DexFile>> dex_files;
632 std::unique_ptr<const DexFile>& dex_file = dex_files[0];
637 std::vector<std::string> copy(extra_args);
639 std::unique_ptr<File> app_image_file;
643 copy.push_back("--app-image-fd=" + std::to_string(app_image_file->Fd()));
659 uint64_t GetImageSize(const std::string& image_file_name) { in GetImageSize()
661 std::unique_ptr<File> file(OS::OpenFileForReading(image_file_name.c_str())); in GetImageSize()
672 std::string dex_location = GetScratchDir() + "/DexNoOat.jar"; in RunTest()
673 std::string odex_location = GetOdexDir() + "/DexOdexNoOat.odex"; in RunTest()
674 std::string app_image_file = app_image ? (GetOdexDir() + "/DexOdexNoOat.art"): ""; in RunTest()
709 std::string dex_location = GetScratchDir() + "/DexNoOat.jar"; in RunTestVDex()
710 std::string odex_location = GetOdexDir() + "/DexOdexNoOat.odex"; in RunTestVDex()
711 std::string vdex_location = GetOdexDir() + "/DexOdexNoOat.vdex"; in RunTestVDex()
712 std::string app_image_file_name = GetOdexDir() + "/DexOdexNoOat.art"; in RunTestVDex()
715 std::unique_ptr<File> vdex_file1(OS::CreateEmptyFile(vdex_location.c_str())); in RunTestVDex()
719 std::string input_vdex = "--input-vdex-fd=-1"; in RunTestVDex()
720 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_file1->Fd()); in RunTestVDex()
731 std::string input_vdex = StringPrintf("--input-vdex-fd=%d", vdex_file1->Fd()); in RunTestVDex()
732 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_file2.GetFd()); in RunTestVDex()
747 void CheckResult(const std::string& dex_location, in CheckResult()
748 const std::string& odex_location, in CheckResult()
749 const std::string& app_image_file_name) { in CheckResult()
751 std::string error_msg; in CheckResult()
752 std::unique_ptr<OatFile> odex_file(OatFile::Open(odex_location.c_str(), in CheckResult()
763 std::vector<std::unique_ptr<const DexFile>> dex_files; in CheckResult()
766 std::unique_ptr<const DexFile>& old_dex_file = dex_files[0]; in CheckResult()
769 std::unique_ptr<const DexFile> new_dex_file = oat_dex_file->OpenDexFile(&error_msg); in CheckResult()
772 ASSERT_LT(class_def_count, std::numeric_limits<uint16_t>::max()); in CheckResult()
776 std::string old_class0 = old_dex_file->PrettyType(old_dex_file->GetClassDef(0).class_idx_); in CheckResult()
777 std::string old_class1 = old_dex_file->PrettyType(old_dex_file->GetClassDef(1).class_idx_); in CheckResult()
778 std::string new_class0 = new_dex_file->PrettyType(new_dex_file->GetClassDef(0).class_idx_); in CheckResult()
779 std::string new_class1 = new_dex_file->PrettyType(new_dex_file->GetClassDef(1).class_idx_); in CheckResult()
788 std::unique_ptr<File> file(OS::OpenFileForReading(app_image_file_name.c_str())); in CheckResult()
812 EXPECT_NE(output_.find("dex2oat took"), std::string::npos) << output_; in CheckHostValidity()
830 void RunTest(bool expect_success, const std::vector<std::string>& extra_args = {}) { in RunTest()
831 std::string dex_location = GetScratchDir() + "/Dex2OatSwapTest.jar";
832 std::string odex_location = GetOdexDir() + "/Dex2OatSwapTest.odex";
836 std::vector<std::string> copy(extra_args);
838 std::string swap_location = GetOdexDir() + "/Dex2OatSwapTest.odex.swap";
847 std::string GetTestDexFileName() { in GetTestDexFileName()
867 int RunTest(const std::vector<std::string>& extra_args = {}) { in RunTest()
868 std::string dex_location = GetScratchDir() + "/Dex2OatSwapTest.jar";
869 std::string odex_location = GetOdexDir() + "/Dex2OatSwapTest.odex";
873 std::string error_msg;
881 std::string GetTestDexFileName() { in GetTestDexFileName()