| # 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_sm = "../public/pw_bluetooth_sapphire/internal/host/sm" |
| |
| pw_source_set("definitions") { |
| public = [ |
| "$dir_public_sm/error.h", |
| "$dir_public_sm/packet.h", |
| "$dir_public_sm/smp.h", |
| "$dir_public_sm/types.h", |
| ] |
| |
| sources = [ |
| "error.cc", |
| "packet.cc", |
| "types.cc", |
| ] |
| |
| public_deps = [ |
| "//src/connectivity/bluetooth/core/bt-host/common", |
| "//src/connectivity/bluetooth/core/bt-host/hci-spec", # hci_spec::LinkKey |
| ] |
| } |
| |
| pw_source_set("sm") { |
| public = [ |
| "$dir_public_sm/ecdh_key.h", |
| "$dir_public_sm/pairing_channel.h", |
| "$dir_public_sm/pairing_phase.h", |
| "$dir_public_sm/phase_1.h", |
| "$dir_public_sm/phase_2_legacy.h", |
| "$dir_public_sm/phase_2_secure_connections.h", |
| "$dir_public_sm/phase_3.h", |
| "$dir_public_sm/sc_stage_1.h", |
| "$dir_public_sm/sc_stage_1_just_works_numeric_comparison.h", |
| "$dir_public_sm/sc_stage_1_passkey.h", |
| "$dir_public_sm/security_manager.h", |
| "$dir_public_sm/security_request_phase.h", |
| "$dir_public_sm/util.h", |
| ] |
| |
| sources = [ |
| "ecdh_key.cc", |
| "pairing_channel.cc", |
| "pairing_phase.cc", |
| "phase_1.cc", |
| "phase_2_legacy.cc", |
| "phase_2_secure_connections.cc", |
| "phase_3.cc", |
| "sc_stage_1_just_works_numeric_comparison.cc", |
| "sc_stage_1_passkey.cc", |
| "security_manager.cc", |
| "security_request_phase.cc", |
| "util.cc", |
| ] |
| |
| public_deps = [ |
| ":definitions", |
| "$dir_pw_string", |
| "$dir_pw_third_party/boringssl", |
| "$dir_pw_third_party/fuchsia:fit", |
| "//src/connectivity/bluetooth/core/bt-host:config", |
| "//src/connectivity/bluetooth/core/bt-host/gap:definitions", |
| "//src/connectivity/bluetooth/core/bt-host/hci", |
| "//src/connectivity/bluetooth/core/bt-host/l2cap", |
| ] |
| } |
| |
| pw_source_set("testing") { |
| testonly = true |
| |
| public = [ |
| "$dir_public_sm/fake_phase_listener.h", |
| "$dir_public_sm/test_security_manager.h", |
| ] |
| |
| sources = [ "test_security_manager.cc" ] |
| |
| deps = [ ":sm" ] |
| } |
| |
| pw_test("tests") { |
| sources = [ |
| "ecdh_key_test.cc", |
| "error_test.cc", |
| "packet_test.cc", |
| "pairing_channel_test.cc", |
| "pairing_phase_test.cc", |
| "phase_1_test.cc", |
| "phase_2_legacy_test.cc", |
| "phase_2_secure_connections_test.cc", |
| "phase_3_test.cc", |
| "sc_stage_1_just_works_numeric_comparison_test.cc", |
| "sc_stage_1_passkey_test.cc", |
| "security_manager_test.cc", |
| "security_request_phase_test.cc", |
| "types_test.cc", |
| "util_test.cc", |
| ] |
| |
| deps = [ |
| ":sm", |
| ":testing", |
| "//src/connectivity/bluetooth/core/bt-host/hci:testing", |
| "//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("valid_packet_reader_fuzzer") { |
| sources = [ "valid_packet_reader_parse_sdu_fuzztest.cc" ] |
| deps = [ |
| ":definitions", |
| "//src/connectivity/bluetooth/core/bt-host/testing:fuzztest_driver", |
| ] |
| } |
| |
| pw_fuzzer("pw_valid_packet_reader_fuzzer") { |
| sources = [ "valid_packet_reader_parse_sdu_fuzztest.cc" ] |
| deps = [ ":definitions" ] |
| } |
| |
| pw_test_group("tests_and_fuzzers") { |
| tests = [ |
| ":tests", |
| ":pw_valid_packet_reader_fuzzer_test", |
| ] |
| } |
| |
| bazel_fuchsia_test_package("test_pkg") { |
| test_package_name = "sm_tests" |
| test_component_names = [ "sm_test_autogen_cml" ] |
| } |