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

Remove verbose text during building #23687

Closed
wants to merge 16 commits into from
Closed
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
1 change: 0 additions & 1 deletion examples/lighting-app/bouffalolab/bl602/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ bl602_executable("lighting_app") {
sources += [ "${examples_plat_common_dir}/plat/OTAConfig.cpp" ]
}

print(defines)
ldscript = "${examples_plat_dir}/ldscripts/flash_rom.ld"

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
Expand Down
1 change: 0 additions & 1 deletion src/app/chip_data_model.gni
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ template("chip_data_model") {
# Assume that IDL name is the same as the zap file name, but instead of
# '.zap' use '.matter' as extension. This is currently the case in the
# sample apps, but may change in the future
print("AUTO-DETECTING input matter IDL file.")
_idl = string_replace(invoker.zap_file, ".zap", ".matter")
}

Expand Down
62 changes: 52 additions & 10 deletions src/controller/tests/data_model/TestRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ void TestReadInteraction::TestSubscribeAttributeTimeout(nlTestSuite * apSuite, v
void TestReadInteraction::TestReadHandler_MultipleSubscriptions(nlTestSuite * apSuite, void * apContext)
{
TestContext & ctx = *static_cast<TestContext *>(apContext);
auto sessionHandle = ctx.GetSessionBobToAlice();
SessionHandle sessionHandle = ctx.GetSessionBobToAlice();
uint32_t numSuccessCalls = 0;
uint32_t numSubscriptionEstablishedCalls = 0;

Expand Down Expand Up @@ -1769,10 +1769,31 @@ void TestReadInteraction::TestReadHandler_MultipleSubscriptions(nlTestSuite * ap
//
for (size_t i = 0; i < (app::InteractionModelEngine::kReadHandlerPoolSize + 1); i++)
{
NL_TEST_ASSERT(apSuite,
Controller::SubscribeAttribute<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo>(
&ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb, 0, 20,
onSubscriptionEstablishedCb, nullptr, false, true) == CHIP_NO_ERROR);
Controller::detail::ReportAttributeParams<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::DecodableType>
params(sessionHandle);

params.mOnReportCb = onSuccessCb;
params.mOnErrorCb = onFailureCb;
params.mOnSubscriptionEstablishedCb = onSubscriptionEstablishedCb;
params.mOnResubscriptionAttemptCb = nullptr;
params.mOnDoneCb = nullptr;
params.mMinIntervalFloorSeconds = 0;
params.mMaxIntervalCeilingSeconds = 20;
params.mReportType = app::ReadClient::InteractionType::Subscribe;
params.mKeepSubscriptions = true;
params.mIsFabricFiltered = false;

// Increase timeout, so that slow versions (specifically gcc_debug) does not time out.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed? Why are things fine without this change before but not fine after?

params.mTimeout = chip::System::Clock::Seconds16(15);

CHIP_ERROR err =
Controller::detail::ReportAttribute<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::DecodableType>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not be using "detail" APIs here. There are public APIs for all this; please use them.

&ctx.GetExchangeManager(), kTestEndpointId,
Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::GetClusterId(),
Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::GetAttributeId(), std::move(params),
NullOptional);

NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR);
}

// There are too many messages and the test (gcc_debug, which includes many sanity checks) will be quite slow. Note: report
Expand Down Expand Up @@ -2678,15 +2699,36 @@ void TestReadInteraction::TestReadHandler_MultipleSubscriptionsWithDataVersionFi
chip::Optional<chip::DataVersion> dataVersion(1);
for (size_t i = 0; i < (app::InteractionModelEngine::kReadHandlerPoolSize + 1); i++)
{
NL_TEST_ASSERT(apSuite,
Controller::SubscribeAttribute<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo>(
&ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb, 0, 10,
onSubscriptionEstablishedCb, nullptr, false, true, dataVersion) == CHIP_NO_ERROR);
Controller::detail::ReportAttributeParams<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::DecodableType>
params(sessionHandle);

params.mOnReportCb = onSuccessCb;
params.mOnErrorCb = onFailureCb;
params.mOnSubscriptionEstablishedCb = onSubscriptionEstablishedCb;
params.mOnResubscriptionAttemptCb = nullptr;
params.mOnDoneCb = nullptr;
params.mMinIntervalFloorSeconds = 0;
params.mMaxIntervalCeilingSeconds = 10;
params.mReportType = app::ReadClient::InteractionType::Subscribe;
params.mKeepSubscriptions = true;
params.mIsFabricFiltered = false;

// Increase timeout, so that slow versions (specifically gcc_debug) does not time out.
params.mTimeout = chip::System::Clock::Seconds16(15);

CHIP_ERROR err =
Controller::detail::ReportAttribute<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::DecodableType>(
&ctx.GetExchangeManager(), kTestEndpointId,
Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::GetClusterId(),
Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::GetAttributeId(), std::move(params),
dataVersion);

NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR);
}

// There are too many messages and the test (gcc_debug, which includes many sanity checks) will be quite slow. Note: report
// engine is using ScheduleWork which cannot be handled by DrainAndServiceIO correctly.
ctx.GetIOContext().DriveIOUntil(System::Clock::Seconds16(30), [&]() {
ctx.GetIOContext().DriveIOUntil(System::Clock::Seconds16(60), [&]() {
return numSubscriptionEstablishedCalls == (app::InteractionModelEngine::kReadHandlerPoolSize + 1) &&
numSuccessCalls == (app::InteractionModelEngine::kReadHandlerPoolSize + 1);
});
Expand Down
9 changes: 8 additions & 1 deletion src/credentials/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import("//build_overrides/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
import("${chip_root}/build/chip/fuzz_test.gni")
import("${chip_root}/src/lib/core/core.gni")

static_library("cert_test_vectors") {
output_name = "libCertTestVectors"
Expand Down Expand Up @@ -46,14 +47,20 @@ chip_test_suite("tests") {
test_sources = [
"TestCertificationDeclaration.cpp",
"TestChipCert.cpp",
"TestCommissionerDUTVectors.cpp",
"TestDeviceAttestationConstruction.cpp",
"TestDeviceAttestationCredentials.cpp",
"TestFabricTable.cpp",
"TestGroupDataProvider.cpp",
"TestPersistentStorageOpCertStore.cpp",
]

if (!chip_config_memory_debug_dmalloc) {
# We have many DUT vectors and dmalloc requires a lot of time to validate
# heap operations for large crypto processing. Skip this test for
# dmalloc.
test_sources += [ "TestCommissionerDUTVectors.cpp" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed for a logging change?

}

cflags = [ "-Wconversion" ]

public_deps = [
Expand Down
22 changes: 20 additions & 2 deletions src/transport/tests/TestSessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,19 @@ void SessionAllocationTest(nlTestSuite * inSuite, void * inContext)
handle.Value()->AsSecureSession()->MarkForEviction();
}

#if CHIP_CONFIG_MEMORY_DEBUG_DMALLOC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed for a logging change?

// DMalloc can be very slow to allocate/free crypto keys. Lower the amount
// of iterations.
constexpr uint32_t kAllocateTestLowerBound = UINT16_MAX - 100;
#else
constexpr uint32_t kAllocateTestLowerBound = 0;
#endif
constexpr uint32_t kAllocateTestHighBound = UINT16_MAX + 10;

// Verify that we increment session ID by 1 for each allocation (except for
// the wraparound case where we skip session ID 0), even when allocated
// sessions are immediately freed.
for (uint32_t i = 0; i < UINT16_MAX + 10; ++i)
for (uint32_t i = kAllocateTestLowerBound; i < kAllocateTestHighBound; ++i)
{
auto handle = sessionManager.AllocateSession(
Transport::SecureSession::Type::kPASE,
Expand Down Expand Up @@ -807,9 +816,18 @@ void SessionAllocationTest(nlTestSuite * inSuite, void * inContext)
NL_TEST_ASSERT(inSuite, sessionIds[h] != sessionIds[(h + 1) % numHandles]);
}

#if CHIP_CONFIG_MEMORY_DEBUG_DMALLOC
// DMalloc can be very slow to allocate/free crypto keys. Lower the amount
// of iterations.
constexpr uint32_t kCollisionTestLowerBound = UINT16_MAX - 100;
#else
constexpr uint32_t kCollisionTestLowerBound = 0;
#endif
constexpr uint32_t kCollisionTestUpperBound = UINT16_MAX;

// Allocate through the entire session ID space and verify that none of
// these collide either.
for (int j = 0; j < UINT16_MAX; ++j)
for (uint32_t j = kCollisionTestLowerBound; j < kCollisionTestUpperBound; ++j)
{
auto handle = sessionManager.AllocateSession(
Transport::SecureSession::Type::kPASE,
Expand Down
8 changes: 4 additions & 4 deletions third_party/nxp/k32w0_sdk/k32w0_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ template("k32w0_sdk") {
chip_with_high_power = 0
}

print("device:", device)
print("board:", board)
print("ntag:", chip_with_ntag)
print("high power:", chip_with_high_power)
# print("device:", device)
# print("board:", board)
# print("ntag:", chip_with_ntag)
# print("high power:", chip_with_high_power)
device_lowercase = string_replace(board, "dk6", "")

sdk_target_name = target_name
Expand Down