Skip to content

Commit

Permalink
Merge branch 'master' into feature/basic-app-install-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov authored May 22, 2024
2 parents 6a6dc09 + b5d13a7 commit f1e0f75
Show file tree
Hide file tree
Showing 17 changed files with 1,065 additions and 1,395 deletions.
1 change: 1 addition & 0 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ script_executable = "python3"

default_args = {
pw_unit_test_AUTOMATIC_RUNNER = "$dir_pigweed/targets/host/run_test"
pw_unit_test_CONFIG = "//config/pw_unit_test:define_overrides"

pw_build_PIP_CONSTRAINTS = [ "//scripts/setup/constraints.txt" ]
pw_build_PIP_REQUIREMENTS = [ "//scripts/setup/requirements.build.txt" ]
Expand Down
32 changes: 32 additions & 0 deletions config/pw_unit_test/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

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

import("${chip_root}/build/chip/tests.gni")

import("$dir_pw_build/target_types.gni")
pw_source_set("define_overrides") {
public_configs = [ ":define_options" ]
}

config("define_options") {
if (chip_fake_platform && chip_link_tests) {
defines = [ "PW_UNIT_TEST_CONFIG_MEMORY_POOL_SIZE=65536" ]
} else {
defines = [ "PW_UNIT_TEST_CONFIG_MEMORY_POOL_SIZE=16384" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3752,7 +3752,7 @@ cluster ActivatedCarbonFilterMonitoring = 114 {
}

/** This cluster is used to configure a boolean sensor. */
provisional cluster BooleanStateConfiguration = 128 {
cluster BooleanStateConfiguration = 128 {
revision 1;

bitmap AlarmModeBitmap : bitmap8 {
Expand Down Expand Up @@ -3810,7 +3810,7 @@ provisional cluster BooleanStateConfiguration = 128 {
}

/** This cluster is used to configure a valve. */
provisional cluster ValveConfigurationAndControl = 129 {
cluster ValveConfigurationAndControl = 129 {
revision 1;

enum StatusCodeEnum : enum8 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ limitations under the License.
<field name="GeneralFault" mask="0x1"/>
</bitmap>

<cluster apiMaturity="provisional">
<cluster>
<domain>General</domain>
<name>Boolean State Configuration</name>
<code>0x0080</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ limitations under the License.
<item name="FailureDueToFault" value="0x02"/>
</enum>

<cluster apiMaturity="provisional">
<cluster>
<domain>HVAC</domain>
<name>Valve Configuration and Control</name>
<code>0x0081</code>
Expand Down
4 changes: 2 additions & 2 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -3988,7 +3988,7 @@ cluster ActivatedCarbonFilterMonitoring = 114 {
}

/** This cluster is used to configure a boolean sensor. */
provisional cluster BooleanStateConfiguration = 128 {
cluster BooleanStateConfiguration = 128 {
revision 1;

bitmap AlarmModeBitmap : bitmap8 {
Expand Down Expand Up @@ -4046,7 +4046,7 @@ provisional cluster BooleanStateConfiguration = 128 {
}

/** This cluster is used to configure a valve. */
provisional cluster ValveConfigurationAndControl = 129 {
cluster ValveConfigurationAndControl = 129 {
revision 1;

enum StatusCodeEnum : enum8 {
Expand Down
11 changes: 1 addition & 10 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/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
import("${chip_root}/src/app/icd/icd.gni")
Expand All @@ -38,15 +37,9 @@ static_library("helpers") {
"${chip_root}/src/transport",
"${chip_root}/src/transport/tests:helpers",
]

# MessagingContext exposes nl-test compatible setup/teardown functions, specifically
# they return nltest specific SUCCESS/FAILURE constants hence this dependency.
#
# Once all tests are moved to pw_unittest/gtest, this dependency should be removed
public_deps = [ "${nlunit_test_root}:nlunit-test" ]
}

chip_test_suite_using_nltest("tests") {
chip_test_suite("tests") {
output_name = "libMessagingLayerTests"

test_sources = [
Expand All @@ -73,12 +66,10 @@ chip_test_suite_using_nltest("tests") {
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
"${chip_root}/src/lib/support:test_utils",
"${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/messaging",
"${chip_root}/src/protocols",
"${chip_root}/src/transport",
"${chip_root}/src/transport/raw/tests:helpers",
"${nlunit_test_root}:nlunit-test",
]

if (chip_enable_icd_server) {
Expand Down
4 changes: 2 additions & 2 deletions src/messaging/tests/MessagingContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#include <transport/tests/LoopbackTransportManager.h>
#include <transport/tests/UDPTransportManager.h>

#include <nlunit-test.h>

#include <vector>

namespace chip {
Expand Down Expand Up @@ -98,6 +96,8 @@ class MessagingContext : public PlatformMemoryUser
mInitialized(false), mAliceAddress(Transport::PeerAddress::UDP(GetAddress(), CHIP_PORT + 1)),
mBobAddress(Transport::PeerAddress::UDP(GetAddress(), CHIP_PORT))
{}
// TODO Replace VerifyOrDie with Pigweed assert after transition app/tests to Pigweed.
// TODO Currently src/app/icd/server/tests is using MessagingConetext as dependency.
~MessagingContext() { VerifyOrDie(mInitialized == false); }

// Whether Alice and Bob are initialized, must be called before Init
Expand Down
Loading

0 comments on commit f1e0f75

Please sign in to comment.