Skip to content

Commit a77e01c

Browse files
authored
Remove a lot of nlio dependencies, enable TestUDP (#31802)
* 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
1 parent b57412c commit a77e01c

File tree

17 files changed

+8
-37
lines changed

17 files changed

+8
-37
lines changed

BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
1717
import("//build_overrides/mbedtls.gni")
1818
import("//build_overrides/nlassert.gni")
19-
import("//build_overrides/nlio.gni")
2019
import("//build_overrides/nlunit_test.gni")
2120
import("//build_overrides/pigweed.gni")
2221

@@ -136,7 +135,6 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
136135
"${chip_root}/src/system",
137136
"${chip_root}/src/transport",
138137
"${nlassert_root}:nlassert",
139-
"${nlio_root}:nlio",
140138
"${nlunit_test_root}:nlunit-test",
141139
]
142140

src/inet/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
1717
import("//build_overrides/nlassert.gni")
1818
import("//build_overrides/nlfaultinjection.gni")
19-
import("//build_overrides/nlio.gni")
2019

2120
import("${chip_root}/build/chip/buildconfig_header.gni")
2221
import("${chip_root}/build/chip/tests.gni")
@@ -104,7 +103,6 @@ static_library("inet") {
104103
"${chip_root}/src/lib/support",
105104
"${chip_root}/src/platform:platform_config_header",
106105
"${chip_root}/src/system",
107-
"${nlio_root}:nlio",
108106
]
109107

110108
if (chip_system_config_use_lwip) {

src/lib/core/BUILD.gn

+5-2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ source_set("error") {
104104
]
105105
}
106106

107+
source_set("encoding") {
108+
sources = [ "CHIPEncoding.h" ]
109+
public_deps = [ "${nlio_root}:nlio" ]
110+
}
111+
107112
source_set("types") {
108113
sources = [
109114
"CHIPSafeCasts.h",
@@ -128,7 +133,6 @@ static_library("core") {
128133
"CASEAuthTag.h",
129134
"CHIPCallback.h",
130135
"CHIPCore.h",
131-
"CHIPEncoding.h",
132136
"CHIPKeyIds.cpp",
133137
"CHIPKeyIds.h",
134138
"CHIPPersistentStorageDelegate.h",
@@ -172,7 +176,6 @@ static_library("core") {
172176
"${chip_root}/src/inet",
173177
"${chip_root}/src/lib/support",
174178
"${chip_root}/src/system",
175-
"${nlio_root}:nlio",
176179
]
177180

178181
allow_circular_includes_from = [

src/lib/support/BUILD.gn

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
1717
import("//build_overrides/nlassert.gni")
1818
import("//build_overrides/nlfaultinjection.gni")
19-
import("//build_overrides/nlio.gni")
2019
import("//build_overrides/nlunit_test.gni")
2120
import("//build_overrides/pigweed.gni")
2221

@@ -256,12 +255,12 @@ static_library("support") {
256255
":verifymacros",
257256
":verifymacros_no_logging",
258257
"${chip_root}/src/lib/core:chip_config_header",
258+
"${chip_root}/src/lib/core:encoding",
259259
"${chip_root}/src/lib/core:error",
260260
"${chip_root}/src/lib/core:types",
261261
"${chip_root}/src/platform:platform_config_header",
262262
"${chip_root}/src/system:system_config_header",
263263
"${nlassert_root}:nlassert",
264-
"${nlio_root}:nlio",
265264
]
266265

267266
# These are needed because we include CHIPCore.h, which uses config

src/messaging/tests/BUILD.gn

-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17-
import("//build_overrides/nlio.gni")
1817
import("//build_overrides/nlunit_test.gni")
1918

2019
import("${chip_root}/build/chip/chip_test_suite.gni")
@@ -37,7 +36,6 @@ static_library("helpers") {
3736
"${chip_root}/src/protocols",
3837
"${chip_root}/src/transport",
3938
"${chip_root}/src/transport/tests:helpers",
40-
"${nlio_root}:nlio",
4139
]
4240
}
4341

@@ -78,7 +76,6 @@ chip_test_suite_using_nltest("tests") {
7876
"${chip_root}/src/protocols",
7977
"${chip_root}/src/transport",
8078
"${chip_root}/src/transport/raw/tests:helpers",
81-
"${nlio_root}:nlio",
8279
"${nlunit_test_root}:nlunit-test",
8380
]
8481

src/platform/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17-
import("//build_overrides/nlio.gni")
1817
import("//build_overrides/pigweed.gni")
1918

2019
import("${build_root}/config/linux/pkg_config.gni")

src/platform/Linux/ThreadStackManagerImpl.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828

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

31-
#include <nlbyteorder.hpp>
32-
#include <nlio-byteorder.hpp>
33-
#include <nlio.hpp>
34-
3531
using namespace ::chip::app;
3632
using namespace ::chip::app::Clusters;
3733
using namespace chip::DeviceLayer::NetworkCommissioning;

src/platform/webos/ThreadStackManagerImpl.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727

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

30-
#include <nlbyteorder.hpp>
31-
#include <nlio-byteorder.hpp>
32-
#include <nlio.hpp>
33-
3430
using namespace ::chip::app;
3531
using namespace ::chip::app::Clusters;
3632
using namespace chip::DeviceLayer::NetworkCommissioning;

src/protocols/bdx/tests/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17-
import("//build_overrides/nlio.gni")
1817
import("//build_overrides/nlunit_test.gni")
1918

2019
import("${chip_root}/build/chip/chip_test_suite.gni")
@@ -33,7 +32,6 @@ chip_test_suite_using_nltest("tests") {
3332
"${chip_root}/src/lib/support",
3433
"${chip_root}/src/lib/support:testing_nlunit",
3534
"${chip_root}/src/protocols/bdx",
36-
"${nlio_root}:nlio",
3735
"${nlunit_test_root}:nlunit-test",
3836
]
3937

src/protocols/secure_channel/tests/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import("//build_overrides/build.gni")
22
import("//build_overrides/chip.gni")
3-
import("//build_overrides/nlio.gni")
43
import("//build_overrides/nlunit_test.gni")
54
import("${chip_root}/build/chip/chip_test_suite.gni")
65
import("${chip_root}/src/app/icd/icd.gni")
@@ -35,7 +34,6 @@ chip_test_suite_using_nltest("tests") {
3534
"${chip_root}/src/protocols",
3635
"${chip_root}/src/protocols/secure_channel",
3736
"${chip_root}/src/transport/raw/tests:helpers",
38-
"${nlio_root}:nlio",
3937
"${nlunit_test_root}:nlunit-test",
4038
]
4139

src/protocols/user_directed_commissioning/tests/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import("//build_overrides/build.gni")
1414
import("//build_overrides/chip.gni")
15-
import("//build_overrides/nlio.gni")
1615
import("//build_overrides/nlunit_test.gni")
1716

1817
import("${chip_root}/build/chip/chip_test_suite.gni")
@@ -27,7 +26,6 @@ chip_test_suite_using_nltest("tests") {
2726
"${chip_root}/src/lib/support",
2827
"${chip_root}/src/lib/support:testing_nlunit",
2928
"${chip_root}/src/protocols",
30-
"${nlio_root}:nlio",
3129
"${nlunit_test_root}:nlunit-test",
3230
]
3331

src/transport/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16-
import("//build_overrides/nlio.gni")
1716
import("//build_overrides/pigweed.gni")
1817
import("${chip_root}/src/ble/ble.gni")
1918
import("${chip_root}/src/lib/core/core.gni")
@@ -68,7 +67,6 @@ static_library("transport") {
6867
"${chip_root}/src/tracing",
6968
"${chip_root}/src/tracing:macros",
7069
"${chip_root}/src/transport/raw",
71-
"${nlio_root}:nlio",
7270
]
7371

7472
if (chip_enable_transport_trace) {

src/transport/raw/tests/BUILD.gn

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17-
import("//build_overrides/nlio.gni")
1817
import("//build_overrides/nlunit_test.gni")
1918

2019
import("${chip_root}/build/chip/chip_test_suite.gni")
@@ -43,6 +42,7 @@ chip_test_suite_using_nltest("tests") {
4342
"TestMessageHeader.cpp",
4443
"TestPeerAddress.cpp",
4544
"TestTCP.cpp",
45+
"TestUDP.cpp",
4646
]
4747

4848
public_deps = [
@@ -54,7 +54,6 @@ chip_test_suite_using_nltest("tests") {
5454
"${chip_root}/src/lib/support:testing_nlunit",
5555
"${chip_root}/src/transport",
5656
"${chip_root}/src/transport/raw",
57-
"${nlio_root}:nlio",
5857
"${nlunit_test_root}:nlunit-test",
5958
]
6059

src/transport/raw/tests/TestTCP.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <transport/TransportMgr.h>
3535
#include <transport/raw/TCP.h>
3636

37-
#include <nlbyteorder.h>
3837
#include <nlunit-test.h>
3938

4039
#include <errno.h>

src/transport/raw/tests/TestUDP.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <transport/TransportMgr.h>
3131
#include <transport/raw/UDP.h>
3232

33-
#include <nlbyteorder.h>
3433
#include <nlunit-test.h>
3534

3635
#include <errno.h>
@@ -196,7 +195,7 @@ static nlTestSuite sSuite =
196195
*/
197196
static int Initialize(void * aContext)
198197
{
199-
CHIP_ERROR err = reinterpret_cast<TestContext *>(aContext)->Init(&sSuite);
198+
CHIP_ERROR err = reinterpret_cast<TestContext *>(aContext)->Init();
200199
return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE;
201200
}
202201

src/transport/retransmit/tests/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17-
import("//build_overrides/nlio.gni")
1817
import("//build_overrides/nlunit_test.gni")
1918

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

src/transport/tests/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17-
import("//build_overrides/nlio.gni")
1817
import("//build_overrides/nlunit_test.gni")
1918

2019
import("${chip_root}/build/chip/chip_test_suite.gni")
@@ -59,7 +58,6 @@ chip_test_suite_using_nltest("tests") {
5958
"${chip_root}/src/protocols",
6059
"${chip_root}/src/transport",
6160
"${chip_root}/src/transport/tests:helpers",
62-
"${nlio_root}:nlio",
6361
"${nlunit_test_root}:nlunit-test",
6462
]
6563
}

0 commit comments

Comments
 (0)