diff options
author | Chih-Hung Hsieh <chh@google.com> | 2020-06-16 01:00:19 -0700 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2020-06-17 13:12:09 -0700 |
commit | 0aa6809418c1ca3685be995ee316eff900aade40 (patch) | |
tree | 927c3fff45b9c3166252ef7251178aa2a9d7a07d | |
parent | eb50abb49786dae3ce91cc3d16646737147c18a7 (diff) | |
download | slab-0aa6809418c1ca3685be995ee316eff900aade40.tar.gz |
Separate host and device tests
* To enable multilib for rust_test on device,
but not for rust_test_host yet.
Host tests depend on proc-macro2 library,
which does not build for multilib on host yet.
* On device tests must link in static libraries
since their .so versions are not installed
in system/lib* yet.
* But device tests cannot link with both libstd.static
and libslab, which depends on dynamic version of libstd.
Bug: 158677299
Test: mm in external/rust/crates
Test: atest -c --include-subdirs external/rust/crates
Change-Id: I6b7420b8e8e8335a203b8ca6536a7586491b2884
-rw-r--r-- | Android.bp | 40 | ||||
-rw-r--r-- | TEST_MAPPING | 12 |
2 files changed, 41 insertions, 11 deletions
@@ -1,4 +1,7 @@ // This file is generated by cargo2android.py --run --device --tests. +// Manually split host and device tests, +// and link in static libraries for device tests. +// But, device tests cannot link with both libstd.static and libslab. rust_library_rlib { name: "libslab", @@ -8,9 +11,8 @@ rust_library_rlib { edition: "2015", } -rust_test { - name: "slab_tests_slab", - host_supported: true, +rust_test_host { + name: "slab_host_tests_slab", crate_name: "slab", srcs: ["src/lib.rs"], test_suites: ["general-tests"], @@ -19,8 +21,21 @@ rust_test { } rust_test { - name: "slab_tests_slab1", - host_supported: true, + name: "slab_device_tests_slab", + crate_name: "slab", + srcs: ["src/lib.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, + edition: "2015", + rlibs: [ + "libstd.static", + "libtest.static", + "libterm.static", + ], +} + +rust_test_host { + name: "slab_host_tests_slab1", crate_name: "slab", srcs: ["tests/slab.rs"], test_suites: ["general-tests"], @@ -30,3 +45,18 @@ rust_test { "libslab", ], } + +// rust_test { +// name: "slab_device_tests_slab1", +// crate_name: "slab", +// srcs: ["tests/slab.rs"], +// test_suites: ["general-tests"], +// auto_gen_config: true, +// edition: "2015", +// rlibs: [ +// "libslab", +// "libstd.static", +// "libtest.static", +// "libterm.static", +// ], +// } diff --git a/TEST_MAPPING b/TEST_MAPPING index acd7705..61049c1 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,18 +1,18 @@ { "presubmit": [ { - "name": "slab_tests_slab", + "name": "slab_host_tests_slab", "host": true }, { - "name": "slab_tests_slab" + "name": "slab_device_tests_slab" }, { - "name": "slab_tests_slab1", + "name": "slab_host_tests_slab1", "host": true - }, - { - "name": "slab_tests_slab1" } + //{ + // "name": "slab_device_tests_slab1" + //} ] } |