Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the src/controller tests on all platforms except nrfconnect. #9638

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ if (chip_build_tests) {
deps += [ "${chip_root}/src/ble/tests" ]
}

if (!is_clang && chip_device_platform != "darwin" &&
chip_device_platform != "nrfconnect" &&
chip_device_platform != "efr32") {
# On nrfconnect, the controller tests run into
# https://github.com/project-chip/connectedhomeip/issues/9630
if (chip_device_platform != "nrfconnect") {
deps += [ "${chip_root}/src/controller/tests" ]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ bool emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16
{{#if (chip_server_has_list_attributes)}}
{{#chip_server_cluster_attributes}}
{{#if isList}}
{{! TODO: This stack usage bit is not OK. See https://github.com/project-chip/connectedhomeip/issues/8558 }}
#if !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstack-usage="
#endif // __clang__
void {{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}ListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback)
{
// TODO: Add actual support for array and lists.
Expand Down Expand Up @@ -387,6 +392,10 @@ void {{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}ListAttribu
Callback::Callback<{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}ListAttributeCallback> * cb = Callback::Callback<{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}ListAttributeCallback>::FromCancelable(onSuccessCallback);
cb->mCall(cb->mContext, count, data);
}
{{! TODO: This stack usage bit is not OK. See https://github.com/project-chip/connectedhomeip/issues/8558 }}
#if !defined(__clang__)
#pragma GCC diagnostic pop
#endif // __clang__

{{/if}}
{{/chip_server_cluster_attributes}}
Expand Down
8 changes: 2 additions & 6 deletions src/controller/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ chip_test_suite("tests") {

test_sources = [ "TestCommissionableNodeController.cpp" ]

if (chip_device_platform == "linux" || chip_device_platform == "Darwin") {
test_sources += [ "TestDevice.cpp" ]
}
test_sources += [ "TestDevice.cpp" ]

cflags = [ "-Wconversion" ]

Expand All @@ -34,7 +32,5 @@ chip_test_suite("tests") {
"${nlunit_test_root}:nlunit-test",
]

if (chip_device_platform == "linux" || chip_device_platform == "Darwin") {
public_deps += [ "${chip_root}/src/controller/data_model" ]
}
public_deps += [ "${chip_root}/src/controller/data_model" ]
}
13 changes: 10 additions & 3 deletions src/controller/tests/TestDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
* limitations under the License.
*/

#if CONFIG_NETWORK_LAYER_BLE
#include <ble/BleLayer.h>
#endif // CONFIG_NETWORK_LAYER_BLE
#include <controller/CHIPDevice.h>
#include <inet/IPAddress.h>
#include <inet/InetLayer.h>
Expand Down Expand Up @@ -47,8 +49,12 @@ void TestDevice_EstablishSessionDirectly(nlTestSuite * inSuite, void * inContext
ExchangeManager exchangeMgr;
Inet::InetLayer inetLayer;
System::LayerImpl systemLayer;
#if CONFIG_NETWORK_LAYER_BLE
Ble::BleLayer blelayer;
FabricTable fabrics;
#endif // CONFIG_NETWORK_LAYER_BLE
// Heap-allocate the fairly large FabricTable so we don't end up with a huge
// stack.
FabricTable * fabrics = Platform::New<FabricTable>();
secure_channel::MessageCounterManager messageCounterManager;
SessionIDAllocator idAllocator;

Expand All @@ -65,7 +71,7 @@ void TestDevice_EstablishSessionDirectly(nlTestSuite * inSuite, void * inContext
BleListenParameters(&blelayer)
#endif
);
sessionMgr.Init(&systemLayer, &transportMgr, &fabrics, &messageCounterManager);
sessionMgr.Init(&systemLayer, &transportMgr, fabrics, &messageCounterManager);
exchangeMgr.Init(&sessionMgr);
messageCounterManager.Init(&exchangeMgr);

Expand All @@ -76,7 +82,7 @@ void TestDevice_EstablishSessionDirectly(nlTestSuite * inSuite, void * inContext
.inetLayer = &inetLayer,
.storageDelegate = nullptr,
.idAllocator = &idAllocator,
.fabricsTable = &fabrics,
.fabricsTable = fabrics,
};
Device device;
NodeId mockNodeId = 1;
Expand All @@ -93,6 +99,7 @@ void TestDevice_EstablishSessionDirectly(nlTestSuite * inSuite, void * inContext
messageCounterManager.Shutdown();
exchangeMgr.Shutdown();
sessionMgr.Shutdown();
Platform::Delete(fabrics);
transportMgr.Close();
inetLayer.Shutdown();
systemLayer.Shutdown();
Expand Down
2 changes: 1 addition & 1 deletion src/system/SystemLayerImplSelect.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class LayerImplSelect : public LayerSocketsLoop
#endif // CHIP_SYSTEM_CONFIG_POSIX_LOCKING

#if CHIP_SYSTEM_CONFIG_USE_DISPATCH
dispatch_queue_t mDispatchQueue;
dispatch_queue_t mDispatchQueue = nullptr;
#endif
};

Expand Down
Loading