blob: 5712cd460d5d3486c10e865e9805aba654257348 [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/bazel/bazel_fuchsia_test_package.gni")
import("//build/fuzz.gni")
import("//build_overrides/pigweed.gni")
import("$dir_pw_fuzzer/fuzzer.gni")
import("$dir_pw_unit_test/test.gni")
dir_public_sdp = "../public/pw_bluetooth_sapphire/internal/host/sdp"
# Basic target with protocol definitions and no logic, suitable for test
# emulation.
pw_source_set("definitions") {
public = [
"$dir_public_sdp/data_element.h",
"$dir_public_sdp/error.h",
"$dir_public_sdp/sdp.h",
"$dir_public_sdp/service_record.h",
]
sources = [
"data_element.cc",
"error.cc",
"service_record.cc",
]
public_deps = [ "//src/connectivity/bluetooth/core/bt-host/common" ]
}
pw_source_set("sdp") {
public = [
"$dir_public_sdp/client.h",
"$dir_public_sdp/pdu.h",
"$dir_public_sdp/server.h",
"$dir_public_sdp/service_discoverer.h",
]
sources = [
"client.cc",
"pdu.cc",
"server.cc",
"service_discoverer.cc",
]
public_deps = [
":definitions",
"$dir_pw_third_party/fuchsia:stdcompat",
"//src/connectivity/bluetooth/core/bt-host/l2cap",
]
}
pw_test("tests") {
sources = [
"client_test.cc",
"data_element_test.cc",
"pdu_test.cc",
"server_test.cc",
"service_discoverer_test.cc",
"service_record_test.cc",
]
deps = [
":sdp",
"//src/connectivity/bluetooth/core/bt-host/common",
"//src/connectivity/bluetooth/core/bt-host/l2cap:testing",
"//src/connectivity/bluetooth/core/bt-host/testing",
]
test_main = "//src/connectivity/bluetooth/core/bt-host/testing:gtest_main"
}
fuchsia_library_fuzzer("data_element_fuzzer") {
sources = [ "data_element_fuzztest.cc" ]
deps = [
":definitions",
"//src/connectivity/bluetooth/core/bt-host/testing:fuzztest_driver",
]
}
pw_fuzzer("pw_data_element_fuzzer") {
sources = [ "data_element_fuzztest.cc" ]
deps = [ ":definitions" ]
}
fuchsia_library_fuzzer("pdu_fuzzer") {
sources = [ "pdu_fuzztest.cc" ]
deps = [
":sdp",
"//src/connectivity/bluetooth/core/bt-host/testing:fuzztest_driver",
]
}
pw_fuzzer("pw_pdu_fuzzer") {
sources = [ "pdu_fuzztest.cc" ]
deps = [ ":sdp" ]
}
pw_test_group("tests_and_fuzzers") {
tests = [
":tests",
":pw_data_element_fuzzer_test",
":pw_pdu_fuzzer_test",
]
}
bazel_fuchsia_test_package("test_pkg") {
test_package_name = "sdp_tests"
test_component_names = [ "sdp_test_autogen_cml" ]
}