blob: 322e6a89095f17693c66dfc364fa726e0f34e216 [file] [log] [blame]
# Copyright 2022 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/dist/renamed_binary.gni")
import("//build/test.gni")
group("tests") {
testonly = true
deps = [
":fuzzer-integration-tests-pkg",
":fuzzer-test-integration-tests-pkg",
]
}
# This package contains integration tests that use the "real" fuzzing engine, which generates inputs
# to drive a simple test fuzzer, to imitates a real fuzzer.
executable("fuzzer-bin") {
testonly = true
output_name = "component_fuzzing_framework_test_fuzzer"
sources = [ "fuzzer.cc" ]
deps = [
"//src/sys/fuzzing/common/testing:sanitizer",
"//src/sys/fuzzing/framework/adapters:llvm",
"//src/sys/fuzzing/framework/target",
]
exclude_toolchain_tags = [ "instrumented" ]
}
fuchsia_test_component("fuzzer") {
manifest = "meta/fuzzer.cml"
deps = [
":fuzzer-bin",
"//src/sys/fuzzing/framework/testing/data:corpus",
]
}
test("integration-test-bin") {
output_name = "component_fuzzing_framework_tests"
sources = [ "framework-integration-test.cc" ]
deps = [
"//sdk/lib/fdio",
"//sdk/lib/sys/cpp",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//src/sys/fuzzing/common",
"//src/sys/fuzzing/common/testing",
"//src/sys/fuzzing/fidl:fuchsia.fuzzer",
"//src/sys/fuzzing/framework/engine:engine-lib",
"//third_party/googletest:gtest",
]
}
fuchsia_test_component("engine") {
manifest = "meta/engine.cml"
deps = [
":integration-test-bin",
"//src/sys/fuzzing/framework/engine:engine-bin",
]
}
fuchsia_test_component("fuzzer-integration-tests") {
manifest = "meta/integration-tests.cml"
deps = [
":engine",
":fuzzer",
"//src/sys/fuzzing/framework/coverage",
]
}
fuchsia_test_package("fuzzer-integration-tests-pkg") {
package_name = "component-fuzzer-integration-tests"
test_components = [ ":fuzzer-integration-tests" ]
}
# This package contains integration tests that use a test "engine", which uses fixed inputs to drive
# a simple test fuzzer without instrumentation, to imitate the fuzzer tests that run in CQ.
executable("fuzzer-uninstrumented-bin") {
testonly = true
output_name = "component_fuzzing_framework_test_fuzzer_uninstrumented"
sources = [ "fuzzer.cc" ]
deps = [ "../adapters:llvm" ]
exclude_toolchain_tags = [ "instrumented" ]
}
renamed_binary("fuzzer-uninstrumented-renamed") {
testonly = true
dest = "bin/component_fuzzing_framework_test_fuzzer"
source =
"$root_out_dir/component_fuzzing_framework_test_fuzzer_uninstrumented"
source_deps = [ ":fuzzer-uninstrumented-bin" ]
}
fuchsia_test_component("fuzzer-uninstrumented") {
component_name = "fuzzer"
manifest = "meta/fuzzer.cml"
deps = [
":fuzzer-uninstrumented-renamed",
"//src/sys/fuzzing/framework/testing/data:corpus",
]
}
fuchsia_test_component("fuzzer-test-integration-test") {
manifest = "../testing/meta/engine.cml"
deps = [
":fuzzer-uninstrumented",
"//src/sys/fuzzing/framework/testing:engine",
]
}
fuchsia_test_package("fuzzer-test-integration-tests-pkg") {
package_name = "component-fuzzer-test-integration-test"
test_components = [ ":fuzzer-test-integration-test" ]
}