diff options
author | 2021-12-01 16:51:20 -0800 | |
---|---|---|
committer | 2021-12-02 20:02:16 +0000 | |
commit | fb007611cab3dcd240b21730088f0fc87dd45bd1 (patch) | |
tree | 407a83cf063d76db8188e1f934eee2c0a00cd255 /libartbase/base/file_utils_test.cc | |
parent | 80f93a801329abce10971b0db2da1103023abbaa (diff) |
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
Diffstat (limited to 'libartbase/base/file_utils_test.cc')
-rw-r--r-- | libartbase/base/file_utils_test.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libartbase/base/file_utils_test.cc b/libartbase/base/file_utils_test.cc index 7678df40b0..913eedee03 100644 --- a/libartbase/base/file_utils_test.cc +++ b/libartbase/base/file_utils_test.cc @@ -178,6 +178,14 @@ TEST_F(FileUtilsTest, ReplaceFileExtension) { EXPECT_EQ("/.directory/file.vdex", ReplaceFileExtension("/.directory/file", "vdex")); } +TEST_F(FileUtilsTest, ArtApexDataPath) { + ScopedUnsetEnvironmentVariable no_env("ART_APEX_DATA"); + EXPECT_EQ(kArtApexDataDefaultPath, GetArtApexData()); + + setenv("ART_APEX_DATA", "/path/from/env", /* overwrite */ 1); + EXPECT_EQ("/path/from/env", GetArtApexData()); +} + TEST_F(FileUtilsTest, GetApexDataOatFilename) { ScopedUnsetEnvironmentVariable android_root("ANDROID_ROOT"); ScopedUnsetEnvironmentVariable i18n_root("ANDROID_I18N_ROOT"); |