summaryrefslogtreecommitdiff
path: root/test/run_test_build.py
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2022-11-16 20:31:11 +0000
committer David Srbecky <dsrbecky@google.com> 2022-11-17 11:01:22 +0000
commite82c87deb52ce0a6bbcaa2dbb37db0e253555d16 (patch)
treebd657b311ac31e41b04723ffffc97a3161fc4bea /test/run_test_build.py
parent6c9c12128f929f535995943fac58e2efba51921f (diff)
Run test build: Rename 'experimental' to 'api_level'
The purpose of the 'experimental' flag is to provide named API level. Allow the API level to be string or integer instead. Test: Build artifacts are identical as before. Change-Id: I15a78979783c1a9237ba9814a48171349e4e5a00
Diffstat (limited to 'test/run_test_build.py')
-rwxr-xr-xtest/run_test_build.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/run_test_build.py b/test/run_test_build.py
index 689b193d08..b7381dd608 100755
--- a/test/run_test_build.py
+++ b/test/run_test_build.py
@@ -111,10 +111,9 @@ class BuildTestContext:
use_desugar=True,
use_hiddenapi=True,
need_dex=None,
- experimental="no-experiment",
zip_compression_method="deflate",
zip_align_bytes=None,
- api_level=None,
+ api_level:Union[int, str]=26, # Can also be named alias (string).
javac_args=[],
d8_flags=[],
smali_args=[],
@@ -136,19 +135,16 @@ class BuildTestContext:
use_desugar = False
# Set API level for smali and d8.
- if api_level:
- assert isinstance(api_level, int), api_level
- assert experimental == "no-experiment", experimental
- else:
- experiment2api_level = {
- "no-experiment": 26,
+ if isinstance(api_level, str):
+ API_LEVEL = {
"default-methods": 24,
"parameter-annotations": 25,
"agents": 26,
"method-handles": 26,
"var-handles": 28,
}
- api_level = experiment2api_level[experimental]
+ api_level = API_LEVEL[api_level]
+ assert isinstance(api_level, int), api_level
def run(executable: pathlib.Path, args: List[str]):
assert isinstance(executable, pathlib.Path), executable