blob: 1e4933fa8590a0fa6bce155950795bbe2062f3b8 [file] [log] [blame]
# Copyright 2021 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("tests") {
testonly = true
deps = [
":error-unittests-pkg",
":unittests-pkg",
]
}
source_set("common") {
visibility = [ "//src/sys/*" ]
sources = [
"artifact.cc",
"artifact.h",
"async-deque.h",
"async-eventpair.cc",
"async-eventpair.h",
"async-socket.cc",
"async-socket.h",
"async-types.cc",
"async-types.h",
"child-process.cc",
"child-process.h",
"component-context.cc",
"component-context.h",
"controller-provider.cc",
"controller-provider.h",
"controller.cc",
"controller.h",
"corpus-reader-client.cc",
"corpus-reader-client.h",
"dictionary.cc",
"dictionary.h",
"engine.cc",
"engine.h",
"input.cc",
"input.h",
"module.h",
"monitor-clients.cc",
"monitor-clients.h",
"options.cc",
"options.h",
"options.inc",
"result.h",
"runner.cc",
"runner.h",
"sancov.h",
"shared-memory.cc",
"shared-memory.h",
"status.cc",
"status.h",
]
public_deps = [
"../fidl:fuchsia.fuzzer_hlcpp",
"//sdk/fidl/fuchsia.mem:fuchsia.mem_hlcpp",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
"//src/lib/debug:backtrace-request",
"//src/lib/fxl",
"//src/lib/pkg_url",
"//third_party/re2",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zx",
]
deps = [ "//build/validate:non_production_tag" ]
}
source_set("runner-unittests-common") {
visibility = [ ":*" ]
testonly = true
sources = [
"runner-unittest.cc",
"runner-unittest.h",
]
public_deps = [
":common",
"//third_party/googletest:gtest",
]
deps = [ "testing" ]
}
source_set("runner-unittests") {
visibility = [ "../*" ]
testonly = true
sources = [ "runner-unittest.inc" ]
public_deps = [ ":runner-unittests-common" ]
}
source_set("runner-fatal-unittests") {
visibility = [ "../*" ]
testonly = true
sources = [ "runner-fatal-unittest.inc" ]
public_deps = [ ":runner-unittests-common" ]
}
test("unittests-bin") {
output_name = "fuzzing_common_unittests"
visibility = [ ":*" ]
testonly = true
sources = [
"async-deque-unittest.cc",
"async-eventpair-unittest.cc",
"async-socket-unittest.cc",
"controller-provider-unittest.cc",
"controller-unittest.cc",
"corpus-reader-client-unittest.cc",
"dictionary-unittest.cc",
"input-unittest.cc",
"monitor-clients-unittest.cc",
"options-unittest.cc",
"shared-memory-unittest.cc",
]
deps = [
":common",
"testing",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
}
test("error-unittests-bin") {
output_name = "fuzzing_common_error_unittests"
visibility = [ ":*" ]
testonly = true
sources = [
"child-process-unittest.cc",
"engine-unittest.cc",
]
deps = [
":common",
"testing",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
}
fuchsia_component("unittests") {
visibility = [ ":*" ]
testonly = true
manifest = "meta/unittests.cml"
deps = [ ":unittests-bin" ]
}
fuchsia_component("error-unittests") {
visibility = [ ":*" ]
testonly = true
manifest = "meta/error-unittests.cml"
deps = [
":error-unittests-bin",
"testing:echo",
]
}
fuchsia_test_package("unittests-pkg") {
package_name = "fuzzing-common-tests"
test_components = [ ":unittests" ]
}
fuchsia_test_package("error-unittests-pkg") {
package_name = "fuzzing-common-error-tests"
# Some tests involve handling intentional crashes.
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
test_components = [ ":error-unittests" ]
}