blob: 3f0d3c2acf1e5297766e48d516f288d17f804269 [file] [log] [blame]
# Copyright 2025 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/components.gni")
import("//build/rust/rustc_library.gni")
_common = {
edition = "2024"
with_unit_tests = true
deps = [
"//sdk/rust/zx-status",
"//src/lib/fdomain/client",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/client.rs",
"src/lib.rs",
"src/server.rs",
"src/socket.rs",
"src/test.rs",
"src/throughput.rs",
]
test_deps = [
"//src/lib/fuchsia",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:test-case",
]
}
rustc_library("speedtest") {
forward_variables_from(_common, "*", [])
deps += [
"//sdk/fidl/fuchsia.developer.ffx.speedtest:fuchsia.developer.ffx.speedtest_rust_flex",
"//src/lib/fdomain/client:flex_fidl",
]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
if (is_host) {
rustc_library("speedtest_fdomain") {
forward_variables_from(_common, "*", [])
deps += [
"//sdk/fidl/fuchsia.developer.ffx.speedtest:fuchsia.developer.ffx.speedtest_rust_fdomain_flex",
"//src/lib/fdomain/client:flex_fdomain",
]
test_deps += [ "//src/lib/fdomain/local" ]
features = [ "fdomain" ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
}
if (is_fuchsia) {
fuchsia_unittest_package("speedtest-target-tests") {
deps = [ ":speedtest_test" ]
}
}
group("tests") {
testonly = true
deps = [
":speedtest-target-tests($target_toolchain)",
":speedtest_fdomain_test($host_toolchain)",
":speedtest_test($host_toolchain)",
]
}