diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-01-19 22:33:05 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-01-19 22:33:05 +0000 |
commit | 3ffca0ea884685983b5ae76463db19da4a217508 (patch) | |
tree | bba4343fd111663d9d894f96130c125f2199707d | |
parent | c2fb595c9091234c50cc536a7cd0185ab78dadc5 (diff) | |
parent | efbfe6ba53252e6bf6619e6e7fc91d22e7399771 (diff) | |
download | ndk-snap-temp-L97400000958241577.tar.gz |
Merge "Fix build/runtime API level for static exe tests." into snap-temp-L97400000958241577snap-temp-L97400000958241577
4 files changed, 27 insertions, 12 deletions
diff --git a/tests/device/static-executable-exceptions/jni/Application.mk b/tests/device/static-executable-exceptions/jni/Application.mk index 2133d20c6..9ec531a2a 100644 --- a/tests/device/static-executable-exceptions/jni/Application.mk +++ b/tests/device/static-executable-exceptions/jni/Application.mk @@ -1 +1 @@ -APP_PLATFORM := android-21 +APP_PLATFORM := latest diff --git a/tests/device/static-executable-exceptions/test_config.py b/tests/device/static-executable-exceptions/test_config.py index 9eea1ae14..59c5cabde 100644 --- a/tests/device/static-executable-exceptions/test_config.py +++ b/tests/device/static-executable-exceptions/test_config.py @@ -1,7 +1,13 @@ -def build_unsupported(test): - # Static executables with libc++ require targeting a new enough API level - # to not need libandroid_support. - if test.config.api < 21: - return f"android-{test.config.api}" +import ndk.abis +from ndk.test.buildtest.case import Test - return None + +def extra_cmake_flags() -> list[str]: + # Required for static executables. + return ["-DANDROID_PLATFORM=latest"] + + +def override_runtime_minsdkversion(test: Test) -> int | None: + # We build as latest because static executables require that, but static executables + # are compatible with old OS versions. + return ndk.abis.min_api_for_abi(test.config.abi) diff --git a/tests/device/static-executable/jni/Application.mk b/tests/device/static-executable/jni/Application.mk new file mode 100644 index 000000000..9ec531a2a --- /dev/null +++ b/tests/device/static-executable/jni/Application.mk @@ -0,0 +1 @@ +APP_PLATFORM := latest diff --git a/tests/device/static-executable/test_config.py b/tests/device/static-executable/test_config.py index 481aecaba..59c5cabde 100644 --- a/tests/device/static-executable/test_config.py +++ b/tests/device/static-executable/test_config.py @@ -1,5 +1,13 @@ -def extra_cmake_flags(): - # Match the ndk-build test. Using libc++ here would require us to target a - # newer API level since static executables and libandroid_support don't - # mix. - return ["-DANDROID_STL=system"] +import ndk.abis +from ndk.test.buildtest.case import Test + + +def extra_cmake_flags() -> list[str]: + # Required for static executables. + return ["-DANDROID_PLATFORM=latest"] + + +def override_runtime_minsdkversion(test: Test) -> int | None: + # We build as latest because static executables require that, but static executables + # are compatible with old OS versions. + return ndk.abis.min_api_for_abi(test.config.abi) |