blob: 31b076419e090d3e070a349cf8777d2bcb17c461 [file] [log] [blame]
# Copyright 2019 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/rust/rustc_library.gni")
declare_args() {
# Used to enable local benchmarking/fine-tuning when running benchmarks
# in `fx shell`. Pass `--args=local_bench='true'` to `fx set` in order to
# enable it.
local_bench = false
}
rustc_library("fuchsia-criterion") {
name = "fuchsia-criterion"
with_unit_tests = true
version = "0.1.0"
edition = "2021"
deps = [
"//third_party/rust_crates:criterion",
"//third_party/rust_crates:csv",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:walkdir",
]
if (local_bench) {
features = [ "local_bench" ]
}
sources = [ "src/lib.rs" ]
}
fuchsia_unittest_package("fuchsia-criterion-tests") {
deps = [ ":fuchsia-criterion_test" ]
manifest = "meta/fuchsia_criterion_lib_test.cmx"
}
rustc_binary("criterion_bench_bin") {
version = "-1.1.0"
name = "criterion_bench"
edition = "2021"
deps = [ ":fuchsia-criterion" ]
sources = [ "examples/main.rs" ]
source_root = "examples/main.rs"
}
fuchsia_shell_package("criterion_bench") {
deps = [ ":criterion_bench_bin" ]
}
group("tests") {
testonly = true
public_deps = [
":criterion_bench",
":fuchsia-criterion-tests",
]
}