summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-15 09:23:48 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-15 09:23:48 +0000
commitb63b97e46a9028f8938f3fd2321964ac02952d5f (patch)
tree1c16e5651a30d05485cde6fda127bef8d20087f6
parent067eb2fc8b65c806885518ce9d772b0a27a26a14 (diff)
parentdc6eff193d61657e4c6c6a33daf0808add91986c (diff)
downloadlibtextclassifier-aml_tz5_341510010.tar.gz
Snap for 11224086 from dc6eff193d61657e4c6c6a33daf0808add91986c to mainline-tzdata5-releaseaml_tz5_341510050aml_tz5_341510010aml_tz5_341510010
Change-Id: I25c68e11efb308f076018b62d64b928d2af0bfdb
-rw-r--r--TEST_MAPPING24
-rw-r--r--native/Android.bp46
-rw-r--r--native/AndroidTest-sminus.xml48
-rw-r--r--native/AndroidTest-tplus.xml (renamed from native/AndroidTest.xml)12
4 files changed, 122 insertions, 8 deletions
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 17a31d4..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"
@@ -47,13 +53,25 @@
],
"mainline-presubmit": [
{
+ "name": "TextClassifierNotificationTests[com.google.android.extservices_tplus.apex]"
+ },
+ {
+ "name": "TextClassifierServiceTest[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[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..a57df61 100644
--- a/native/Android.bp
+++ b/native/Android.bp
@@ -30,6 +30,7 @@ cc_library_headers {
"//apex_available:platform",
"com.android.neuralnetworks",
"test_com.android.neuralnetworks",
+ "com.android.ondevicepersonalization",
],
min_sdk_version: "apex_inherit",
sdk_version: "current",
@@ -69,6 +70,7 @@ cc_library_static {
"test_com.android.neuralnetworks",
"com.android.extservices",
"com.android.adservices",
+ "com.android.ondevicepersonalization",
],
}
@@ -252,7 +254,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 +291,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 15ce73e..ab2749c 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">
- <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.extservices.apex" />
+<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.Sdk33ModuleController"/>
+
<object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
<option name="mainline-module-package-name" value="com.google.android.extservices" />
</object>