1 # Copyright (c) 2020 Project CHIP Authors
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 import("//build_overrides/build.gni")
16 import("//build_overrides/chip.gni")
17 import("//build_overrides/nlunit_test.gni")
19 import("${chip_root}/build/chip/chip_test_suite.gni")
20 import("${chip_root}/build/chip/tests.gni")
21 import("${chip_root}/src/lwip/lwip.gni")
22 import("${chip_root}/src/platform/device.gni")
24 config("tests_config") {
25 include_dirs = [ "." ]
28 static_library("helpers") {
29 output_name = "libInetTestHelpers"
30 output_dir = "${root_out_dir}/lib"
34 "TestInetCommonOptions.cpp",
35 "TestInetCommonOptions.h",
36 "TestInetCommonPosix.cpp",
38 "TestInetLayerCommon.cpp",
39 "TestSetupFaultInjection.h",
40 "TestSetupFaultInjectionPosix.cpp",
41 "TestSetupSignalling.h",
42 "TestSetupSignallingPosix.cpp",
45 cflags = [ "-Wconversion" ]
48 "${chip_root}/src/inet",
49 "${chip_root}/src/lib/core",
50 "${nlunit_test_root}:nlunit-test",
54 chip_test_suite("tests") {
55 output_name = "libInetLayerTests"
57 public_configs = [ ":tests_config" ]
61 "${chip_root}/src/inet",
62 "${chip_root}/src/lib/core",
63 "${nlunit_test_root}:nlunit-test",
67 "TestInetAddress.cpp",
68 "TestInetErrorStr.cpp",
72 if (current_os != "zephyr") {
73 test_sources += [ "TestInetEndPoint.cpp" ]
76 # This fails on Raspberry Pi (Linux arm64), so only enable on Linux
78 if (current_os != "mac" && current_os != "zephyr" &&
79 chip_device_platform != "esp32" && current_cpu == "x64") {
80 test_sources += [ "TestInetLayerDNS.cpp" ]
82 # TODO: This test does not seem executed
83 sources += [ "TestLwIPDNS.cpp" ]
87 if (chip_enable_happy_tests) {
88 # The following binaries should be executed by happy.
89 chip_test_suite("happy_tests") {
90 output_name = "libHappyTestInetCommon"
92 sources = [ "TestInetLayerMulticast.cpp" ]
94 public_configs = [ ":tests_config" ]
98 "${chip_root}/src/inet",
99 "${chip_root}/src/lib/core",
100 "${nlunit_test_root}:nlunit-test",
103 tests = [ "TestInetLayerMulticast" ]