diff options
author | 2022-10-06 11:26:27 +0100 | |
---|---|---|
committer | 2022-10-23 12:40:33 +0000 | |
commit | 895c27039a57ec19efc8f526ac17b1ae28e2edd9 (patch) | |
tree | 27081408e36ab016cacd2152d65703a3dbdb98a1 /test/etc/apex_bootclasspath_utils.py | |
parent | 6f78517b8de12bac6fc2015ffaaab712347aea59 (diff) |
Convert per-test run scripts to python.
Test: test.py -r --all-target
Test: diff emitted test commands before and after
Change-Id: I05003b5cde0e39ffc7d037ef875a45f13dd83755
Diffstat (limited to 'test/etc/apex_bootclasspath_utils.py')
-rwxr-xr-x | test/etc/apex_bootclasspath_utils.py | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/test/etc/apex_bootclasspath_utils.py b/test/etc/apex_bootclasspath_utils.py index f969b149b2..d2415e5d3d 100755 --- a/test/etc/apex_bootclasspath_utils.py +++ b/test/etc/apex_bootclasspath_utils.py @@ -23,10 +23,9 @@ import os, sys # Note: This must start with the CORE_IMG_JARS in Android.common_path.mk # because that's what we use for compiling the boot.art image. # It may contain additional modules from TEST_CORE_JARS. -bpath_modules="core-oj core-libart okhttp bouncycastle apache-xml core-icu4j conscrypt" +bpath_modules = ("core-oj core-libart okhttp bouncycastle apache-xml core-icu4j" + " conscrypt") -ANDROID_BUILD_TOP=os.environ["ANDROID_BUILD_TOP"] -ANDROID_HOST_OUT=os.environ["ANDROID_HOST_OUT"] # Helper function to construct paths for apex modules (for both -Xbootclasspath and # -Xbootclasspath-location). @@ -34,40 +33,44 @@ ANDROID_HOST_OUT=os.environ["ANDROID_HOST_OUT"] # Arguments. # ${1}: path prefix. def get_apex_bootclasspath_impl(bpath_prefix: str): - bpath_separator="" - bpath="" - bpath_jar="" + bpath_separator = "" + bpath = "" + bpath_jar = "" for bpath_module in bpath_modules.split(" "): - apex_module="com.android.art" + apex_module = "com.android.art" if bpath_module == "conscrypt": - apex_module="com.android.conscrypt" + apex_module = "com.android.conscrypt" if bpath_module == "core-icu4j": - apex_module="com.android.i18n" - bpath_jar=f"/apex/{apex_module}/javalib/{bpath_module}.jar" - bpath+=f"{bpath_separator}{bpath_prefix}{bpath_jar}" - bpath_separator=":" + apex_module = "com.android.i18n" + bpath_jar = f"/apex/{apex_module}/javalib/{bpath_module}.jar" + bpath += f"{bpath_separator}{bpath_prefix}{bpath_jar}" + bpath_separator = ":" return bpath + # Gets a -Xbootclasspath paths with the apex modules. # # Arguments. # ${1}: host (y|n). def get_apex_bootclasspath(host: bool): - bpath_prefix="" + bpath_prefix = "" if host: - bpath_prefix=ANDROID_HOST_OUT + bpath_prefix = os.environ["ANDROID_HOST_OUT"] return get_apex_bootclasspath_impl(bpath_prefix) + # Gets a -Xbootclasspath-location paths with the apex modules. # # Arguments. # ${1}: host (y|n). def get_apex_bootclasspath_locations(host: bool): - bpath_location_prefix="" + bpath_location_prefix = "" if host: + ANDROID_BUILD_TOP=os.environ["ANDROID_BUILD_TOP"] + ANDROID_HOST_OUT=os.environ["ANDROID_HOST_OUT"] if ANDROID_HOST_OUT[0:len(ANDROID_BUILD_TOP)+1] == f"{ANDROID_BUILD_TOP}/": bpath_location_prefix=ANDROID_HOST_OUT[len(ANDROID_BUILD_TOP)+1:] else: |