aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Vander Stoep <jeffv@google.com>2022-10-19 08:50:05 +0200
committerJeff Vander Stoep <jeffv@google.com>2022-10-19 08:50:05 +0200
commit5f46350afae593805c01bdef34f9c92ba24637ef (patch)
tree89d6ea4683429b4a3896de25d3089db428a3be3d
parentd1c5a0d3556d7d7fbc6b428c2c095e0affb93a2c (diff)
downloadasync-stream-5f46350afae593805c01bdef34f9c92ba24637ef.tar.gz
Enable tests
Test: atest x86_64 async-stream_test_tests_for_await: Passed: 1, Failed: 0, Ignored: 0, Assumption Failed: 0, x86_64 async-stream_test_tests_try_stream: Passed: 4, Failed: 0, Ignored: 0, Assumption Failed: 0, Change-Id: Ica466b15530890639abacc772521d55407ed896d
-rw-r--r--Android.bp45
-rw-r--r--TEST_MAPPING16
-rw-r--r--cargo2android.json11
3 files changed, 70 insertions, 2 deletions
diff --git a/Android.bp b/Android.bp
index d48bba7..2745963 100644
--- a/Android.bp
+++ b/Android.bp
@@ -18,6 +18,47 @@ license {
],
}
+rust_defaults {
+ name: "async-stream_test_defaults",
+ crate_name: "async_stream",
+ cargo_env_compat: true,
+ cargo_pkg_version: "0.3.3",
+ test_suites: ["general-tests"],
+ auto_gen_config: true,
+ edition: "2018",
+ rustlibs: [
+ "libasync_stream",
+ "libfutures_core",
+ "libfutures_util",
+ "libtokio",
+ "libtokio_test",
+ ],
+ proc_macros: [
+ "libasync_stream_impl",
+ "librustversion",
+ ],
+}
+
+rust_test {
+ name: "async-stream_test_tests_for_await",
+ defaults: ["async-stream_test_defaults"],
+ host_supported: true,
+ srcs: ["tests/for_await.rs"],
+ test_options: {
+ unit_test: true,
+ },
+}
+
+rust_test {
+ name: "async-stream_test_tests_try_stream",
+ defaults: ["async-stream_test_defaults"],
+ host_supported: true,
+ srcs: ["tests/try_stream.rs"],
+ test_options: {
+ unit_test: true,
+ },
+}
+
rust_library {
name: "libasync_stream",
host_supported: true,
@@ -30,4 +71,8 @@ rust_library {
"libfutures_core",
],
proc_macros: ["libasync_stream_impl"],
+ apex_available: [
+ "//apex_available:platform",
+ "//apex_available:anyapex",
+ ],
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index dfc3524..0d50c8f 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -7,5 +7,21 @@
{
"path": "external/rust/crates/tokio-test"
}
+ ],
+ "presubmit": [
+ {
+ "name": "async-stream_test_tests_for_await"
+ },
+ {
+ "name": "async-stream_test_tests_try_stream"
+ }
+ ],
+ "presubmit-rust": [
+ {
+ "name": "async-stream_test_tests_for_await"
+ },
+ {
+ "name": "async-stream_test_tests_try_stream"
+ }
]
}
diff --git a/cargo2android.json b/cargo2android.json
index bf78496..0c66159 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,4 +1,11 @@
{
"device": true,
- "run": true
-} \ No newline at end of file
+ "run": true,
+ "tests": true,
+ "dependency-blocklist": [
+ "trybuild"
+ ],
+ "test-blocklist": [
+ "tests/stream.rs"
+ ]
+}