blob: 3eb9d2e24bbb7e7dac3e05e0845c1954699b085d [file] [log] [blame]
# Copyright 2018 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/config.gni")
import("//build/dist/renamed_binary.gni")
source_set("lib") {
testonly = true
sources = [
"component.cc",
"component.h",
"log_collector.cc",
"log_collector.h",
"output_collector.cc",
"output_collector.h",
"run_test_component.cc",
"run_test_component.h",
"sys_tests.cc",
"sys_tests.h",
"test_metadata.cc",
"test_metadata.h",
]
public_deps = [
"//sdk/fidl/fuchsia.boot",
"//sdk/fidl/fuchsia.device",
"//sdk/fidl/fuchsia.hardware.pty",
"//sdk/fidl/fuchsia.kernel",
"//sdk/fidl/fuchsia.logger",
"//sdk/fidl/fuchsia.media",
"//sdk/fidl/fuchsia.net.name",
"//sdk/fidl/fuchsia.posix.socket",
"//sdk/fidl/fuchsia.scheduler",
"//sdk/fidl/fuchsia.sys.internal",
"//sdk/fidl/fuchsia.sys.test",
"//sdk/fidl/fuchsia.sysinfo",
"//sdk/fidl/fuchsia.sysmem",
"//sdk/fidl/fuchsia.test.manager",
"//sdk/fidl/fuchsia.time",
"//sdk/fidl/fuchsia.tracing.kernel",
"//sdk/fidl/fuchsia.tracing.provider",
"//sdk/fidl/fuchsia.ui.composition",
"//sdk/fidl/fuchsia.ui.policy",
"//sdk/fidl/fuchsia.ui.scenic",
"//sdk/fidl/fuchsia.vulkan.loader",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
"//src/lib/cmx",
"//src/lib/fxl",
"//src/lib/json_parser",
"//src/lib/pkg_url",
"//third_party/rapidjson",
]
}
executable("bin") {
testonly = true
output_name = "run-test-component"
sources = [ "main.cc" ]
deps = [
":lib",
"//sdk/fidl/fuchsia.debugdata",
"//sdk/fidl/fuchsia.logger",
"//sdk/fidl/fuchsia.process",
"//sdk/fidl/fuchsia.sys",
"//sdk/lib/sys/cpp",
"//sdk/lib/sys/cpp/testing:enclosing_environment",
"//sdk/lib/syslog/cpp",
"//src/diagnostics/archivist/fidl:controller",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
}
group("run-test-component") {
testonly = true
deps = [
":run-test-component-pkg",
"//src/diagnostics/archivist:archivist-for-embedding",
]
}
# Deprecated binary name
renamed_binary("bin-deprecated") {
testonly = true
dest = "bin/run_test_component"
source = "$root_out_dir/run-test-component"
source_deps = [ ":bin" ]
keep_original = true
}
fuchsia_shell_package("run-test-component-pkg") {
testonly = true
package_name = "run_test_component"
deps = [
":bin",
":bin-deprecated",
]
}
executable("test_bin") {
testonly = true
output_name = "run_test_component_unittests"
sources = [
"log_collector_unittests.cc",
"output_collector_unittests.cc",
"run_test_component_unittest.cc",
"sys_tests_unittests.cc",
"test_metadata_unittest.cc",
]
deps = [
":lib",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/syslog",
]
}
fuchsia_unittest_package("run_test_component_unittests") {
manifest = "meta/run_test_component_unittests.cml"
deps = [ ":test_bin" ]
}
group("run_test_component") {
testonly = true
public_deps = [ ":run-test-component" ]
}
group("tests") {
testonly = true
public_deps = [ ":run_test_component_unittests" ]
}