diff options
author | Roshan Pius <rpius@google.com> | 2022-02-22 12:09:37 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2022-02-23 11:19:23 -0800 |
commit | 36e68e44a1af95d6a57da25374ca51e883104218 (patch) | |
tree | 63da212bae03d94e1c07293188a36b41889850ee /src | |
parent | b5fb93abe3e3aaaf88968d6650c7748132238687 (diff) | |
download | uwb-36e68e44a1af95d6a57da25374ca51e883104218.tar.gz |
uwb(uci-rust): Add rust unit tests to UWB MTS
Bug: 216552887
Test: m mts && mts-tradefed run mts-uwb
Change-Id: I31c2c50f97f77b2cadc0af292aafb5712edcfc7b
Diffstat (limited to 'src')
-rwxr-xr-x | src/Android.bp | 36 | ||||
-rw-r--r-- | src/uwb_rust_test_config_template.xml | 30 |
2 files changed, 64 insertions, 2 deletions
diff --git a/src/Android.bp b/src/Android.bp index 7dcaa97..9d1de4c 100755 --- a/src/Android.bp +++ b/src/Android.bp @@ -43,7 +43,23 @@ rust_library { rust_test { name: "libuwb_uci_rust_tests", defaults: ["libuwb_uci_defaults"], - test_suites: ["general-tests"], + test_suites: [ + "general-tests", + "mts-uwb" + ], + test_config_template: "uwb_rust_test_config_template.xml", + // Support multilib variants (using different suffix per sub-architecture), which is needed on + // build targets with secondary architectures, as the MTS test suite packaging logic flattens + // all test artifacts into a single `testcases` directory. + compile_multilib: "both", + multilib: { + lib32: { + suffix: "32", + }, + lib64: { + suffix: "", + }, + }, auto_gen_config: true, } @@ -52,7 +68,23 @@ rust_test { srcs: [ ":UwbGeneratedPackets_rust", ], - test_suites: ["general-tests"], + test_suites: [ + "general-tests", + "mts-uwb" + ], + test_config_template: "uwb_rust_test_config_template.xml", + // Support multilib variants (using different suffix per sub-architecture), which is needed on + // build targets with secondary architectures, as the MTS test suite packaging logic flattens + // all test artifacts into a single `testcases` directory. + compile_multilib: "both", + multilib: { + lib32: { + suffix: "32", + }, + lib64: { + suffix: "", + }, + }, auto_gen_config: true, proc_macros: ["libnum_derive"], rustlibs:[ diff --git a/src/uwb_rust_test_config_template.xml b/src/uwb_rust_test_config_template.xml new file mode 100644 index 0000000..f93397c --- /dev/null +++ b/src/uwb_rust_test_config_template.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2022 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="Configuration for {MODULE} Rust tests"> + <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/> + <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> + <option name="cleanup" value="true" /> + <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" /> + </target_preparer> + <test class="com.android.tradefed.testtype.rust.RustBinaryTest" > + <option name="test-device-path" value="/data/local/tmp" /> + <option name="module-name" value="{MODULE}" /> + </test> + <object type="module_controller" + class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController"> + <option name="mainline-module-package-name" value="com.google.android.uwb" /> + </object> +</configuration> |