| # Copyright 2018 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/test.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| source_set("fostr") { |
| sources = [ |
| "fidl_types.cc", |
| "fidl_types.h", |
| "hex_dump.cc", |
| "hex_dump.h", |
| "indent.h", |
| "zx_types.cc", |
| "zx_types.h", |
| ] |
| |
| if (is_fuchsia) { |
| public_deps = [ |
| "//sdk/lib/fidl/cpp", |
| "//zircon/system/ulib/zx", |
| ] |
| } else { |
| public_deps = [ "//sdk/lib/fidl/cpp:cpp_base" ] |
| } |
| |
| deps = [ ":fostr_shared" ] |
| } |
| |
| shared_library("fostr_shared") { |
| sources = [ |
| "indent.cc", |
| "indent.h", |
| ] |
| } |
| |
| if (is_host) { |
| host_test_data("fostr_shared_test_data") { |
| if (is_linux) { |
| sources = [ "$root_out_dir/libfostr_shared.so" ] |
| } else if (is_mac) { |
| sources = [ "$root_out_dir/libfostr_shared.dylib" ] |
| } |
| deps = [ ":fostr_shared($host_toolchain)" ] |
| } |
| } |
| |
| test("fostr-test-bin") { |
| output_name = "fostr_unittests" |
| |
| sources = [ |
| "test/fidl_types_unittests.cc", |
| "test/hex_dump_unittests.cc", |
| "test/indent_unittests.cc", |
| "test/zx_types_unittests.cc", |
| ] |
| |
| deps = [ |
| ":fostr", |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/fidl/cpp", |
| "//src/lib/fostr/fidl/fuchsia.example.fostr", |
| "//src/lib/fostr/fidl/fuchsia.example.fostr2", |
| "//src/lib/fsl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/predicates", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_unittest_package("fostr-tests") { |
| package_name = "fostr_unittests" |
| manifest = "meta/fostr_unittests.cml" |
| deps = [ ":fostr-test-bin" ] |
| test_type = "system" |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fostr-tests" ] |
| } |