blob: efb5626eae1435c42ce42eb3fd85977fa7e76751 [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 = "realmfuzzer_test_fuzzer"
sources = [ "fuzzer.cc" ]
deps = [
"//src/sys/fuzzing/common/testing:sanitizer",
"//src/sys/fuzzing/realmfuzzer/adapters:llvm",
"//src/sys/fuzzing/realmfuzzer/target",
]
exclude_toolchain_tags = [ "instrumented" ]
}
fuchsia_test_component("fuzzer") {
if (is_coverage) {
manifest = "meta/fuzzer-coverage.cml"
} else {
manifest = "meta/fuzzer.cml"
}
deps = [
":fuzzer-bin",
"//src/sys/fuzzing/realmfuzzer/testing/data:corpus",
]
}
test("integration-test-bin") {
output_name = "realmfuzzer_integration_tests"
sources = [ "integration-tests.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/realmfuzzer/engine:engine-lib",
"//third_party/googletest:gtest",
]
}
fuchsia_test_component("engine") {
manifest = "meta/engine.cml"
deps = [
":integration-test-bin",
"//src/sys/fuzzing/realmfuzzer/engine:engine-bin",
]
}
fuchsia_test_component("fuzzer-integration-tests") {
manifest = "meta/integration-tests.cml"
deps = [
":engine",
":fuzzer",
"//src/sys/fuzzing/realmfuzzer/testing:coverage",
]
}
fuchsia_test_package("fuzzer-integration-tests-pkg") {
package_name = "realmfuzzer-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 = "realmfuzzer_test_fuzzer_uninstrumented"
sources = [ "fuzzer.cc" ]
deps = [ "../adapters:llvm" ]
exclude_toolchain_tags = [ "instrumented" ]
}
renamed_binary("fuzzer-uninstrumented-renamed") {
testonly = true
dest = "bin/realmfuzzer_test_fuzzer"
source = "$root_out_dir/realmfuzzer_test_fuzzer_uninstrumented"
source_deps = [ ":fuzzer-uninstrumented-bin" ]
}
fuchsia_test_component("fuzzer-uninstrumented") {
component_name = "fuzzer"
if (is_coverage) {
manifest = "meta/fuzzer-coverage.cml"
} else {
manifest = "meta/fuzzer.cml"
}
deps = [
":fuzzer-uninstrumented-renamed",
"//src/sys/fuzzing/realmfuzzer/testing/data:corpus",
]
}
fuchsia_test_component("fuzzer-test-integration-test") {
manifest = "../testing/meta/engine.cml"
deps = [
":fuzzer-uninstrumented",
"//src/sys/fuzzing/realmfuzzer/testing:engine",
]
}
fuchsia_test_package("fuzzer-test-integration-tests-pkg") {
package_name = "realmfuzzer-test-integration-test"
test_components = [ ":fuzzer-test-integration-test" ]
}