diff options
author | Robert Marcus <ramarcus@google.com> | 2023-07-21 20:58:20 +0000 |
---|---|---|
committer | Robert Marcus <ramarcus@google.com> | 2023-07-21 20:59:20 +0000 |
commit | 35b28a503b24937f56c11e4de4d7aba18e225c1a (patch) | |
tree | e608268333f5bb4ff702fe92fe159515e84604f2 /native | |
parent | 61704905f2aeb40b0f506fe889bc4c2eb526fdb8 (diff) | |
download | libtextclassifier-35b28a503b24937f56c11e4de4d7aba18e225c1a.tar.gz |
Update tplus to have min_sdk_version 33
Test: presubmit
Bug: 291775136
Bug: 292157828
Change-Id: Ibc1309a97665343ab7bfff4405a8fce9b7ac003b
Diffstat (limited to 'native')
-rw-r--r-- | native/Android.bp | 44 | ||||
-rw-r--r-- | native/AndroidTest-sminus.xml | 48 | ||||
-rw-r--r-- | native/AndroidTest-tplus.xml (renamed from native/AndroidTest.xml) | 10 |
3 files changed, 98 insertions, 4 deletions
diff --git a/native/Android.bp b/native/Android.bp index efea632..f482b84 100644 --- a/native/Android.bp +++ b/native/Android.bp @@ -252,7 +252,7 @@ cc_library { // libtextclassifier_tests // ----------------------- cc_test { - name: "libtextclassifier_tests", + name: "libtextclassifier_tests-tplus", defaults: ["libtextclassifier_defaults"], test_suites: ["general-tests", "mts-extservices"], @@ -289,6 +289,48 @@ cc_test { }, // A workaround for code coverage. See b/166040889#comment23 sdk_variant_only: true, + test_config: "AndroidTest-tplus.xml", +} + +cc_test { + name: "libtextclassifier_tests-sminus", + defaults: ["libtextclassifier_defaults"], + + test_suites: ["general-tests", "mts-extservices"], + + data: [ + "**/test_data/*", + "**/*.bfbs", + ], + + srcs: ["**/*.cc"], + exclude_srcs: [":libtextclassifier_java_test_sources"], + + header_libs: ["jni_headers"], + + static_libs: [ + "libgmock_ndk", + "libgtest_ndk_c++", + "libbase_ndk", + ], + + generated_headers: [ + "libtextclassifier_fbgen_utils_flatbuffers_flatbuffers_test", + "libtextclassifier_fbgen_utils_lua_utils_tests", + ], + + compile_multilib: "both", + multilib: { + lib32: { + suffix: "32", + }, + lib64: { + suffix: "64", + }, + }, + // A workaround for code coverage. See b/166040889#comment23 + sdk_variant_only: true, + test_config: "AndroidTest-sminus.xml", } // ------------------------------------ diff --git a/native/AndroidTest-sminus.xml b/native/AndroidTest-sminus.xml new file mode 100644 index 0000000..b4c8628 --- /dev/null +++ b/native/AndroidTest-sminus.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<configuration description="Config for libtextclassifier_tests-sminus"> + <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.extservices.apex" /> + <option name="test-suite-tag" value="apct" /> + <option name="test-suite-tag" value="mts" /> + + <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> + <option name="cleanup" value="true" /> + <option name="push" value="libtextclassifier_tests-sminus->/data/local/tmp/libtextclassifier_tests-sminus" /> + <option name="append-bitness" value="true" /> + </target_preparer> + + <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> + <option name="cleanup" value="true" /> + <option name="push" value="actions->/data/local/tmp/actions" /> + <option name="push" value="annotator->/data/local/tmp/annotator" /> + <option name="push" value="utils->/data/local/tmp/utils" /> + </target_preparer> + + <test class="com.android.tradefed.testtype.GTest" > + <option name="native-test-device-path" value="/data/local/tmp" /> + <option name="module-name" value="libtextclassifier_tests-sminus" /> + </test> + + <!-- Prevent test from running on Android T+ --> + <object type="module_controller" + class="com.android.tradefed.testtype.suite.module.MaxSdkModuleController"> + <option name="max-sdk-level" value="32"/> + </object> + + <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController"> + <option name="mainline-module-package-name" value="com.google.android.extservices" /> + </object> +</configuration> diff --git a/native/AndroidTest.xml b/native/AndroidTest-tplus.xml index 4ca0418..3c35ebb 100644 --- a/native/AndroidTest.xml +++ b/native/AndroidTest-tplus.xml @@ -13,14 +13,14 @@ See the License for the specific language governing permissions and limitations under the License. --> -<configuration description="Config for libtextclassifier_tests"> +<configuration description="Config for libtextclassifier_tests-tplus"> <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.extservices_tplus.apex" /> <option name="test-suite-tag" value="apct" /> <option name="test-suite-tag" value="mts" /> <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> <option name="cleanup" value="true" /> - <option name="push" value="libtextclassifier_tests->/data/local/tmp/libtextclassifier_tests" /> + <option name="push" value="libtextclassifier_tests-tplus->/data/local/tmp/libtextclassifier_tests-tplus" /> <option name="append-bitness" value="true" /> </target_preparer> @@ -33,9 +33,13 @@ <test class="com.android.tradefed.testtype.GTest" > <option name="native-test-device-path" value="/data/local/tmp" /> - <option name="module-name" value="libtextclassifier_tests" /> + <option name="module-name" value="libtextclassifier_tests-tplus" /> </test> + <!-- Prevent tests from running on Android S- --> + <object type="module_controller" + class="com.android.tradefed.testtype.suite.module.Sdk32ModuleController"/> + <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController"> <option name="mainline-module-package-name" value="com.google.android.extservices" /> </object> |