blob: 78f129f47a5c3863c5810c4df84aeb3576961af8 [file] [log] [blame]
Jeff Belgumd91367e2020-03-16 04:14:37 +00001# Copyright 2020 The Fuchsia Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Shai Barack6a58d992021-04-14 05:50:58 +00005import("//build/components.gni")
Jeff Belgumd91367e2020-03-16 04:14:37 +00006import("//build/rust/rustc_library.gni")
Jeff Belgumd91367e2020-03-16 04:14:37 +00007
8rustc_library("async-utils") {
9 name = "async_utils"
Sarah Chan64bf58d2025-12-06 16:25:07 -080010 edition = "2024"
Jeff Belgumd91367e2020-03-16 04:14:37 +000011 with_unit_tests = true
12 deps = [
13 "//src/lib/fidl/rust/fidl",
Adam Perry23fc11c2024-01-03 06:16:59 +000014 "//src/lib/fuchsia-sync",
Patrick Shickel414f0092021-05-05 21:33:14 +000015 "//third_party/rust_crates:anyhow",
Nick Brownf93fda02021-07-28 02:14:53 +000016 "//third_party/rust_crates:async-lock",
Jeff Belgumd91367e2020-03-16 04:14:37 +000017 "//third_party/rust_crates:futures",
Nick Brownf93fda02021-07-28 02:14:53 +000018 "//third_party/rust_crates:once_cell",
Bruno Dal Bo8e27e022021-10-20 21:24:53 +000019 "//third_party/rust_crates:pin-project",
Jeff Belgumd91367e2020-03-16 04:14:37 +000020 "//third_party/rust_crates:slab",
Patrick Shickel414f0092021-05-05 21:33:14 +000021 "//third_party/rust_crates:thiserror",
Jeff Belgumd91367e2020-03-16 04:14:37 +000022 ]
Adam Lesinski9f39a122020-07-22 21:17:36 +000023
Jeff Belgumb37879c2020-11-18 01:26:28 +000024 test_deps = [
25 "//src/lib/fuchsia-async",
Craig Tillerf6fd3512021-01-13 17:59:46 +000026 "//third_party/rust_crates:anyhow",
Tamir Duberstein723cf652022-01-22 01:01:31 +000027 "//third_party/rust_crates:assert_matches",
Nick Brownf93fda02021-07-28 02:14:53 +000028 "//third_party/rust_crates:futures-lite",
Jeff Belgumb37879c2020-11-18 01:26:28 +000029 "//third_party/rust_crates:futures-test",
30 "//third_party/rust_crates:proptest",
Zeling Feng77637752024-06-27 00:19:41 +000031 "//third_party/rust_crates:test-case",
Jeff Belgumb37879c2020-11-18 01:26:28 +000032 ]
Tamir Duberstein941377a2020-10-08 15:19:40 +000033
Adam Lesinski9f39a122020-07-22 21:17:36 +000034 sources = [
Nick Brownf93fda02021-07-28 02:14:53 +000035 "src/async_once/mod.rs",
Jeff Belgumf93e99c2021-02-05 21:23:50 +000036 "src/channel.rs",
Adam Lesinski9f39a122020-07-22 21:17:36 +000037 "src/event.rs",
Bruno Dal Bo5dda4442020-09-01 15:30:07 +000038 "src/fold.rs",
Marina Ciocea184a92d2020-10-20 10:51:04 +000039 "src/futures.rs",
Adam Lesinski9f39a122020-07-22 21:17:36 +000040 "src/hanging_get/client.rs",
Patrick Shickel414f0092021-05-05 21:33:14 +000041 "src/hanging_get/error.rs",
Adam Lesinski9f39a122020-07-22 21:17:36 +000042 "src/hanging_get/mod.rs",
Patrick Shickel414f0092021-05-05 21:33:14 +000043 "src/hanging_get/server.rs",
44 "src/hanging_get/test_util.rs",
Adam Lesinski9f39a122020-07-22 21:17:36 +000045 "src/lib.rs",
Craig Tillerf6fd3512021-01-13 17:59:46 +000046 "src/mutex_ticket.rs",
Jeff Belgumb37879c2020-11-18 01:26:28 +000047 "src/stream.rs",
Jeff Belgum7e0a8822021-01-28 08:43:32 +000048 "src/stream/future_map.rs",
Alex Konradi5ca8ed02022-09-17 02:16:26 +000049 "src/stream/one_or_many.rs",
Zeling Feng77637752024-06-27 00:19:41 +000050 "src/stream/short_circuit.rs",
Jeff Belgum7e0a8822021-01-28 08:43:32 +000051 "src/stream/stream_map.rs",
Jeff Belgumc7612332020-10-01 15:42:59 +000052 "src/traits.rs",
Adam Lesinski9f39a122020-07-22 21:17:36 +000053 ]
Tamir Duberstein723cf652022-01-22 01:01:31 +000054
Tamir Duberstein98a4fa42022-07-18 10:06:20 +000055 configs -= [ "//build/config/rust/lints:allow_unused_results" ]
Jeff Belgumd91367e2020-03-16 04:14:37 +000056}
57
Xyan Bhatnagar3b85bd62021-02-09 00:41:09 +000058fuchsia_unittest_package("async-utils-tests") {
Jeff Belgumd91367e2020-03-16 04:14:37 +000059 deps = [ ":async-utils_test" ]
Jeff Belgumd91367e2020-03-16 04:14:37 +000060}
61
62group("tests") {
63 testonly = true
64 deps = [ ":async-utils-tests" ]
65}