| # Copyright (c) 2026 Project CHIP Authors | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| import("//build_overrides/build.gni") | |
| import("//build_overrides/chip.gni") | |
| import("//build_overrides/pigweed.gni") | |
| import("${chip_root}/build/chip/chip_test_suite.gni") | |
| import("${chip_root}/src/ble/ble.gni") | |
| import("${chip_root}/src/platform/device.gni") | |
| chip_test_suite("tests") { | |
| output_name = "TestCommissioningProxyCluster" | |
| test_sources = [ | |
| "TestCommissioningProxyBgScanRegistry.cpp", | |
| "TestCommissioningProxyCluster.cpp", | |
| ] | |
| # CodegenIntegration.cpp holds only the empty ember init/shutdown callbacks that | |
| # an app's ZAP-generated codedriven-init-shutdown.cpp calls. There is no behaviour | |
| # to assert, but compiling it here keeps it building in a PR that ships no app. | |
| sources = [ | |
| "../CodegenIntegration.cpp", | |
| "../CodegenIntegration.h", | |
| "CommissioningProxyMockTimer.h", | |
| "CommissioningProxyMockTransport.cpp", | |
| "CommissioningProxyMockTransport.h", | |
| ] | |
| cflags = [ "-Wconversion" ] | |
| # The transports the cluster advertises come from the drivers registered at | |
| # runtime, so no transport build flags need forcing here. Tests read | |
| # GetSupportedTransports() and skip transport-specific cases when the | |
| # corresponding bit is absent. | |
| public_deps = [ | |
| "${chip_root}/src/app/clusters/commissioning-proxy-server", | |
| "${chip_root}/src/app/data-model-provider/tests:encode-decode", | |
| "${chip_root}/src/app/server-cluster/testing", | |
| "${chip_root}/src/lib/support", | |
| "${chip_root}/src/lib/support:timer-delegate-mock", | |
| ] | |
| # The BLE driver and its tests only exist when BLE is enabled - see the ble-transport | |
| # target in ../BUILD.gn. Every test in TestCommissioningProxyBleTransport.cpp drives | |
| # that driver, so the whole file goes with it. | |
| if (chip_config_network_layer_ble) { | |
| test_sources += [ "TestCommissioningProxyBleTransport.cpp" ] | |
| # Depend on the target rather than listing CommissioningProxyBleTransport.cpp here, | |
| # so the driver is compiled once. | |
| public_deps += [ | |
| "${chip_root}/src/app/clusters/commissioning-proxy-server:ble-transport", | |
| ] | |
| } | |
| # Same for Wi-Fi PAF: the driver and the tests that drive it only exist when the PAF | |
| # stack is enabled. | |
| if (chip_device_config_enable_wifipaf) { | |
| test_sources += [ "TestCommissioningProxyPafTransport.cpp" ] | |
| public_deps += [ | |
| "${chip_root}/src/app/clusters/commissioning-proxy-server:paf-transport", | |
| ] | |
| } | |
| } |