diff options
author | Chih-Hung Hsieh <chh@google.com> | 2019-11-14 12:20:36 -0800 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2019-11-24 18:55:36 -0800 |
commit | 5b4aa241669e262c69c7d0d4e7118b59d1623258 (patch) | |
tree | c522aecaa562186be0acbc65da2acb2eb932e3ec | |
parent | 23580d49f6da3b919c9b9e5b7ad1b28c088fec3f (diff) | |
download | platform_external_rust_crates_unicode-xid-5b4aa241669e262c69c7d0d4e7118b59d1623258.tar.gz platform_external_rust_crates_unicode-xid-5b4aa241669e262c69c7d0d4e7118b59d1623258.tar.bz2 platform_external_rust_crates_unicode-xid-5b4aa241669e262c69c7d0d4e7118b59d1623258.zip |
Add auto_gen_config and TEST_MAPPING.
* This package's tests can run on both host and device.
* Tests for device are linked statically for now because we
do not have .so files in device system image yet.
* Tests for device are not installed in relative_install_path.
* TEST_MAPPING has host and device tests separated.
Bug: 140938178
Test: atest --include-subdirs external/rust/crates/unicode-xid
Change-Id: I071e711939acb7d9ac1f0aa764ca6e5315d954f0
-rw-r--r-- | Android.bp | 28 | ||||
-rw-r--r-- | TEST_MAPPING | 11 |
2 files changed, 35 insertions, 4 deletions
@@ -1,4 +1,5 @@ -// This file is generated by cargo2android.py. +// This file is generated by cargo2android.py, edited with on device tests. +// Limitation: on device tests must be statically linked. rust_library_rlib { name: "libunicode_xid", @@ -12,11 +13,30 @@ rust_library_rlib { } rust_test { - name: "unicode-xid_test_src_lib", - host_supported: true, + name: "unicode-xid_device_tests_unicode_xid", + crate_name: "unicode_xid", + srcs: ["src/lib.rs"], + // relative_install_path not used for device test + test_suites: ["general-tests"], + auto_gen_config: true, + edition: "2015", + features: [ + "default", + ], + rlibs: [ + "libstd.static", + "libtest.static", + "libterm.static", + ], +} + +rust_test_host { + name: "unicode-xid_host_tests_unicode_xid", crate_name: "unicode_xid", srcs: ["src/lib.rs"], - relative_install_path: "rust/unicode-xid", + relative_install_path: "unicode-xid_tests", + test_suites: ["general-tests"], + auto_gen_config: true, edition: "2015", features: [ "default", diff --git a/TEST_MAPPING b/TEST_MAPPING new file mode 100644 index 0000000..cbf5b0d --- /dev/null +++ b/TEST_MAPPING @@ -0,0 +1,11 @@ +{ + "presubmit": [ + { + "name": "unicode-xid_device_tests_unicode_xid" + }, + { + "name": "unicode-xid_host_tests_unicode_xid", + "host": true + } + ] +} |