Skip to content

Commit

Permalink
making TestInetLayer an executable tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Alami-Amine committed Jun 18, 2024
1 parent ab2907b commit aa25628
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 276 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"${chip_root}/examples/shell/standalone:chip-shell",
"${chip_root}/src/app/tests/integration:chip-im-initiator",
"${chip_root}/src/app/tests/integration:chip-im-responder",
"${chip_root}/src/inet/tests:inet-layer-test-tool",
"${chip_root}/src/lib/address_resolve:address-resolve-tool",
"${chip_root}/src/messaging/tests/echo:chip-echo-requester",
"${chip_root}/src/messaging/tests/echo:chip-echo-responder",
Expand Down
33 changes: 20 additions & 13 deletions src/inet/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
import("${chip_root}/build/chip/tests.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")
}

import("${chip_root}/build/chip/tools.gni")

config("tests_config") {
include_dirs = [ "." ]
}
Expand All @@ -40,10 +45,6 @@ static_library("helpers") {
"TestSetupSignallingPosix.cpp",
]

if (current_os != "mbed") {
sources += [ "TestInetLayer.cpp" ]
}

if (chip_with_nlfaultinjection) {
sources += [
"TestSetupFaultInjection.h",
Expand Down Expand Up @@ -81,14 +82,20 @@ chip_test_suite("tests") {
test_sources += [ "TestInetEndPoint.cpp" ]
}

# This fails on Raspberry Pi (Linux arm64), so only enable on Linux
# x64.
if (current_os != "mac" && current_os != "zephyr" &&
chip_device_platform != "esp32" && current_cpu == "x64" &&
chip_device_platform != "ameba") {
# TODO: This test does not seem executed
sources += [ "TestLwIPDNS.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",
]

output_dir = root_out_dir
}
4 changes: 2 additions & 2 deletions src/inet/tests/TestInetLayerCommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ extern bool IsSender();
extern bool IsTesting(const TestStatus & aTestStatus);
extern bool WasSuccessful(const TestStatus & aTestStatus);

extern chip::System::PacketBufferHandle MakeDataBuffer(uint16_t aDesiredLength, uint8_t aFirstValue);
extern chip::System::PacketBufferHandle MakeDataBuffer(uint16_t aDesiredLength);
extern chip::System::PacketBufferHandle MakeDataBuffer(size_t aDesiredLength, uint8_t aFirstValue);
extern chip::System::PacketBufferHandle MakeDataBuffer(size_t aDesiredLength);
extern chip::System::PacketBufferHandle MakeICMPv4DataBuffer(uint16_t aDesiredUserLength);
extern chip::System::PacketBufferHandle MakeICMPv6DataBuffer(uint16_t aDesiredUserLength);

Expand Down
260 changes: 0 additions & 260 deletions src/inet/tests/TestLwIPDNS.cpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ using namespace chip::System;

/* Preprocessor Macros */

#define kToolName "TestInetLayer"
#define kToolName "inet-layer-test-tool"

#define kToolOptTCPIP 't'

Expand Down

0 comments on commit aa25628

Please sign in to comment.