forked from LineageOS/android_art
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect ART_APEX_DATA for default artifact dir
This change does not change the default artifact directory. It just makes odrefresh not define the default directory by itself, but relies on GetArtApexData from libartbase instead (which has the same default). Bug: 206468124 Test: Run odrefresh in the VM. No longer seeing files in the hard-coded directory. Test: atest art_standalone_odrefresh_tests Test: atest art_standalone_libartbase_tests Change-Id: I45bcc145dbccb3b953f359f6c10fa186f251600c
- Loading branch information
1 parent
80f93a8
commit fb00761
Showing
9 changed files
with
38 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,11 @@ | |
namespace art { | ||
namespace odrefresh { | ||
|
||
static constexpr const char* kOdrefreshArtifactDirectory = "/test/dir"; | ||
|
||
TEST(OdrArtifactsTest, ForBootImageExtension) { | ||
ScopedUnsetEnvironmentVariable no_env("ART_APEX_DATA"); | ||
setenv("ART_APEX_DATA", kOdrefreshArtifactDirectory, /* overwrite */ 1); | ||
|
||
const std::string image_location = GetApexDataBootImage("/system/framework/framework.jar"); | ||
EXPECT_TRUE(StartsWith(image_location, GetArtApexData())); | ||
|
@@ -35,16 +38,17 @@ TEST(OdrArtifactsTest, ForBootImageExtension) { | |
GetSystemImageFilename(image_location.c_str(), InstructionSet::kArm64); | ||
|
||
const auto artifacts = OdrArtifacts::ForBootImageExtension(image_filename); | ||
CHECK_EQ(std::string(kOdrefreshArtifactDirectory) + "/arm64/boot-framework.art", | ||
CHECK_EQ(std::string(kOdrefreshArtifactDirectory) + "/dalvik-cache/arm64/boot-framework.art", | ||
artifacts.ImagePath()); | ||
CHECK_EQ(std::string(kOdrefreshArtifactDirectory) + "/arm64/boot-framework.oat", | ||
CHECK_EQ(std::string(kOdrefreshArtifactDirectory) + "/dalvik-cache/arm64/boot-framework.oat", | ||
artifacts.OatPath()); | ||
CHECK_EQ(std::string(kOdrefreshArtifactDirectory) + "/arm64/boot-framework.vdex", | ||
CHECK_EQ(std::string(kOdrefreshArtifactDirectory) + "/dalvik-cache/arm64/boot-framework.vdex", | ||
artifacts.VdexPath()); | ||
} | ||
|
||
TEST(OdrArtifactsTest, ForSystemServer) { | ||
ScopedUnsetEnvironmentVariable no_env("ART_APEX_DATA"); | ||
setenv("ART_APEX_DATA", kOdrefreshArtifactDirectory, /* overwrite */ 1); | ||
|
||
const std::string image_location = GetApexDataImage("/system/framework/services.jar"); | ||
EXPECT_TRUE(StartsWith(image_location, GetArtApexData())); | ||
|
@@ -53,13 +57,13 @@ TEST(OdrArtifactsTest, ForSystemServer) { | |
GetSystemImageFilename(image_location.c_str(), InstructionSet::kX86); | ||
const auto artifacts = OdrArtifacts::ForSystemServer(image_filename); | ||
CHECK_EQ( | ||
std::string(kOdrefreshArtifactDirectory) + "/x86/system@[email protected]@classes.art", | ||
std::string(kOdrefreshArtifactDirectory) + "/dalvik-cache/x86/system@[email protected]@classes.art", | ||
artifacts.ImagePath()); | ||
CHECK_EQ( | ||
std::string(kOdrefreshArtifactDirectory) + "/x86/system@[email protected]@classes.odex", | ||
std::string(kOdrefreshArtifactDirectory) + "/dalvik-cache/x86/system@[email protected]@classes.odex", | ||
artifacts.OatPath()); | ||
CHECK_EQ( | ||
std::string(kOdrefreshArtifactDirectory) + "/x86/system@[email protected]@classes.vdex", | ||
std::string(kOdrefreshArtifactDirectory) + "/dalvik-cache/x86/system@[email protected]@classes.vdex", | ||
artifacts.VdexPath()); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters