blob: 10c80f756f80cfcc181f9f7365954e570b817025 [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 = [
":default-tests",
":error-tests",
]
}
source_set("libfuzzer") {
visibility = [ ":*" ]
testonly = true
sources = [
"process.cc",
"process.h",
"runner.cc",
"runner.h",
]
public_deps = [
"//sdk/lib/fdio",
"//sdk/lib/fit",
"//src/sys/fuzzing/common",
"//src/sys/fuzzing/fidl:fuchsia.fuzzer",
"//third_party/re2",
]
deps = [
"//sdk/lib/syslog/cpp",
"//src/lib/files",
"//src/lib/fsl",
"//third_party/boringssl",
]
}
test("unittests_bin") {
output_name = "component_fuzzing_libfuzzer_unittests"
visibility = [ ":*" ]
testonly = true
sources = [ "runner-unittest.cc" ]
deps = [
":libfuzzer",
"testing:test.fuzzer",
"//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",
]
}
test("error_unittests_bin") {
output_name = "component_fuzzing_libfuzzer_error_unittests"
visibility = [ ":*" ]
testonly = true
sources = [ "process-unittest.cc" ]
deps = [
":libfuzzer",
"//sdk/lib/sys/cpp",
"//src/lib/fxl/test:gtest_main",
"//src/sys/fuzzing/common/testing",
"//third_party/googletest:gtest",
]
}
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_component("error-unittests") {
visibility = [ ":*" ]
testonly = true
manifest = "meta/error-unittests.cml"
deps = [
":error_unittests_bin",
"testing:echo",
]
}
fuchsia_test_package("default-tests") {
package_name = "component-fuzzing-libfuzzer-tests"
test_components = [ ":test-realm" ]
}
fuchsia_test_package("error-tests") {
package_name = "component-fuzzing-libfuzzer-error-tests"
# Some tests involve handling intentional crashes.
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
test_components = [ ":error-unittests" ]
}