| # 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 = [ |
| ":integration-tests-pkg", |
| ":standalone-test-pkg", |
| ] |
| } |
| |
| executable("adapter") { |
| testonly = true |
| output_name = "realmfuzzer_test_fuzzer" |
| deps = [ |
| "//src/sys/fuzzing/common/testing:sanitizer", |
| "//src/sys/fuzzing/common/tests:fuzzer-lib", |
| "//src/sys/fuzzing/realmfuzzer/adapters:llvm", |
| "//src/sys/fuzzing/realmfuzzer/target:instrumented", |
| ] |
| exclude_toolchain_tags = [ "instrumented" ] |
| } |
| |
| fuchsia_test_component("adapter-component") { |
| component_name = "adapter" |
| manifest = "meta/adapter.cml" |
| deps = [ |
| ":adapter", |
| "//src/sys/fuzzing/common/testing/data:corpus", |
| ] |
| } |
| |
| test("tests-bin") { |
| output_name = "realmfuzzer_integration_tests" |
| sources = [ "integration-tests.cc" ] |
| deps = [ |
| "//src/sys/fuzzing/common/testing", |
| "//src/sys/fuzzing/common/tests:integration-tests-lib", |
| "//src/sys/fuzzing/fidl:fuchsia.fuzzer_hlcpp", |
| ] |
| } |
| |
| fuchsia_test_component("integration-tests") { |
| manifest = "meta/integration-tests.cml" |
| deps = [ |
| ":tests-bin", |
| "//src/sys/fuzzing/realmfuzzer/engine:engine-bin", |
| ] |
| } |
| |
| fuchsia_test_package("integration-tests-pkg") { |
| package_name = "realmfuzzer-integration-tests" |
| test_components = [ ":integration-tests" ] |
| deps = [ |
| ":adapter-component", |
| "//src/sys/fuzzing/realmfuzzer/coverage", |
| ] |
| } |
| |
| # This test verifies that an instrumented executable linked against the target runtime can function |
| # normally even if the coverage component is not found. In order to use existing component manifests |
| # for the realms being fuzzed, program binary names must be unchanged. Since executables are |
| # uniquely named per build, the same executable used for fuzzing may be available outside the test |
| # realm for "normal" use. As a result, fuzzing-related behavior must be strictly optional depending |
| # on the availability of the coverage component. |
| test("standalone") { |
| output_name = "realmfuzzer_standalone_test" |
| sources = [ "standalone-test.cc" ] |
| deps = [ |
| "//src/sys/fuzzing/common/testing:sanitizer", |
| "//src/sys/fuzzing/realmfuzzer/target:instrumented", |
| ] |
| exclude_toolchain_tags = [ "instrumented" ] |
| } |
| |
| fuchsia_test_component("standalone-test") { |
| manifest = "meta/standalone-test.cml" |
| deps = [ ":standalone" ] |
| } |
| |
| fuchsia_test_package("standalone-test-pkg") { |
| package_name = "realmfuzzer-standalone-test" |
| test_components = [ ":standalone-test" ] |
| } |