| # 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/dart/dart_library.gni") |
| import("//build/testing/test_spec.gni") |
| |
| dart_library("zircon") { |
| package_name = "zircon" |
| |
| sdk_category = "partner" |
| |
| sources = [ |
| "src/channel.dart", |
| "src/channel_reader.dart", |
| "src/constants.dart", |
| "src/errors.dart", |
| "src/eventpair.dart", |
| "src/fakes/handle.dart", |
| "src/fakes/handle_waiter.dart", |
| "src/fakes/system.dart", |
| "src/fakes/zircon_fakes.dart", |
| "src/handle_wrapper.dart", |
| "src/socket.dart", |
| "src/socket_reader.dart", |
| "src/vmo.dart", |
| "zircon.dart", |
| ] |
| } |
| |
| if (is_linux || is_mac) { |
| _test_data_dir = "$root_out_dir/test_data/extract_zircon_constants" |
| copy("extract_zircon_constants_data") { |
| sources = [ |
| "//prebuilt/third_party/dart/$host_os-$host_cpu/bin/dart", |
| "//prebuilt/third_party/dart/$host_os-$host_cpu/bin/dartfmt", |
| "//zircon/system/public/zircon/errors.h", |
| "//zircon/system/public/zircon/rights.h", |
| "//zircon/system/public/zircon/types.h", |
| "extract-zircon-constants.py", |
| "lib/src/constants.dart", |
| ] |
| |
| outputs = [ |
| "$_test_data_dir/{{source_file_part}}", |
| ] |
| |
| metadata = { |
| test_runtime_deps = [ |
| "$_test_data_dir/dart", |
| "$_test_data_dir/dartfmt", |
| "$_test_data_dir/errors.h", |
| "$_test_data_dir/rights.h", |
| "$_test_data_dir/types.h", |
| "$_test_data_dir/extract-zircon-constants.py", |
| "$_test_data_dir/constants.dart", |
| ] |
| } |
| } |
| |
| copy("extract_zircon_constants_snapshot_data") { |
| sources = [ |
| "//prebuilt/third_party/dart/$host_os-$host_cpu/bin/snapshots/dartfmt.dart.snapshot", |
| ] |
| outputs = [ |
| "$_test_data_dir/snapshots/dartfmt.dart.snapshot", |
| ] |
| metadata = { |
| test_runtime_deps = outputs |
| } |
| } |
| |
| # TODO(IN-819) Delete the following two targets once we are no longer running |
| # host tests out of one directory. |
| _deprecated_test_data_dir = |
| "$root_build_dir/host_tests/test_data/extract_zircon_constants" |
| copy("deprecated_extract_zircon_constants_data") { |
| sources = [ |
| "//prebuilt/third_party/dart/$host_os-$host_cpu/bin/dart", |
| "//prebuilt/third_party/dart/$host_os-$host_cpu/bin/dartfmt", |
| "//zircon/system/public/zircon/errors.h", |
| "//zircon/system/public/zircon/rights.h", |
| "//zircon/system/public/zircon/types.h", |
| "extract-zircon-constants.py", |
| "lib/src/constants.dart", |
| ] |
| |
| outputs = [ |
| "$_deprecated_test_data_dir/{{source_file_part}}", |
| ] |
| } |
| |
| copy("deprecated_extract_zircon_constants_snapshot_data") { |
| sources = [ |
| "//prebuilt/third_party/dart/$host_os-$host_cpu/bin/snapshots/dartfmt.dart.snapshot", |
| ] |
| outputs = [ |
| "$_deprecated_test_data_dir/snapshots/dartfmt.dart.snapshot", |
| ] |
| } |
| |
| _test = "$root_out_dir/test_extract_zircon_constants" |
| test_spec("test_extract_zircon_constants_spec") { |
| name = get_label_info(":test_extract_zircon_constants", "name") |
| location = _test |
| deps = [ |
| ":extract_zircon_constants_data", |
| ":extract_zircon_constants_snapshot_data", |
| ] |
| } |
| |
| # This is effectively a host test target. |
| copy("test_extract_zircon_constants") { |
| sources = [ |
| "test-extract-zircon-constants.sh", |
| ] |
| outputs = [ |
| _test, |
| ] |
| deps = [ |
| ":deprecated_extract_zircon_constants_data", |
| ":deprecated_extract_zircon_constants_snapshot_data", |
| ":test_extract_zircon_constants_spec", |
| ] |
| } |
| } |