blob: c988e2ae336ad088085c7c61619100ce50433023 [file] [log] [blame]
# Copyright 2021 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/fidl/fidl.gni")
import("//build/test.gni")
import("//src/tests/fidl/conformance_suite/gidl-conformance-suite.gni")
import("//tools/fidl/gidl/gidl.gni")
group("conformance") {
testonly = true
deps = [
":fidl_llcpp_conformance_tests",
":fidl_llcpp_conformance_tests_bin($host_toolchain)",
":fidl_llcpp_manual_conformance_tests",
":fidl_llcpp_request_response_tests",
]
}
gidl_output_prefix = "conformance_suite__"
gidl_deps = []
foreach(gidl_file, conformance_suite_gidl_files) {
gidl_name = get_path_info(gidl_file, "name")
target = "${gidl_output_prefix}${gidl_name}"
gidl_deps += [ ":" + target ]
gidl_llcpp_conformance(target) {
testonly = true
inputs = [ gidl_file ]
fidl = conformance_suite_fidl_target
deps = [
":conformance_utils",
"//third_party/googletest:gtest",
]
if (is_fuchsia) {
deps += [ "//sdk/ctf/tests/pkg/fidl/cpp:handle_util" ]
}
}
}
test("fidl_llcpp_conformance_tests_bin") {
output_name = "fidl_llcpp_conformance_tests"
deps = [
":conformance_utils",
"//src/lib/fxl/test:gtest_main",
"//src/tests/fidl/conformance_suite:conformance_fidl_cpp",
"//third_party/googletest:gtest",
] + gidl_deps
}
fuchsia_unittest_package("fidl_llcpp_conformance_tests") {
deps = [ ":fidl_llcpp_conformance_tests_bin" ]
deprecated_legacy_test_execution = true
}
fidl("manual.conformance.large") {
testonly = true
visibility = [ ":*" ]
sources = [ "large.test.fidl" ]
}
# TODO(https://fxbug.dev/42150813): This test is Fuchsia only because the FIDL library
# cannot compile on host.
test("fidl_llcpp_manual_conformance_tests_bin") {
output_name = "fidl_llcpp_manual_conformance_tests"
sources = [
"manual_conformance_test.cc",
"persistence_test.cc",
]
deps = [
":manual.conformance.large_cpp",
"//sdk/testing/fidl:fidl_test_cpp",
"//sdk/testing/fidl/types_tests:test.types_cpp",
"//src/lib/fidl/llcpp/tests/conformance:conformance_utils",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
# TODO(https://fxbug.dev/42176699): This target uses mutable tables which are deprecated,
# rather than builders.
configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ]
}
fuchsia_unittest_package("fidl_llcpp_manual_conformance_tests") {
deps = [ ":fidl_llcpp_manual_conformance_tests_bin" ]
deprecated_legacy_test_execution = true
}
test("fidl_llcpp_request_response_tests_bin") {
sources = [ "request_response_test.cc" ]
deps = [
"//sdk/testing/fidl/types_tests:test.types_cpp",
"//src/lib/fxl/test:gtest_main",
]
# TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
fuchsia_unittest_package("fidl_llcpp_request_response_tests") {
deps = [ ":fidl_llcpp_request_response_tests_bin" ]
deprecated_legacy_test_execution = true
}
source_set("conformance_utils") {
testonly = true
public = [ "conformance_utils.h" ]
public_deps = [
"//sdk/lib/fidl/cpp/wire",
"//sdk/lib/fidl_base",
"//zircon/system/public",
"//zircon/system/ulib/zx",
]
# TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}