Skip to content

Commit 6545559

Browse files
committed
making TestInetLayer an executable tool
1 parent ab2907b commit 6545559

File tree

5 files changed

+19
-274
lines changed

5 files changed

+19
-274
lines changed

BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
161161
"${chip_root}/examples/shell/standalone:chip-shell",
162162
"${chip_root}/src/app/tests/integration:chip-im-initiator",
163163
"${chip_root}/src/app/tests/integration:chip-im-responder",
164+
"${chip_root}/src/inet/tests:inet-layer-test-tool",
164165
"${chip_root}/src/lib/address_resolve:address-resolve-tool",
165166
"${chip_root}/src/messaging/tests/echo:chip-echo-requester",
166167
"${chip_root}/src/messaging/tests/echo:chip-echo-responder",

src/inet/tests/BUILD.gn

+16-12
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import("${chip_root}/build/chip/tests.gni")
2121
import("${chip_root}/src/platform/device.gni")
2222
import("${chip_root}/src/system/system.gni")
2323

24+
import("${chip_root}/build/chip/tools.gni")
25+
2426
config("tests_config") {
2527
include_dirs = [ "." ]
2628
}
@@ -40,10 +42,6 @@ static_library("helpers") {
4042
"TestSetupSignallingPosix.cpp",
4143
]
4244

43-
if (current_os != "mbed") {
44-
sources += [ "TestInetLayer.cpp" ]
45-
}
46-
4745
if (chip_with_nlfaultinjection) {
4846
sources += [
4947
"TestSetupFaultInjection.h",
@@ -81,14 +79,20 @@ chip_test_suite("tests") {
8179
test_sources += [ "TestInetEndPoint.cpp" ]
8280
}
8381

84-
# This fails on Raspberry Pi (Linux arm64), so only enable on Linux
85-
# x64.
86-
if (current_os != "mac" && current_os != "zephyr" &&
87-
chip_device_platform != "esp32" && current_cpu == "x64" &&
88-
chip_device_platform != "ameba") {
89-
# TODO: This test does not seem executed
90-
sources += [ "TestLwIPDNS.cpp" ]
91-
}
82+
cflags = [ "-Wconversion" ]
83+
}
84+
85+
executable("inet-layer-test-tool") {
86+
sources = [ "InetLayerTestTool.cpp" ]
9287

9388
cflags = [ "-Wconversion" ]
89+
90+
public_deps = [
91+
":helpers",
92+
"${chip_root}/src/inet",
93+
"${chip_root}/src/lib/core",
94+
"${chip_root}/src/platform",
95+
]
96+
97+
output_dir = root_out_dir
9498
}
File renamed without changes.

src/inet/tests/TestInetLayerCommon.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ extern bool IsSender();
126126
extern bool IsTesting(const TestStatus & aTestStatus);
127127
extern bool WasSuccessful(const TestStatus & aTestStatus);
128128

129-
extern chip::System::PacketBufferHandle MakeDataBuffer(uint16_t aDesiredLength, uint8_t aFirstValue);
130-
extern chip::System::PacketBufferHandle MakeDataBuffer(uint16_t aDesiredLength);
129+
extern chip::System::PacketBufferHandle MakeDataBuffer(size_t aDesiredLength, uint8_t aFirstValue);
130+
extern chip::System::PacketBufferHandle MakeDataBuffer(size_t aDesiredLength);
131131
extern chip::System::PacketBufferHandle MakeICMPv4DataBuffer(uint16_t aDesiredUserLength);
132132
extern chip::System::PacketBufferHandle MakeICMPv6DataBuffer(uint16_t aDesiredUserLength);
133133

src/inet/tests/TestLwIPDNS.cpp

-260
This file was deleted.

0 commit comments

Comments
 (0)