| # 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/go/go_binary.gni") |
| import("//build/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| import("//build/go/toolchain.gni") |
| import("//build/test/test_package.gni") |
| import("//src/tests/fidl/conformance_suite/gidl-conformance-suite.gni") |
| import("//tools/fidl/gidl/gidl.gni") |
| |
| generated_dir = "$target_gen_dir" |
| generated_source = "$generated_dir/conformance_test.go" |
| |
| gidl("conformance_suite") { |
| testonly = true |
| type = "conformance" |
| language = "go" |
| inputs = conformance_suite_gidl_files |
| fidl = conformance_suite_fidl_target |
| output = generated_source |
| } |
| |
| go_library("conformance_tests_library") { |
| testonly = true |
| name = "conformance_tests" |
| source_dir = generated_dir |
| |
| non_go_deps = [ |
| ":conformance_suite", |
| ":copy_test_utils", |
| ] |
| |
| deps = [ "${conformance_suite_fidl_target}(${go_toolchain})" ] |
| } |
| |
| copy("copy_test_utils") { |
| sources = |
| [ "//third_party/go/src/syscall/zx/fidl/fidl_test/testutil_test.go" ] |
| outputs = [ "${generated_dir}/testutil_test.go" ] |
| } |
| |
| go_test("fidl_go_conformance_tests") { |
| test = true |
| gopackages = [ "conformance_tests" ] |
| deps = [ ":conformance_tests_library" ] |
| non_go_deps = [ ":conformance_suite" ] |
| } |
| |
| test_package("fidl_go_conformance") { |
| deps = [ ":fidl_go_conformance_tests" ] |
| binaries = [ |
| { |
| name = "fidl_go_conformance_tests" |
| }, |
| ] |
| tests = [ |
| { |
| name = "fidl_go_conformance_tests" |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fidl_go_conformance" ] |
| } |