blob: 13049aca5d65e81c8364f93be0b2d26ef8ba8ab6 [file] [log] [blame]
# 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
}
}
_test = "$root_out_dir/test_extract_zircon_constants"
test_spec("test_extract_zircon_constants_spec") {
name = "test_extract_zircon_constants"
install_path = _test
deps = [
":extract_zircon_constants_data",
":extract_zircon_constants_snapshot_data",
]
}
# This is effectively a host test target.
copy("test_extract_zircon_constants") {
testonly = true
sources = [
"test-extract-zircon-constants.sh",
]
outputs = [
_test,
]
deps = [
":test_extract_zircon_constants_spec",
]
}
}