blob: 34cde09a88eddd4edbae43b4f21f1e8da7d2a7da [file] [log] [blame]
# Copyright 2024 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_binary.gni")
import("//build/testing/perf/test.gni")
if (is_fuchsia) {
rustc_binary("netstack3-benchmarks") {
name = "netstack3_benchmarks"
with_unit_tests = true
testonly = true
edition = "2024"
sources = [
"src/forwarding.rs",
"src/main.rs",
]
deps = [
"//src/connectivity/lib/net-types",
"//src/connectivity/lib/packet-formats",
"//src/connectivity/network/netstack3/core:netstack3-core-benchmarks",
"//src/connectivity/network/netstack3/core/base:netstack3-base-benchmarks",
"//src/developer/fuchsia-criterion",
"//src/lib/network/packet",
"//third_party/rust_crates:criterion",
]
configs += [ "//build/config/rust/lints:deny_unused_results" ]
configs += [ "//src/connectivity/network/netstack3/core:benchmark" ]
}
fuchsia_package_with_single_component("netstack3_benchmarks") {
deps = [ ":netstack3-benchmarks" ]
testonly = true
manifest = "meta/netstack3-benchmarks.cml"
}
fuchsia_unittest_package("netstack3-benchmarks-test") {
deps = [ ":netstack3-benchmarks_test" ]
}
}
if (is_host) {
fuchsia_component_perf_test("netstack3_benchmarks") {
package = ":netstack3_benchmarks"
component_name = "netstack3_benchmarks"
expected_metric_names_filepath = "//src/tests/end_to_end/perf/expected_metric_names/fuchsia.netstack3.core.txt"
}
}
group("bench") {
testonly = true
deps = [ ":netstack3_benchmarks($host_toolchain)" ]
}
group("tests") {
testonly = true
deps = [ ":netstack3-benchmarks-test" ]
}