| # Copyright 2019 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/cpp/cpp_fuzzer.gni") |
| import("//build/fuzz.gni") |
| import("//build/test.gni") |
| |
| group("test") { |
| testonly = true |
| deps = [ |
| ":cmdline-fuzzers($default_toolchain)", |
| ":tests", |
| ] |
| } |
| |
| test("cmdline") { |
| output_name = "cmdline-test" |
| |
| sources = [ |
| "args_parser_unittest.cc", |
| "optional_unittest.cc", |
| ] |
| |
| deps = [ |
| "//src/lib/cmdline", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("cmdline-test-pkg") { |
| package_name = "cmdline-test" |
| deps = [ ":cmdline" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":cmdline($host_toolchain)", |
| ":cmdline-test-pkg", |
| ] |
| } |
| |
| fuchsia_fuzzer_component("cmdline-fuzzer-component") { |
| manifest = "meta/cmdline-fuzzer.cml" |
| deps = [ ":cmdline-fuzzer" ] |
| } |
| |
| if (is_fuchsia) { |
| fuchsia_fuzzer_package("cmdline-fuzzers") { |
| cpp_fuzzer_components = [ ":cmdline-fuzzer-component" ] |
| } |
| } else { |
| group("cmdline-fuzzers") { |
| testonly = true |
| deps = [ ":cmdline-fuzzer" ] |
| } |
| } |
| |
| cpp_fuzzer("cmdline-fuzzer") { |
| sources = [ "cmdline_fuzzer.cc" ] |
| deps = [ "//src/lib/cmdline" ] |
| } |