Skip to content

Commit

Permalink
Remove a lot of nlio dependencies, enable TestUDP (#31802)
Browse files Browse the repository at this point in the history
* Enable TestUDP and remove nlbyteorder include

* Drop some nlio dependencies ... I am not sure they are needed

* Drop a lot of nlio dependencies all over the place

* Split out chipencoding as a standalone

* Restyle
  • Loading branch information
andy31415 authored Feb 1, 2024
1 parent b57412c commit a77e01c
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 37 deletions.
2 changes: 0 additions & 2 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/mbedtls.gni")
import("//build_overrides/nlassert.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")
import("//build_overrides/pigweed.gni")

Expand Down Expand Up @@ -136,7 +135,6 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"${chip_root}/src/system",
"${chip_root}/src/transport",
"${nlassert_root}:nlassert",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
]

Expand Down
2 changes: 0 additions & 2 deletions src/inet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlassert.gni")
import("//build_overrides/nlfaultinjection.gni")
import("//build_overrides/nlio.gni")

import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/build/chip/tests.gni")
Expand Down Expand Up @@ -104,7 +103,6 @@ static_library("inet") {
"${chip_root}/src/lib/support",
"${chip_root}/src/platform:platform_config_header",
"${chip_root}/src/system",
"${nlio_root}:nlio",
]

if (chip_system_config_use_lwip) {
Expand Down
7 changes: 5 additions & 2 deletions src/lib/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ source_set("error") {
]
}

source_set("encoding") {
sources = [ "CHIPEncoding.h" ]
public_deps = [ "${nlio_root}:nlio" ]
}

source_set("types") {
sources = [
"CHIPSafeCasts.h",
Expand All @@ -128,7 +133,6 @@ static_library("core") {
"CASEAuthTag.h",
"CHIPCallback.h",
"CHIPCore.h",
"CHIPEncoding.h",
"CHIPKeyIds.cpp",
"CHIPKeyIds.h",
"CHIPPersistentStorageDelegate.h",
Expand Down Expand Up @@ -172,7 +176,6 @@ static_library("core") {
"${chip_root}/src/inet",
"${chip_root}/src/lib/support",
"${chip_root}/src/system",
"${nlio_root}:nlio",
]

allow_circular_includes_from = [
Expand Down
3 changes: 1 addition & 2 deletions src/lib/support/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlassert.gni")
import("//build_overrides/nlfaultinjection.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")
import("//build_overrides/pigweed.gni")

Expand Down Expand Up @@ -256,12 +255,12 @@ static_library("support") {
":verifymacros",
":verifymacros_no_logging",
"${chip_root}/src/lib/core:chip_config_header",
"${chip_root}/src/lib/core:encoding",
"${chip_root}/src/lib/core:error",
"${chip_root}/src/lib/core:types",
"${chip_root}/src/platform:platform_config_header",
"${chip_root}/src/system:system_config_header",
"${nlassert_root}:nlassert",
"${nlio_root}:nlio",
]

# These are needed because we include CHIPCore.h, which uses config
Expand Down
3 changes: 0 additions & 3 deletions src/messaging/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
Expand All @@ -37,7 +36,6 @@ static_library("helpers") {
"${chip_root}/src/protocols",
"${chip_root}/src/transport",
"${chip_root}/src/transport/tests:helpers",
"${nlio_root}:nlio",
]
}

Expand Down Expand Up @@ -78,7 +76,6 @@ chip_test_suite_using_nltest("tests") {
"${chip_root}/src/protocols",
"${chip_root}/src/transport",
"${chip_root}/src/transport/raw/tests:helpers",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
]

Expand Down
1 change: 0 additions & 1 deletion src/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/pigweed.gni")

import("${build_root}/config/linux/pkg_config.gni")
Expand Down
4 changes: 0 additions & 4 deletions src/platform/Linux/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@

#include <app-common/zap-generated/ids/Attributes.h>

#include <nlbyteorder.hpp>
#include <nlio-byteorder.hpp>
#include <nlio.hpp>

using namespace ::chip::app;
using namespace ::chip::app::Clusters;
using namespace chip::DeviceLayer::NetworkCommissioning;
Expand Down
4 changes: 0 additions & 4 deletions src/platform/webos/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@

#include <app-common/zap-generated/ids/Attributes.h>

#include <nlbyteorder.hpp>
#include <nlio-byteorder.hpp>
#include <nlio.hpp>

using namespace ::chip::app;
using namespace ::chip::app::Clusters;
using namespace chip::DeviceLayer::NetworkCommissioning;
Expand Down
2 changes: 0 additions & 2 deletions src/protocols/bdx/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
Expand All @@ -33,7 +32,6 @@ chip_test_suite_using_nltest("tests") {
"${chip_root}/src/lib/support",
"${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/protocols/bdx",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
]

Expand Down
2 changes: 0 additions & 2 deletions src/protocols/secure_channel/tests/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")
import("${chip_root}/build/chip/chip_test_suite.gni")
import("${chip_root}/src/app/icd/icd.gni")
Expand Down Expand Up @@ -35,7 +34,6 @@ chip_test_suite_using_nltest("tests") {
"${chip_root}/src/protocols",
"${chip_root}/src/protocols/secure_channel",
"${chip_root}/src/transport/raw/tests:helpers",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
]

Expand Down
2 changes: 0 additions & 2 deletions src/protocols/user_directed_commissioning/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
Expand All @@ -27,7 +26,6 @@ chip_test_suite_using_nltest("tests") {
"${chip_root}/src/lib/support",
"${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/protocols",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
]

Expand Down
2 changes: 0 additions & 2 deletions src/transport/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/pigweed.gni")
import("${chip_root}/src/ble/ble.gni")
import("${chip_root}/src/lib/core/core.gni")
Expand Down Expand Up @@ -68,7 +67,6 @@ static_library("transport") {
"${chip_root}/src/tracing",
"${chip_root}/src/tracing:macros",
"${chip_root}/src/transport/raw",
"${nlio_root}:nlio",
]

if (chip_enable_transport_trace) {
Expand Down
3 changes: 1 addition & 2 deletions src/transport/raw/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
Expand Down Expand Up @@ -43,6 +42,7 @@ chip_test_suite_using_nltest("tests") {
"TestMessageHeader.cpp",
"TestPeerAddress.cpp",
"TestTCP.cpp",
"TestUDP.cpp",
]

public_deps = [
Expand All @@ -54,7 +54,6 @@ chip_test_suite_using_nltest("tests") {
"${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/transport",
"${chip_root}/src/transport/raw",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
]

Expand Down
1 change: 0 additions & 1 deletion src/transport/raw/tests/TestTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <transport/TransportMgr.h>
#include <transport/raw/TCP.h>

#include <nlbyteorder.h>
#include <nlunit-test.h>

#include <errno.h>
Expand Down
3 changes: 1 addition & 2 deletions src/transport/raw/tests/TestUDP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <transport/TransportMgr.h>
#include <transport/raw/UDP.h>

#include <nlbyteorder.h>
#include <nlunit-test.h>

#include <errno.h>
Expand Down Expand Up @@ -196,7 +195,7 @@ static nlTestSuite sSuite =
*/
static int Initialize(void * aContext)
{
CHIP_ERROR err = reinterpret_cast<TestContext *>(aContext)->Init(&sSuite);
CHIP_ERROR err = reinterpret_cast<TestContext *>(aContext)->Init();
return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE;
}

Expand Down
2 changes: 0 additions & 2 deletions src/transport/retransmit/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
Expand All @@ -32,7 +31,6 @@ chip_test_suite_using_nltest("tests") {
public_deps = [
"${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/transport/retransmit",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
]

Expand Down
2 changes: 0 additions & 2 deletions src/transport/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
Expand Down Expand Up @@ -59,7 +58,6 @@ chip_test_suite_using_nltest("tests") {
"${chip_root}/src/protocols",
"${chip_root}/src/transport",
"${chip_root}/src/transport/tests:helpers",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
]
}

0 comments on commit a77e01c

Please sign in to comment.