Update tplus to have min_sdk_version 33 am: 35b28a503b
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/libtextclassifier/+/24161296
Change-Id: I0d2fab5ea1eedf7346c2cbb87610cd1c076a4f56
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/TEST_MAPPING b/TEST_MAPPING
index e0f1900..35a11fd 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -9,7 +9,10 @@
]
},
{
- "name": "libtextclassifier_tests"
+ "name": "libtextclassifier_tests-tplus"
+ },
+ {
+ "name": "libtextclassifier_tests-sminus"
},
{
"name": "libtextclassifier_java_tests"
@@ -36,7 +39,10 @@
]
},
{
- "name": "libtextclassifier_tests"
+ "name": "libtextclassifier_tests-tplus"
+ },
+ {
+ "name": "libtextclassifier_tests-sminus"
},
{
"name": "libtextclassifier_java_tests"
@@ -53,10 +59,22 @@
"name": "TextClassifierServiceTest[com.google.android.extservices_tplus.apex]"
},
{
- "name": "libtextclassifier_tests[com.google.android.extservices_tplus.apex]"
+ "name": "libtextclassifier_tests-tplus[com.google.android.extservices_tplus.apex]"
},
{
"name": "libtextclassifier_java_tests[com.google.android.extservices_tplus.apex]"
+ },
+ {
+ "name": "TextClassifierNotificationTests[com.google.android.extservices.apex]"
+ },
+ {
+ "name": "TextClassifierServiceTest[com.google.android.extservices.apex]"
+ },
+ {
+ "name": "libtextclassifier_tests-sminus[com.google.android.extservices.apex]"
+ },
+ {
+ "name": "libtextclassifier_java_tests[com.google.android.extservices.apex]"
}
]
}
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 @@
// libtextclassifier_tests
// -----------------------
cc_test {
- name: "libtextclassifier_tests",
+ name: "libtextclassifier_tests-tplus",
defaults: ["libtextclassifier_defaults"],
test_suites: ["general-tests", "mts-extservices"],
@@ -289,6 +289,48 @@
},
// 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.xml b/native/AndroidTest-sminus.xml
similarity index 76%
copy from native/AndroidTest.xml
copy to native/AndroidTest-sminus.xml
index 4ca0418..b4c8628 100644
--- a/native/AndroidTest.xml
+++ b/native/AndroidTest-sminus.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017 The Android Open Source Project
+<!-- 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.
@@ -13,14 +13,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<configuration description="Config for libtextclassifier_tests">
- <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.extservices_tplus.apex" />
+<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->/data/local/tmp/libtextclassifier_tests" />
+ <option name="push" value="libtextclassifier_tests-sminus->/data/local/tmp/libtextclassifier_tests-sminus" />
<option name="append-bitness" value="true" />
</target_preparer>
@@ -33,9 +33,15 @@
<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-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>
diff --git a/native/AndroidTest.xml b/native/AndroidTest-tplus.xml
similarity index 83%
rename from native/AndroidTest.xml
rename to 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>