aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2020-06-18 00:09:37 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-18 00:09:37 +0000
commit0b26018573c86ee01cb5d5bc99565fdde848cc67 (patch)
tree927c3fff45b9c3166252ef7251178aa2a9d7a07d
parent93cd2bb2e2d8e297108b65fbb262c5bc3c070ac1 (diff)
parent54b0b4e3dadaa9b9d4983279952c82f2b4bd280d (diff)
downloadslab-0b26018573c86ee01cb5d5bc99565fdde848cc67.tar.gz
Separate host and device tests am: 0aa6809418 am: 2937fa587d am: 312f4ad4b7 am: 54b0b4e3da
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1337255 Change-Id: I678c01fa38d8abe7a85b5668da1e4cb1be935e50
-rw-r--r--Android.bp40
-rw-r--r--TEST_MAPPING12
2 files changed, 41 insertions, 11 deletions
diff --git a/Android.bp b/Android.bp
index 7f627cd..1373a19 100644
--- a/Android.bp
+++ b/Android.bp
@@ -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"
+ //}
]
}