| # 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/package.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| source_set("lib") { |
| sources = [ |
| "action.h", |
| "measurement.h", |
| "object.h", |
| "random.h", |
| "tracing.cc", |
| "tracing.h", |
| "utility.cc", |
| "utility.h", |
| "worker.h", |
| "workload.cc", |
| "workload.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.kernel", |
| "//sdk/fidl/fuchsia.scheduler", |
| "//sdk/lib/fdio", |
| "//src/lib/files", |
| "//src/lib/fxl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fzl", |
| |
| # TODO(fxbug.dev/57392): Move it back to //third_party once unification completes. |
| "//zircon/third_party/rapidjson", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("bin") { |
| output_name = "loadbench" |
| sources = [ "loadbench.cc" ] |
| |
| deps = [ ":lib" ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| package("loadbench") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "loadbench" |
| }, |
| ] |
| meta = [ |
| { |
| path = rebase_path("meta/loadbench.cmx") |
| dest = "loadbench.cmx" |
| }, |
| ] |
| |
| # Add benchmark specification files to this array. |
| json_files = [ |
| "deadline_test.json", |
| "default.json", |
| "example.json", |
| "port_test.json", |
| "simple_load.json", |
| "relative_bandwidth.json", |
| "tests/automated/large_core_counts_overload_test.json", |
| "tests/dpc_latency.json", |
| ] |
| |
| # Build a resource entry for each benchmark specification. |
| resources = [] |
| foreach(file, json_files) { |
| resources += [ |
| { |
| path = rebase_path("data/$file") |
| dest = "$file" |
| }, |
| ] |
| } |
| } |
| |
| executable("loadbench_unittests") { |
| testonly = true |
| |
| sources = [ |
| "tracing_unittest.cc", |
| "workload_unittest.cc", |
| ] |
| |
| deps = [ |
| ":lib", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| test_package("loadbench_tests") { |
| deps = [ ":loadbench_unittests" ] |
| |
| tests = [ |
| { |
| name = "loadbench_unittests" |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ ":loadbench_tests" ] |
| } |