blob: d7b5025ef9c48ef5bd980d88a6c81cce01796ec2 [file] [log] [blame] [edit]
# 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/test.gni")
group("test") {
testonly = true
deps = [ ":cobalt-client-unit" ]
}
source_set("collector-test") {
testonly = true
sources = [
"cobalt_logger_test.cc",
"collector_test.cc",
]
include_dirs = [ "../include/" ]
deps = [
"//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt_llcpp",
"//sdk/lib/fit",
"//zircon/public/lib/async-cpp",
"//zircon/public/lib/sync",
"//zircon/public/lib/zxtest",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/cobalt-client:cobalt-collector",
"//zircon/system/ulib/cobalt-client:in-memory-logger",
"//zircon/system/ulib/fidl-async:fidl-async-cpp",
]
}
source_set("metrics-test") {
testonly = true
sources = [
"counter_test.cc",
"histogram_test.cc",
"integer_test.cc",
"metric_options_test.cc",
]
include_dirs = [ "../include/" ]
deps = [
"//sdk/lib/fit",
"//zircon/public/lib/sync",
"//zircon/public/lib/zxtest",
"//zircon/system/ulib/cobalt-client:cobalt-collector",
"//zircon/system/ulib/cobalt-client:cobalt-metrics",
"//zircon/system/ulib/cobalt-client:cobalt-types-internal",
"//zircon/system/ulib/cobalt-client:in-memory-logger",
]
}
source_set("in-memory-logger-test") {
testonly = true
sources = [ "in_memory_logger_test.cc" ]
include_dirs = [ "../include/" ]
deps = [
"//zircon/public/lib/zxtest",
"//zircon/system/ulib/cobalt-client:cobalt-metrics",
"//zircon/system/ulib/cobalt-client:in-memory-logger",
]
}
test("cobalt-client-unit") {
output_name = "cobalt-client-unit-test"
if (is_fuchsia) {
configs += [ "//build/unification/config:zircon-migrated" ]
}
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
sources = []
deps = [
":collector-test",
":in-memory-logger-test",
":metrics-test",
]
}
fuchsia_unittest_package("cobalt-client-unit-test-pkg") {
package_name = "cobalt-client-unit-test"
deps = [ ":cobalt-client-unit" ]
}
group("tests") {
testonly = true
deps = [ ":cobalt-client-unit-test-pkg" ]
}