blob: 376693a15c205c5381e9eaf937e4e190e08dff7a [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/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlfaultinjection.gni")
import("//build_overrides/pigweed.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/platform/device.gni")
import("${chip_root}/src/system/system.gni")
if (chip_build_tests) {
import("${chip_root}/build/chip/chip_test_suite.gni")
}
config("tests_config") {
include_dirs = [ "." ]
}
static_library("helpers") {
output_name = "libInetTestHelpers"
output_dir = "${root_out_dir}/lib"
sources = [
"TestInetCommon.h",
"TestInetCommonOptions.cpp",
"TestInetCommonOptions.h",
"TestInetCommonPosix.cpp",
"TestInetLayerCommon.cpp",
"TestInetLayerCommon.hpp",
"TestSetupSignalling.h",
"TestSetupSignallingPosix.cpp",
]
cflags = [ "-Wconversion" ]
public_deps = [
"${chip_root}/src/inet",
"${chip_root}/src/lib/core",
"${chip_root}/src/platform",
]
if (chip_with_nlfaultinjection) {
sources += [
"TestSetupFaultInjection.h",
"TestSetupFaultInjectionPosix.cpp",
]
}
}
if (chip_build_tests) {
chip_test_suite("tests") {
output_name = "libInetLayerTests"
public_configs = [ ":tests_config" ]
public_deps = [
":helpers",
"${chip_root}/src/inet",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/core:string-builder-adapters",
]
test_sources = [
"TestBasicPacketFilters.cpp",
"TestInetAddress.cpp",
"TestInetErrorStr.cpp",
]
sources = []
if (chip_system_config_use_sockets && current_os != "zephyr") {
test_sources += [ "TestInetEndPoint.cpp" ]
}
cflags = [ "-Wconversion" ]
}
}
executable("inet-layer-test-tool") {
sources = [ "inet-layer-test-tool.cpp" ]
cflags = [ "-Wconversion" ]
public_deps = [
":helpers",
"${chip_root}/src/inet",
"${chip_root}/src/lib/core",
"${chip_root}/src/platform",
"${chip_root}/src/platform/logging:default",
]
output_dir = root_out_dir
}