| # 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/fuzzing/fuzzer.gni") |
| import("//build/test.gni") |
| |
| static_library("utf_conversion") { |
| public = [ "utf_conversion.h" ] |
| sources = [ "utf_conversion.cc" ] |
| deps = [ "//sdk/lib/stdcompat" ] |
| if (is_kernel) { |
| deps += [ |
| "//zircon/kernel/lib/ktl", |
| "//zircon/kernel/lib/libc", |
| ] |
| } |
| } |
| |
| test("utf_conversion_test") { |
| sources = [ "utf_conversion_test.cc" ] |
| deps = [ |
| ":utf_conversion", |
| "//sdk/lib/fdio", |
| "//sdk/lib/stdcompat", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/pretty", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":utf_conversion_fuzzers", |
| ":utf_conversion_test($host_toolchain)", |
| ":utf_conversion_test_pkg", |
| ] |
| } |
| |
| fuzzer("utf_conversion_fuzzer") { |
| sources = [ "utf_conversion_fuzzer.cc" ] |
| deps = [ ":utf_conversion" ] |
| } |
| |
| fuzzers_package("utf_conversion_fuzzers") { |
| fuzz_host = true |
| cpp_fuzzers = [ ":utf_conversion_fuzzer" ] |
| } |
| |
| fuchsia_unittest_package("utf_conversion_test_pkg") { |
| package_name = "utf_conversion_test" |
| deps = [ ":utf_conversion_test" ] |
| } |