blob: 50715814435dd850477a5a2758a947396db61f1e [file] [log] [blame]
# 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/chip.gni")
import("//build_overrides/nlunit_test.gni")
import("${chip_root}/build/chip/chip_test_suite.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/src/lwip/lwip.gni")
import("${chip_root}/src/platform/device.gni")
config("tests_config") {
include_dirs = [ "." ]
}
chip_test_suite("tests") {
output_name = "libInetLayerTests"
sources = [
"TestInetAddress.cpp",
"TestInetCommon.cpp",
"TestInetCommon.h",
"TestInetCommonOptions.cpp",
"TestInetCommonOptions.h",
"TestInetEndPoint.cpp",
"TestInetErrorStr.cpp",
"TestInetLayer.cpp",
"TestInetLayer.h",
"TestInetLayerCommon.cpp",
]
if (lwip_platform == "standalone") {
sources += [
"TapAddrAutoconf.cpp",
"TapAddrAutoconf.h",
]
}
public_configs = [ ":tests_config" ]
public_deps = [
"${chip_root}/src/inet",
"${chip_root}/src/lib/core",
"${nlunit_test_root}:nlunit-test",
]
tests = [
"TestInetAddress",
"TestInetErrorStr",
"TestInetEndPoint",
]
# This fails on Raspberry Pi (Linux arm64), so only enable on Linux
# x64.
if (current_os != "mac" && chip_device_platform != "esp32" &&
current_cpu == "x64") {
sources += [
"TestInetLayerDNS.cpp",
"TestLwIPDNS.cpp",
]
tests += [ "TestInetLayerDNS" ]
}
}
if (chip_enable_happy_tests) {
# The following binaries should be executed by happy.
chip_test_suite("happy_tests") {
output_name = "libHappyTestInetCommon"
sources = [ "TestInetLayerMulticast.cpp" ]
public_configs = [ ":tests_config" ]
public_deps = [
":tests_common",
"${chip_root}/src/inet",
"${chip_root}/src/lib/core",
"${nlunit_test_root}:nlunit-test",
]
tests = [ "TestInetLayerMulticast" ]
}
}