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 <[email protected]>
diff --git a/Android.bp b/Android.bp
index ebd9f28..efb0cdc 100644
--- a/Android.bp
+++ b/Android.bp
@@ -39,6 +39,61 @@
     ],
 }
 
+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,
diff --git a/Cargo.toml b/Cargo.toml
index 4b79bba..bf8fbf2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -45,6 +45,7 @@
 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": "futures-executor_test_src_lib"
     },
     {
-      "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": "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"]