Lines Matching refs:std
96 ScratchFile::ScratchFile(const std::string& filename) : filename_(filename) { in ScratchFile()
109 *this = std::move(other); in ScratchFile()
114 std::swap(filename_, other.filename_); in operator =()
115 std::swap(file_, other.file_); in operator =()
146 std::string CommonArtTestImpl::GetAndroidBuildTop() { in GetAndroidBuildTop()
148 std::string android_build_top; in GetAndroidBuildTop()
151 std::string argv; in GetAndroidBuildTop()
154 std::filesystem::path path(argv.substr(0, argv.find('\0'))); in GetAndroidBuildTop()
155 path = std::filesystem::absolute(path); in GetAndroidBuildTop()
159 if (path.filename() == std::filesystem::path("linux-x86")) { in GetAndroidBuildTop()
165 if (path.filename() == std::filesystem::path("testcases") || in GetAndroidBuildTop()
176 android_build_top = std::filesystem::path(android_build_top).string(); in GetAndroidBuildTop()
179 if (std::filesystem::weakly_canonical(android_build_top).string() != in GetAndroidBuildTop()
180 std::filesystem::weakly_canonical(android_build_top_from_env).string()) { in GetAndroidBuildTop()
194 std::string CommonArtTestImpl::GetAndroidHostOut() { in GetAndroidHostOut()
207 std::string android_host_out; in GetAndroidHostOut()
209 android_host_out = (std::filesystem::path(android_out_dir) / "host" / "linux-x86").string(); in GetAndroidHostOut()
212 (std::filesystem::path(GetAndroidBuildTop()) / android_out_dir / "host" / "linux-x86") in GetAndroidHostOut()
215 std::filesystem::path expected(android_host_out); in GetAndroidHostOut()
217 std::filesystem::path from_env(std::filesystem::weakly_canonical(android_host_out_from_env)); in GetAndroidHostOut()
218 if (std::filesystem::weakly_canonical(expected).string() != from_env.string()) { in GetAndroidHostOut()
231 std::string android_host_out = GetAndroidHostOut(); in SetUpAndroidRootEnvVars()
248 std::string android_i18n_root = android_host_out.c_str(); in SetUpAndroidRootEnvVars()
259 std::string android_art_root = android_host_out.c_str(); in SetUpAndroidRootEnvVars()
270 std::string android_tzdata_root = android_host_out.c_str(); in SetUpAndroidRootEnvVars()
279 void CommonArtTestImpl::SetUpAndroidDataDir(std::string& android_data) { in SetUpAndroidDataDir()
316 std::string system_ext_framework = android_system_ext_ + "/framework"; in SetUp()
333 void CommonArtTestImpl::TearDownAndroidDataDir(const std::string& android_data, in TearDownAndroidDataDir()
344 std::string CommonArtTestImpl::GetAndroidTool(const char* name, InstructionSet) { in GetAndroidTool()
350 std::string path = GetAndroidBuildTop() + ART_CLANG_PATH + "/bin/"; in GetAndroidTool()
358 std::string CommonArtTestImpl::GetCoreArtLocation() { in GetCoreArtLocation()
362 std::string CommonArtTestImpl::GetCoreOatLocation() { in GetCoreOatLocation()
366 std::unique_ptr<const DexFile> CommonArtTestImpl::LoadExpectSingleDexFile(const char* location) { in LoadExpectSingleDexFile()
367 std::vector<std::unique_ptr<const DexFile>> dex_files; in LoadExpectSingleDexFile()
368 std::string error_msg; in LoadExpectSingleDexFile()
372 std::string filename(IsHost() ? GetAndroidBuildTop() + location : location); in LoadExpectSingleDexFile()
374 std::string(location), in LoadExpectSingleDexFile()
383 return std::move(dex_files[0]); in LoadExpectSingleDexFile()
396 std::string filename(dirpath); in ClearDirectory()
429 static std::string GetDexFileName(const std::string& jar_prefix, bool host) { in GetDexFileName()
430 std::string prefix(host ? GetAndroidRoot() : ""); in GetDexFileName()
437 std::vector<std::string> CommonArtTestImpl::GetLibCoreModuleNames() const { in GetLibCoreModuleNames()
454 std::vector<std::string> CommonArtTestImpl::GetLibCoreDexFileNames( in GetLibCoreDexFileNames()
455 const std::vector<std::string>& modules) const { in GetLibCoreDexFileNames()
456 std::vector<std::string> result; in GetLibCoreDexFileNames()
458 for (const std::string& module : modules) { in GetLibCoreDexFileNames()
464 std::vector<std::string> CommonArtTestImpl::GetLibCoreDexFileNames() const { in GetLibCoreDexFileNames()
465 std::vector<std::string> modules = GetLibCoreModuleNames(); in GetLibCoreDexFileNames()
469 std::vector<std::string> CommonArtTestImpl::GetLibCoreDexLocations( in GetLibCoreDexLocations()
470 const std::vector<std::string>& modules) const { in GetLibCoreDexLocations()
471 std::vector<std::string> result = GetLibCoreDexFileNames(modules); in GetLibCoreDexLocations()
474 std::string prefix = GetAndroidBuildTop(); in GetLibCoreDexLocations()
475 for (std::string& location : result) { in GetLibCoreDexLocations()
485 std::vector<std::string> CommonArtTestImpl::GetLibCoreDexLocations() const { in GetLibCoreDexLocations()
486 std::vector<std::string> modules = GetLibCoreModuleNames(); in GetLibCoreDexLocations()
490 std::string CommonArtTestImpl::GetClassPathOption(const char* option, in GetClassPathOption()
491 const std::vector<std::string>& class_path) { in GetClassPathOption()
506 std::string CommonArtTestImpl::GetTestDexFileName(const char* name) const { in GetTestDexFileName()
509 std::string cmdline; in GetTestDexFileName()
514 std::string executable_dir = dirname(executable_path.get()); in GetTestDexFileName()
516 std::string path = executable_dir + "/art-gtest-jars-" + name + ext; in GetTestDexFileName()
525 std::vector<std::unique_ptr<const DexFile>> CommonArtTestImpl::OpenDexFiles(const char* filename) { in OpenDexFiles()
528 std::string error_msg; in OpenDexFiles()
530 std::vector<std::unique_ptr<const DexFile>> dex_files; in OpenDexFiles()
545 std::unique_ptr<const DexFile> CommonArtTestImpl::OpenDexFile(const char* filename) { in OpenDexFile()
546 std::vector<std::unique_ptr<const DexFile>> dex_files(OpenDexFiles(filename)); in OpenDexFile()
548 return std::move(dex_files[0]); in OpenDexFile()
551 std::vector<std::unique_ptr<const DexFile>> CommonArtTestImpl::OpenTestDexFiles( in OpenTestDexFiles()
556 std::unique_ptr<const DexFile> CommonArtTestImpl::OpenTestDexFile(const char* name) { in OpenTestDexFile()
560 std::string CommonArtTestImpl::GetImageDirectory() { in GetImageDirectory()
561 std::string path; in GetImageDirectory()
565 path = std::string(host_dir) + "/apex/art_boot_images"; in GetImageDirectory()
567 path = std::string(kAndroidArtApexDefaultPath); in GetImageDirectory()
572 std::string CommonArtTestImpl::GetCoreFileLocation(const char* suffix) { in GetCoreFileLocation()
577 std::string CommonArtTestImpl::CreateClassPath( in CreateClassPath()
578 const std::vector<std::unique_ptr<const DexFile>>& dex_files) { in CreateClassPath()
580 std::string classpath = dex_files[0]->GetLocation(); in CreateClassPath()
587 std::string CommonArtTestImpl::CreateClassPathWithChecksums( in CreateClassPathWithChecksums()
588 const std::vector<std::unique_ptr<const DexFile>>& dex_files) { in CreateClassPathWithChecksums()
590 std::string classpath = dex_files[0]->GetLocation() + "*" + in CreateClassPathWithChecksums()
591 std::to_string(dex_files[0]->GetLocationChecksum()); in CreateClassPathWithChecksums()
594 std::to_string(dex_files[i]->GetLocationChecksum()); in CreateClassPathWithChecksums()
600 const std::vector<std::string>& argv, in ForkAndExec()
607 std::vector<const char*> c_args; in ForkAndExec()
608 for (const std::string& str : argv) { in ForkAndExec()
671 const std::vector<std::string>& argv, const PostForkFn& post_fork, std::string* output) { in ForkAndExec()
673 *output += std::string(buf, len); in ForkAndExec()