diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2022-07-07 10:34:37 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-07-07 10:34:37 +0000 |
commit | b954e5bab961be8f1a6b57fd2dd6bfc856a9c3af (patch) | |
tree | e917ad15bdd14975b7cda220330ca19b3d0fdf5f | |
parent | 9197e670f7e2a3fc47f45551813795f677405cb0 (diff) | |
parent | dc05c8c6ad670e5fb76b53b631fc146744cabc49 (diff) | |
download | futures-executor-b954e5bab961be8f1a6b57fd2dd6bfc856a9c3af.tar.gz |
Enable tests am: 15b92d7448 am: 88ed474667 am: e4c9fb128d am: dc05c8c6ad
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/futures-executor/+/2145785
Change-Id: I6d33e7fece35f3e2a128a2b54deab8fcdd14c57b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | Android.bp | 55 | ||||
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | TEST_MAPPING | 32 | ||||
-rw-r--r-- | cargo2android.json | 3 | ||||
-rw-r--r-- | patches/Cargo.toml.patch | 12 |
5 files changed, 72 insertions, 31 deletions
@@ -39,6 +39,61 @@ license { ], } +rust_test { + name: "futures-executor_test_src_lib", + host_supported: true, + crate_name: "futures_executor", + cargo_env_compat: true, + cargo_pkg_version: "0.3.21", + srcs: ["src/lib.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, + test_options: { + unit_test: true, + }, + edition: "2018", + features: [ + "num_cpus", + "std", + "thread-pool", + ], + rustlibs: [ + "libfutures", + "libfutures_core", + "libfutures_task", + "libfutures_util", + "libnum_cpus", + ], +} + +rust_test { + name: "futures-executor_test_tests_local_pool", + host_supported: true, + crate_name: "local_pool", + cargo_env_compat: true, + cargo_pkg_version: "0.3.21", + srcs: ["tests/local_pool.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, + test_options: { + unit_test: true, + }, + edition: "2018", + features: [ + "num_cpus", + "std", + "thread-pool", + ], + rustlibs: [ + "libfutures", + "libfutures_core", + "libfutures_executor", + "libfutures_task", + "libfutures_util", + "libnum_cpus", + ], +} + rust_library { name: "libfutures_executor", host_supported: true, @@ -45,6 +45,7 @@ version = "1.8.0" optional = true [dev-dependencies] +futures = "0.3.21" [features] default = ["std"] diff --git a/TEST_MAPPING b/TEST_MAPPING index e2df61d..d8f525d 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,39 +1,11 @@ // Generated by update_crate_tests.py for tests that depend on this crate. { - "imports": [ - { - "path": "external/rust/crates/anyhow" - }, - { - "path": "external/rust/crates/tokio" - } - ], "presubmit": [ { - "name": "ZipFuseTest" - }, - { - "name": "authfs_device_test_src_lib" - }, - { - "name": "doh_unit_test" - }, - { - "name": "virtualizationservice_device_test" - } - ], - "presubmit-rust": [ - { - "name": "ZipFuseTest" - }, - { - "name": "authfs_device_test_src_lib" - }, - { - "name": "doh_unit_test" + "name": "futures-executor_test_src_lib" }, { - "name": "virtualizationservice_device_test" + "name": "futures-executor_test_tests_local_pool" } ] } diff --git a/cargo2android.json b/cargo2android.json index da40e17..0d3c48e 100644 --- a/cargo2android.json +++ b/cargo2android.json @@ -9,5 +9,6 @@ "device": true, "features": "thread-pool", "min-sdk-version": "29", - "run": true + "run": true, + "tests": true } diff --git a/patches/Cargo.toml.patch b/patches/Cargo.toml.patch new file mode 100644 index 0000000..2dbe263 --- /dev/null +++ b/patches/Cargo.toml.patch @@ -0,0 +1,12 @@ +diff --git a/Cargo.toml b/Cargo.toml +index 4b79bba..bf8fbf2 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -45,6 +45,7 @@ version = "1.8.0" + optional = true + + [dev-dependencies] ++futures = "0.3.21" + + [features] + default = ["std"] |