blob: 43002402323bc0b33798c1ed0e35e4111068a40a [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")
import("//tools/cmc/build/expect_includes.gni")
group("libfuzzer") {
testonly = true
deps = [
":engine-bin",
":libfuzzer_includes",
"//src/sys/fuzzing",
]
}
group("tests") {
testonly = true
deps = [
":unittests-pkg",
"tests",
]
}
source_set("engine-lib") {
visibility = [ ":*" ]
testonly = true
sources = [
"runner.cc",
"runner.h",
]
public_deps = [
"//sdk/lib/fdio",
"//sdk/lib/fit",
"//src/sys/fuzzing/common",
"//src/sys/fuzzing/fidl:fuchsia.fuzzer_hlcpp",
"//third_party/re2",
]
deps = [
"//sdk/lib/syslog/cpp",
"//src/lib/files",
"//third_party/boringssl",
]
}
executable("engine-bin") {
output_name = "libfuzzer_engine"
testonly = true
sources = [ "engine-main.cc" ]
deps = [ ":engine-lib" ]
}
test("unittests-bin") {
output_name = "libfuzzer_unittests"
visibility = [ ":*" ]
testonly = true
sources = [ "runner-unittest.cc" ]
deps = [
":engine-lib",
"testing:test.fuzzer_hlcpp",
"//sdk/lib/sys/cpp",
"//src/lib/files",
"//src/lib/fxl/test:gtest_main",
"//src/sys/fuzzing/common:runner-unittests",
"//src/sys/fuzzing/common/testing",
"//third_party/googletest:gtest",
]
}
expect_includes("libfuzzer_includes") {
includes = [ "default.shard.cml" ]
}
fuchsia_component("test-realm") {
visibility = [ ":*" ]
testonly = true
manifest = "meta/test-realm.cml"
deps = [
":test-relay",
":unittests",
]
}
fuchsia_component("test-relay") {
visibility = [ ":*" ]
testonly = true
manifest = "meta/test-relay.cml"
deps = [ "testing:relay" ]
}
fuchsia_component("unittests") {
visibility = [ ":*" ]
testonly = true
manifest = "meta/unittests.cml"
deps = [
":unittests-bin",
"testing:fuzzer",
]
}
fuchsia_test_package("unittests-pkg") {
package_name = "libfuzzer-unittests"
test_components = [ ":test-realm" ]
}