Skip to content

Commit 29a567e

Browse files
Re-enabling unit tests for EFR32 which had been disabled due to flash limitations (#35456)
* Removed as many efr32 checks as possible without having to make code modifications * Updated comments to show error message * Restyled by clang-format * Comment updates * ci testing 1 * Re-added suites * . * . * comment icd tests * removed 5 tests from line 112 * re-enable app/tests in the main tests group * reverted to original (with inconsequential mods) * (addendum) Now actually reverted back to original state (with inconsequential mods) * moved 4 dirs up into the main tests lists * enabled 3-test-set for efr32 * moved tracing tests out of the if * enable platform tests for efr32 * enabled controller and datamodel tests but not the stuff in controller * enabled all tests in controller * add transport tests back in * enabled data_model Test[Commands,Read,Write] * commands is in, read/write is out * added TestRead * Added TestWrite, removed TestRead * src/app/tests remains disabled * changed c-style cast to static_cast * Added TestTLVVectorWriter.cpp back in * comment update * restyle fixes * restyle fixes --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 00bd828 commit 29a567e

File tree

7 files changed

+51
-48
lines changed

7 files changed

+51
-48
lines changed

src/BUILD.gn

+20-23
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,25 @@ if (chip_build_tests) {
5050
chip_test_group("tests") {
5151
deps = []
5252
tests = [
53+
"${chip_root}/src/access/tests",
5354
"${chip_root}/src/app/data-model/tests",
5455
"${chip_root}/src/app/cluster-building-blocks/tests",
5556
"${chip_root}/src/app/data-model-provider/tests",
56-
"${chip_root}/src/access/tests",
57+
"${chip_root}/src/app/icd/server/tests",
5758
"${chip_root}/src/crypto/tests",
5859
"${chip_root}/src/inet/tests",
5960
"${chip_root}/src/lib/address_resolve/tests",
6061
"${chip_root}/src/lib/asn1/tests",
6162
"${chip_root}/src/lib/core/tests",
63+
"${chip_root}/src/lib/format/tests",
6264
"${chip_root}/src/messaging/tests",
6365
"${chip_root}/src/protocols/bdx/tests",
6466
"${chip_root}/src/protocols/interaction_model/tests",
67+
"${chip_root}/src/protocols/secure_channel/tests",
6568
"${chip_root}/src/protocols/user_directed_commissioning/tests",
69+
"${chip_root}/src/system/tests",
6670
"${chip_root}/src/transport/retransmit/tests",
67-
"${chip_root}/src/app/icd/server/tests",
71+
"${chip_root}/src/transport/tests",
6872
]
6973

7074
# Skip DNSSD tests for Mbed platform due to flash memory size limitations
@@ -81,14 +85,12 @@ if (chip_build_tests) {
8185
tests += [ "${chip_root}/src/lib/dnssd/minimal_mdns/records/tests" ]
8286
}
8387

84-
if (current_os != "zephyr" && current_os != "mbed" &&
85-
chip_device_platform != "efr32") {
88+
if (current_os != "zephyr" && current_os != "mbed") {
8689
# Avoid these items from "one single binary" test executions. Once tests
87-
# are split, we can re-visit this (and likely many others)
90+
# are split, we can re-visit this (and likely many others).
8891
#
89-
# In particular:
90-
# "app/codegen-data-model-provider/tests" contains symbols for ember mocks which
91-
# are used by other tests
92+
# In particular: "app/codegen-data-model-provider/tests" contains
93+
# symbols for ember mocks which are used by other tests.
9294

9395
tests += [
9496
"${chip_root}/src/app/codegen-data-model-provider/tests",
@@ -97,30 +99,27 @@ if (chip_build_tests) {
9799
]
98100
}
99101

100-
# Skip on efr32 due to flash and/or ram limitations.
101102
if (chip_device_platform != "efr32") {
103+
tests += [ "${chip_root}/src/app/tests" ]
104+
105+
# Disabled for EFR32 because _open is not implemented.
106+
# https://github.com/project-chip/connectedhomeip/issues/35624
102107
tests += [
103-
"${chip_root}/src/app/tests",
104108
"${chip_root}/src/credentials/tests",
105-
"${chip_root}/src/lib/format/tests",
106109
"${chip_root}/src/lib/support/tests",
107-
"${chip_root}/src/protocols/secure_channel/tests",
108-
"${chip_root}/src/system/tests",
109-
"${chip_root}/src/transport/tests",
110110
]
111+
}
111112

112-
if (matter_enable_tracing_support &&
113-
matter_trace_config == "${chip_root}/src/tracing/multiplexed") {
114-
tests += [ "${chip_root}/src/tracing/tests" ]
115-
}
113+
if (matter_enable_tracing_support &&
114+
matter_trace_config == "${chip_root}/src/tracing/multiplexed") {
115+
tests += [ "${chip_root}/src/tracing/tests" ]
116116
}
117117

118118
if (chip_device_platform != "none") {
119119
tests += [ "${chip_root}/src/lib/dnssd/minimal_mdns/tests" ]
120120
}
121121

122-
if (chip_device_platform != "esp32" && chip_device_platform != "efr32" &&
123-
chip_device_platform != "ameba") {
122+
if (chip_device_platform != "esp32" && chip_device_platform != "ameba") {
124123
tests += [ "${chip_root}/src/platform/tests" ]
125124
}
126125

@@ -130,9 +129,7 @@ if (chip_build_tests) {
130129

131130
# On nrfconnect, the controller tests run into
132131
# https://github.com/project-chip/connectedhomeip/issues/9630
133-
if (chip_device_platform != "nrfconnect" &&
134-
chip_device_platform != "efr32") {
135-
# Doesn't compile on ef32. Multiple definitions issues with attribute storage and overflows flash memory.
132+
if (chip_device_platform != "nrfconnect") {
136133
tests += [ "${chip_root}/src/controller/tests/data_model" ]
137134

138135
# Skip controller test for Open IoT SDK

src/controller/tests/BUILD.gn

+21-11
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,27 @@ import("${chip_root}/build/chip/chip_test_suite.gni")
2121
chip_test_suite("tests") {
2222
output_name = "libControllerTests"
2323

24-
test_sources = [ "TestCommissionableNodeController.cpp" ]
25-
26-
if (chip_device_platform != "mbed" && chip_device_platform != "efr32" &&
27-
chip_device_platform != "esp32") {
28-
test_sources += [ "TestServerCommandDispatch.cpp" ]
29-
test_sources += [ "TestEventChunking.cpp" ]
30-
test_sources += [ "TestEventCaching.cpp" ]
31-
test_sources += [ "TestReadChunking.cpp" ]
32-
test_sources += [ "TestWriteChunking.cpp" ]
33-
test_sources += [ "TestEventNumberCaching.cpp" ]
34-
test_sources += [ "TestCommissioningWindowOpener.cpp" ]
24+
test_sources = []
25+
26+
# Not supported on efr32.
27+
if (chip_device_platform != "efr32") {
28+
test_sources += [ "TestCommissionableNodeController.cpp" ]
29+
}
30+
31+
if (chip_device_platform != "mbed" && chip_device_platform != "esp32") {
32+
test_sources += [
33+
"TestEventCaching.cpp",
34+
"TestEventChunking.cpp",
35+
"TestEventNumberCaching.cpp",
36+
"TestReadChunking.cpp",
37+
"TestServerCommandDispatch.cpp",
38+
"TestWriteChunking.cpp",
39+
]
40+
41+
# Not supported on efr32.
42+
if (chip_device_platform != "efr32") {
43+
test_sources += [ "TestCommissioningWindowOpener.cpp" ]
44+
}
3545
}
3646

3747
cflags = [ "-Wconversion" ]

src/controller/tests/TestReadChunking.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ TEST_F(TestReadChunking, TestListChunking)
576576
{
577577
TestReadCallback readCallback;
578578

579-
ChipLogDetail(DataManagement, "Running iteration %d\n", packetSize);
579+
ChipLogDetail(DataManagement, "Running iteration %d\n", static_cast<int>(packetSize));
580580

581581
gIterationCount = packetSize;
582582

src/controller/tests/TestWriteChunking.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ TEST_F(TestWriteChunking, TestListChunking)
231231
CHIP_ERROR err = CHIP_NO_ERROR;
232232
TestWriteCallback writeCallback;
233233

234-
ChipLogDetail(DataManagement, "Running iteration %d\n", i);
234+
ChipLogDetail(DataManagement, "Running iteration %d\n", static_cast<int>(i));
235235

236236
gIterationCount = i;
237237

src/controller/tests/data_model/BUILD.gn

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ chip_test_suite("data_model") {
2929
]
3030

3131
test_sources = []
32-
if (chip_device_platform != "mbed" && chip_device_platform != "efr32" &&
33-
chip_device_platform != "esp32" && chip_device_platform != "fake") {
32+
if (chip_device_platform != "mbed" && chip_device_platform != "esp32" &&
33+
chip_device_platform != "fake") {
3434
test_sources += [
3535
"TestCommands.cpp",
36-
"TestRead.cpp",
3736
"TestWrite.cpp",
3837
]
38+
if (chip_device_platform != "efr32") {
39+
test_sources += [ "TestRead.cpp" ]
40+
}
3941
}
4042

4143
public_deps = [

src/lib/core/tests/BUILD.gn

+1-6
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,9 @@ chip_test_suite("tests") {
3131
"TestOptional.cpp",
3232
"TestReferenceCounted.cpp",
3333
"TestTLV.cpp",
34+
"TestTLVVectorWriter.cpp",
3435
]
3536

36-
# requires large amount of heap for multiple unfragmented 10k buffers
37-
# skip for efr32 to allow flash space for other tests
38-
if (chip_device_platform != "efr32") {
39-
test_sources += [ "TestTLVVectorWriter.cpp" ]
40-
}
41-
4237
cflags = [ "-Wconversion" ]
4338

4439
public_deps = [

src/transport/tests/BUILD.gn

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ chip_test_suite("tests") {
4444
"TestSessionManagerDispatch.cpp",
4545
]
4646

47-
if (chip_device_platform != "mbed" && chip_device_platform != "efr32" &&
48-
chip_device_platform != "esp32" && chip_device_platform != "nrfconnect" &&
49-
chip_device_platform != "nxp") {
47+
if (chip_device_platform != "mbed" && chip_device_platform != "esp32" &&
48+
chip_device_platform != "nrfconnect" && chip_device_platform != "nxp") {
5049
test_sources += [ "TestSecureSessionTable.cpp" ]
5150
}
5251

0 commit comments

Comments
 (0)