| # Copyright (c) 2020 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/nlunit_test.gni") |
| |
| import("${chip_root}/src/platform/device.gni") |
| |
| declare_args() { |
| # Platform DNSsd should always be running on darwin. On Linux |
| # this depends on avahi being available and running. |
| chip_enable_dnssd_tests = chip_device_platform == "darwin" |
| } |
| |
| if (chip_device_platform != "none" && chip_device_platform != "fake") { |
| import("${chip_root}/build/chip/chip_test_suite.gni") |
| |
| chip_test_suite("tests") { |
| output_name = "libPlatformTests" |
| |
| test_sources = [] |
| |
| if (current_os != "zephyr") { |
| # TODO: unclear as to why this fails on zephyr |
| # pre-conversion this test was not registered as CHIP_REGISTER_TEST_SUITE |
| test_sources += [ "TestPlatformMgr.cpp" ] |
| } |
| |
| public_deps = [ |
| "${chip_root}/src/lib/support", |
| "${chip_root}/src/lib/support:testing", |
| "${chip_root}/src/platform", |
| "${chip_root}/src/system", |
| "${nlunit_test_root}:nlunit-test", |
| ] |
| |
| if (chip_mdns != "none" && chip_enable_dnssd_tests && |
| (chip_device_platform == "linux" || chip_device_platform == "darwin")) { |
| test_sources += [ "TestDnssd.cpp" ] |
| public_deps += [ "${chip_root}/src/lib/dnssd" ] |
| } |
| |
| # These tests appear to be broken on Mac. |
| if (current_os != "mac") { |
| test_sources += [ |
| "TestConfigurationMgr.cpp", |
| "TestPlatformTime.cpp", |
| ] |
| } |
| |
| if (chip_enable_openthread) { |
| # FIXME: TestThreadStackMgr requires ot-br-posix daemon to be running |
| # test_sources += [ "TestThreadStackMgr.cpp" ] |
| } |
| |
| if (chip_enable_ble && |
| (chip_device_platform == "linux" || chip_device_platform == "darwin")) { |
| # FIXME: TestCHIPoBLEStackMgr requires bluetoothd daemon to be running |
| # |
| # TODO: Driver code has a check for only running the test |
| # if the first argument to the test is a '1'. |
| # This is very odd and test should probably be moved as an integration |
| # test rather than a unit test |
| # |
| sources = [ |
| "TestCHIPoBLEStackMgr.cpp", |
| "TestCHIPoBLEStackMgr.h", |
| "TestCHIPoBLEStackMgrDriver.cpp", |
| ] |
| tests = [ "TestCHIPoBLEStackMgr" ] |
| } |
| |
| if (current_os == "zephyr" || current_os == "android" || |
| current_os == "mbed") { |
| test_sources += [ "TestKeyValueStoreMgr.cpp" ] |
| } |
| |
| if (chip_device_platform == "linux") { |
| test_sources += [ "TestConnectivityMgr.cpp" ] |
| } |
| } |
| } else { |
| import("${chip_root}/build/chip/chip_test_group.gni") |
| chip_test_group("tests") { |
| deps = [] |
| } |
| } |