Skip to content

Commit bf46b08

Browse files
Cleanup a few more files that were not recognized by gn (project-chip#31999)
* Cleanup and fix some tests dependencies * Fix test compilation. Header was forcing C-linkage of the name * restyle * Fix code lint * Fix one more * Fix dependencies for more common integ files * Remove assert because this file is exercised in dependencies * Add Mock events handling * Remove TestOperationalDeviceProxy - this proxy does not seem to exist anymore and this test is never run * One more file update * Update linter * Restyle --------- Co-authored-by: Andrei Litvin <andreilitvin@google.com>
1 parent 816de98 commit bf46b08

File tree

12 files changed

+52
-201
lines changed

12 files changed

+52
-201
lines changed

.github/workflows/lint.yml

-8
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ jobs:
119119
--known-failure app/reporting/tests/MockReportScheduler.h \
120120
--known-failure app/server/AppDelegate.h \
121121
--known-failure app/TestEventTriggerDelegate.h \
122-
--known-failure app/tests/integration/common.h \
123-
--known-failure app/tests/integration/MockEvents.h \
124-
--known-failure app/tests/suites/credentials/TestHarnessDACProvider.h \
125-
--known-failure app/tests/TestOperationalDeviceProxy.cpp \
126122
--known-failure app/util/af-enums.h \
127123
--known-failure app/util/af.h \
128124
--known-failure app/util/af-types.h \
@@ -156,15 +152,11 @@ jobs:
156152
--known-failure app/util/util.h \
157153
--known-failure app/WriteClient.h \
158154
--known-failure app/WriteHandler.h \
159-
--known-failure inet/tests/TestInetLayerCommon.hpp \
160155
--known-failure lib/core/CHIPVendorIdentifiers.hpp \
161-
--known-failure lib/support/CHIPArgParser.hpp \
162-
--known-failure messaging/tests/echo/common.h \
163156
--known-failure platform/DeviceSafeQueue.cpp \
164157
--known-failure platform/DeviceSafeQueue.h \
165158
--known-failure platform/GLibTypeDeleter.h \
166159
--known-failure platform/SingletonConfigurationManager.cpp \
167-
--known-failure transport/retransmit/tests/TestCacheDriver.cpp \
168160
"
169161
170162
- name: Check for matter lint errors

src/app/tests/BUILD.gn

+4-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@ chip_test_suite_using_nltest("tests") {
235235
if (chip_config_network_layer_ble &&
236236
(chip_device_platform == "linux" || chip_device_platform == "darwin")) {
237237
test_sources += [ "TestCommissionManager.cpp" ]
238-
public_deps += [ "${chip_root}/src/app/server" ]
238+
public_deps += [
239+
"${chip_root}/src/app/server",
240+
"${chip_root}/src/messaging/tests/echo:common",
241+
]
239242
}
240243

241244
if (chip_persist_subscriptions) {

src/app/tests/TestOperationalDeviceProxy.cpp

-118
This file was deleted.

src/app/tests/integration/BUILD.gn

+20-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,31 @@ import("${chip_root}/build/chip/tools.gni")
1919

2020
assert(chip_build_tools)
2121

22+
source_set("common") {
23+
sources = [
24+
"common.cpp",
25+
"common.h",
26+
]
27+
28+
deps = [
29+
"${chip_root}/src/credentials",
30+
"${chip_root}/src/crypto",
31+
"${chip_root}/src/lib/support:testing",
32+
"${chip_root}/src/messaging",
33+
"${chip_root}/src/protocols",
34+
"${chip_root}/src/transport",
35+
]
36+
}
37+
2238
executable("chip-im-initiator") {
2339
sources = [
2440
"${chip_root}/src/app/reporting/tests/MockReportScheduler.cpp",
2541
"RequiredPrivilegeStubs.cpp",
2642
"chip_im_initiator.cpp",
27-
"common.cpp",
2843
]
2944

3045
deps = [
46+
":common",
3147
"${chip_root}/src/app",
3248
"${chip_root}/src/app/util/mock:mock_ember",
3349
"${chip_root}/src/lib/core",
@@ -44,16 +60,18 @@ executable("chip-im-responder") {
4460
sources = [
4561
"${chip_root}/src/app/reporting/tests/MockReportScheduler.cpp",
4662
"MockEvents.cpp",
63+
"MockEvents.h",
4764
"RequiredPrivilegeStubs.cpp",
4865
"chip_im_responder.cpp",
49-
"common.cpp",
5066
]
5167

5268
deps = [
69+
":common",
5370
"${chip_root}/src/app",
5471
"${chip_root}/src/app/util/mock:mock_ember",
5572
"${chip_root}/src/lib/core",
5673
"${chip_root}/src/lib/support",
74+
"${chip_root}/src/messaging",
5775
"${chip_root}/src/platform",
5876
"${chip_root}/src/protocols",
5977
"${chip_root}/src/system",

src/app/tests/suites/credentials/BUILD.gn

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ config("default_config") {
2121
}
2222

2323
source_set("dac_provider") {
24-
sources = [ "TestHarnessDACProvider.cpp" ]
24+
sources = [
25+
"TestHarnessDACProvider.cpp",
26+
"TestHarnessDACProvider.h",
27+
]
2528

2629
deps = [
2730
"${chip_root}/src/credentials",

src/inet/tests/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ static_library("helpers") {
3434
"TestInetCommonOptions.h",
3535
"TestInetCommonPosix.cpp",
3636
"TestInetLayerCommon.cpp",
37+
"TestInetLayerCommon.hpp",
3738
"TestSetupSignalling.h",
3839
"TestSetupSignallingPosix.cpp",
3940
]

src/lib/support/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ static_library("support") {
188188
"BytesToHex.cpp",
189189
"BytesToHex.h",
190190
"CHIPArgParser.cpp",
191+
"CHIPArgParser.hpp",
191192
"CHIPCounter.h",
192193
"CHIPMemString.h",
193194
"CommonIterator.h",

src/messaging/tests/echo/BUILD.gn

+20-8
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,29 @@ import("//build_overrides/chip.gni")
1717

1818
import("${chip_root}/build/chip/tools.gni")
1919

20-
assert(chip_build_tools)
21-
22-
executable("chip-echo-requester") {
20+
source_set("common") {
2321
sources = [
2422
"common.cpp",
25-
"echo_requester.cpp",
23+
"common.h",
2624
]
2725

2826
public_deps = [
27+
"${chip_root}/src/crypto",
28+
"${chip_root}/src/lib/core",
29+
"${chip_root}/src/lib/support",
30+
"${chip_root}/src/lib/support:testing",
31+
"${chip_root}/src/messaging",
32+
"${chip_root}/src/platform",
33+
"${chip_root}/src/protocols",
34+
"${chip_root}/src/transport",
35+
]
36+
}
37+
38+
executable("chip-echo-requester") {
39+
sources = [ "echo_requester.cpp" ]
40+
41+
public_deps = [
42+
":common",
2943
"${chip_root}/src/lib/core",
3044
"${chip_root}/src/lib/support",
3145
"${chip_root}/src/platform",
@@ -37,12 +51,10 @@ executable("chip-echo-requester") {
3751
}
3852

3953
executable("chip-echo-responder") {
40-
sources = [
41-
"common.cpp",
42-
"echo_responder.cpp",
43-
]
54+
sources = [ "echo_responder.cpp" ]
4455

4556
public_deps = [
57+
":common",
4658
"${chip_root}/src/lib/core",
4759
"${chip_root}/src/lib/support",
4860
"${chip_root}/src/platform",

src/transport/retransmit/tests/BUILD.gn

+1-6
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@ chip_test_suite_using_nltest("tests") {
2323

2424
cflags = [ "-Wconversion" ]
2525

26-
sources = [
27-
"TestCache.cpp",
28-
"TestRetransmit.h",
29-
]
26+
test_sources = [ "TestCache.cpp" ]
3027

3128
public_deps = [
3229
"${chip_root}/src/lib/support:testing_nlunit",
3330
"${chip_root}/src/transport/retransmit",
3431
"${nlunit_test_root}:nlunit-test",
3532
]
36-
37-
tests = [ "TestCache" ]
3833
}

src/transport/retransmit/tests/TestCache.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
18-
#include "TestRetransmit.h"
19-
2017
#include <lib/support/UnitTestRegistration.h>
2118
#include <transport/retransmit/Cache.h>
2219

@@ -271,7 +268,7 @@ static const nlTest sTests[] =
271268
};
272269
// clang-format on
273270

274-
int TestCache(void)
271+
int TestCache()
275272
{
276273
nlTestSuite theSuite = { "Retransmit-Cache", &sTests[0], nullptr, nullptr };
277274
gPayloadTracker.Init(&theSuite);

src/transport/retransmit/tests/TestCacheDriver.cpp

-25
This file was deleted.

src/transport/retransmit/tests/TestRetransmit.h

-28
This file was deleted.

0 commit comments

Comments
 (0)