Skip to content

Commit b96163d

Browse files
committed
Move the existing OTA requestor test to a subfolder of that cluster.
1 parent 2c0b7fc commit b96163d

File tree

7 files changed

+61
-22
lines changed

7 files changed

+61
-22
lines changed

src/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ if (chip_build_tests) {
6161
"${chip_root}/src/app/clusters/group-key-mgmt-server/tests",
6262
"${chip_root}/src/app/clusters/network-commissioning/tests",
6363
"${chip_root}/src/app/clusters/ota-provider/tests",
64+
"${chip_root}/src/app/clusters/ota-requestor/tests",
6465
"${chip_root}/src/app/clusters/software-diagnostics-server/tests",
6566
"${chip_root}/src/app/clusters/ethernet-network-diagnostics-server/tests",
6667
"${chip_root}/src/app/clusters/operational-credentials-server/tests",

src/app/clusters/ota-requestor/BUILD.gn

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@ group("ota-requestor") {
1919
# TODO: DefaultOTARequestor depends on controller, however the cluster server itself does not.
2020
# Maybe DefaultOTARequestor and related code should have its own source set.
2121
public_deps = [
22+
":storage",
2223
"${chip_root}/src/app/clusters/basic-information",
2324
"${chip_root}/src/controller:interactions",
2425
]
2526
}
27+
28+
source_set("storage") {
29+
sources = [
30+
"DefaultOTARequestorStorage.cpp",
31+
"DefaultOTARequestorStorage.h",
32+
"OTARequestorStorage.h",
33+
]
34+
35+
public_deps = [
36+
"${chip_root}/src/app/common:cluster-objects",
37+
]
38+
}

src/app/clusters/ota-requestor/app_config_dependent_sources.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,21 @@ TARGET_SOURCES(
2222
"${CLUSTER_DIR}/DefaultOTARequestor.h"
2323
"${CLUSTER_DIR}/DefaultOTARequestorDriver.cpp"
2424
"${CLUSTER_DIR}/DefaultOTARequestorDriver.h"
25-
"${CLUSTER_DIR}/DefaultOTARequestorStorage.cpp"
26-
"${CLUSTER_DIR}/DefaultOTARequestorStorage.h"
2725
"${CLUSTER_DIR}/DefaultOTARequestorUserConsent.h"
2826
"${CLUSTER_DIR}/ExtendedOTARequestorDriver.cpp"
2927
"${CLUSTER_DIR}/ExtendedOTARequestorDriver.h"
3028
"${CLUSTER_DIR}/OTARequestorDriver.h"
31-
"${CLUSTER_DIR}/OTARequestorStorage.h"
3229
"${CLUSTER_DIR}/OTATestEventTriggerHandler.cpp"
3330
"${CLUSTER_DIR}/OTATestEventTriggerHandler.h"
3431
"${CLUSTER_DIR}/ota-requestor-server.cpp"
3532
"${CLUSTER_DIR}/ota-requestor-server.h"
36-
)
33+
)
34+
35+
# These are things that BUILD.gn dependencies would pull
36+
TARGET_SOURCES(
37+
${APP_TARGET}
38+
PRIVATE
39+
"${CLUSTER_DIR}/DefaultOTARequestorStorage.cpp"
40+
"${CLUSTER_DIR}/DefaultOTARequestorStorage.h"
41+
"${CLUSTER_DIR}/OTARequestorStorage.h"
42+
)

src/app/clusters/ota-requestor/app_config_dependent_sources.gni

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ app_config_dependent_sources = [
1818
"DefaultOTARequestor.h",
1919
"DefaultOTARequestorDriver.cpp",
2020
"DefaultOTARequestorDriver.h",
21-
"DefaultOTARequestorStorage.cpp",
22-
"DefaultOTARequestorStorage.h",
2321
"DefaultOTARequestorUserConsent.h",
2422
"ExtendedOTARequestorDriver.cpp",
2523
"ExtendedOTARequestorDriver.h",
2624
"OTARequestorDriver.h",
27-
"OTARequestorStorage.h",
2825
"OTATestEventTriggerHandler.cpp",
2926
"OTATestEventTriggerHandler.h",
3027
"ota-requestor-server.cpp",
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (c) 2025 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
import("//build_overrides/build.gni")
15+
import("//build_overrides/chip.gni")
16+
import("//build_overrides/pigweed.gni")
17+
18+
import("${chip_root}/build/chip/chip_test_suite.gni")
19+
20+
chip_test_suite("tests")
21+
{
22+
output_name = "TestDefaultOTARequestor"
23+
24+
test_sources = [ "TestDefaultOTARequestorStorage.cpp" ]
25+
26+
sources = []
27+
28+
cflags = [ "-Wconversion" ]
29+
30+
public_deps = [
31+
"${chip_root}/src/app/clusters/ota-requestor:storage",
32+
"${chip_root}/src/app/common:cluster-objects",
33+
"${chip_root}/src/lib/core",
34+
"${chip_root}/src/lib/core:string-builder-adapters",
35+
"${chip_root}/src/lib/support:testing",
36+
]
37+
}

src/app/tests/BUILD.gn

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ static_library("helpers") {
4646
]
4747
}
4848

49-
source_set("ota-requestor-test-srcs") {
50-
sources = [
51-
"${chip_root}/src/app/clusters/ota-requestor/DefaultOTARequestorStorage.cpp",
52-
"${chip_root}/src/app/clusters/ota-requestor/DefaultOTARequestorStorage.h",
53-
"${chip_root}/src/app/clusters/ota-requestor/OTARequestorStorage.h",
54-
]
55-
56-
public_deps = [
57-
"${chip_root}/src/app/common:cluster-objects",
58-
"${chip_root}/src/lib/core",
59-
]
60-
}
61-
6249
source_set("thread-network-directory-test-srcs") {
6350
sources = [
6451
"${chip_root}/src/app/clusters/thread-network-directory-server/DefaultThreadNetworkDirectoryStorage.cpp",
@@ -256,7 +243,6 @@ chip_test_suite("tests") {
256243
"TestCommandPathParams.cpp",
257244
"TestConcreteAttributePath.cpp",
258245
"TestDataModelSerialization.cpp",
259-
"TestDefaultOTARequestorStorage.cpp",
260246
"TestDefaultSafeAttributePersistenceProvider.cpp",
261247
"TestDefaultTermsAndConditionsProvider.cpp",
262248
"TestDefaultThreadNetworkDirectoryStorage.cpp",
@@ -291,7 +277,6 @@ chip_test_suite("tests") {
291277
":closure-dimension-test-srcs",
292278
":ecosystem-information-test-srcs",
293279
":operational-state-test-srcs",
294-
":ota-requestor-test-srcs",
295280
":thread-network-directory-test-srcs",
296281
":time-sync-data-provider-test-srcs",
297282
"${chip_root}/src/app",

0 commit comments

Comments
 (0)