Skip to content

Commit

Permalink
Cleanup a few more files that were not recognized by gn (#31999)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
andy31415 and andreilitvin authored Feb 8, 2024
1 parent 816de98 commit bf46b08
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 201 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ jobs:
--known-failure app/reporting/tests/MockReportScheduler.h \
--known-failure app/server/AppDelegate.h \
--known-failure app/TestEventTriggerDelegate.h \
--known-failure app/tests/integration/common.h \
--known-failure app/tests/integration/MockEvents.h \
--known-failure app/tests/suites/credentials/TestHarnessDACProvider.h \
--known-failure app/tests/TestOperationalDeviceProxy.cpp \
--known-failure app/util/af-enums.h \
--known-failure app/util/af.h \
--known-failure app/util/af-types.h \
Expand Down Expand Up @@ -156,15 +152,11 @@ jobs:
--known-failure app/util/util.h \
--known-failure app/WriteClient.h \
--known-failure app/WriteHandler.h \
--known-failure inet/tests/TestInetLayerCommon.hpp \
--known-failure lib/core/CHIPVendorIdentifiers.hpp \
--known-failure lib/support/CHIPArgParser.hpp \
--known-failure messaging/tests/echo/common.h \
--known-failure platform/DeviceSafeQueue.cpp \
--known-failure platform/DeviceSafeQueue.h \
--known-failure platform/GLibTypeDeleter.h \
--known-failure platform/SingletonConfigurationManager.cpp \
--known-failure transport/retransmit/tests/TestCacheDriver.cpp \
"
- name: Check for matter lint errors
Expand Down
5 changes: 4 additions & 1 deletion src/app/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ chip_test_suite_using_nltest("tests") {
if (chip_config_network_layer_ble &&
(chip_device_platform == "linux" || chip_device_platform == "darwin")) {
test_sources += [ "TestCommissionManager.cpp" ]
public_deps += [ "${chip_root}/src/app/server" ]
public_deps += [
"${chip_root}/src/app/server",
"${chip_root}/src/messaging/tests/echo:common",
]
}

if (chip_persist_subscriptions) {
Expand Down
118 changes: 0 additions & 118 deletions src/app/tests/TestOperationalDeviceProxy.cpp

This file was deleted.

22 changes: 20 additions & 2 deletions src/app/tests/integration/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,31 @@ import("${chip_root}/build/chip/tools.gni")

assert(chip_build_tools)

source_set("common") {
sources = [
"common.cpp",
"common.h",
]

deps = [
"${chip_root}/src/credentials",
"${chip_root}/src/crypto",
"${chip_root}/src/lib/support:testing",
"${chip_root}/src/messaging",
"${chip_root}/src/protocols",
"${chip_root}/src/transport",
]
}

executable("chip-im-initiator") {
sources = [
"${chip_root}/src/app/reporting/tests/MockReportScheduler.cpp",
"RequiredPrivilegeStubs.cpp",
"chip_im_initiator.cpp",
"common.cpp",
]

deps = [
":common",
"${chip_root}/src/app",
"${chip_root}/src/app/util/mock:mock_ember",
"${chip_root}/src/lib/core",
Expand All @@ -44,16 +60,18 @@ executable("chip-im-responder") {
sources = [
"${chip_root}/src/app/reporting/tests/MockReportScheduler.cpp",
"MockEvents.cpp",
"MockEvents.h",
"RequiredPrivilegeStubs.cpp",
"chip_im_responder.cpp",
"common.cpp",
]

deps = [
":common",
"${chip_root}/src/app",
"${chip_root}/src/app/util/mock:mock_ember",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
"${chip_root}/src/messaging",
"${chip_root}/src/platform",
"${chip_root}/src/protocols",
"${chip_root}/src/system",
Expand Down
5 changes: 4 additions & 1 deletion src/app/tests/suites/credentials/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ config("default_config") {
}

source_set("dac_provider") {
sources = [ "TestHarnessDACProvider.cpp" ]
sources = [
"TestHarnessDACProvider.cpp",
"TestHarnessDACProvider.h",
]

deps = [
"${chip_root}/src/credentials",
Expand Down
1 change: 1 addition & 0 deletions src/inet/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ static_library("helpers") {
"TestInetCommonOptions.h",
"TestInetCommonPosix.cpp",
"TestInetLayerCommon.cpp",
"TestInetLayerCommon.hpp",
"TestSetupSignalling.h",
"TestSetupSignallingPosix.cpp",
]
Expand Down
1 change: 1 addition & 0 deletions src/lib/support/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ static_library("support") {
"BytesToHex.cpp",
"BytesToHex.h",
"CHIPArgParser.cpp",
"CHIPArgParser.hpp",
"CHIPCounter.h",
"CHIPMemString.h",
"CommonIterator.h",
Expand Down
28 changes: 20 additions & 8 deletions src/messaging/tests/echo/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,29 @@ import("//build_overrides/chip.gni")

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

assert(chip_build_tools)

executable("chip-echo-requester") {
source_set("common") {
sources = [
"common.cpp",
"echo_requester.cpp",
"common.h",
]

public_deps = [
"${chip_root}/src/crypto",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
"${chip_root}/src/lib/support:testing",
"${chip_root}/src/messaging",
"${chip_root}/src/platform",
"${chip_root}/src/protocols",
"${chip_root}/src/transport",
]
}

executable("chip-echo-requester") {
sources = [ "echo_requester.cpp" ]

public_deps = [
":common",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
"${chip_root}/src/platform",
Expand All @@ -37,12 +51,10 @@ executable("chip-echo-requester") {
}

executable("chip-echo-responder") {
sources = [
"common.cpp",
"echo_responder.cpp",
]
sources = [ "echo_responder.cpp" ]

public_deps = [
":common",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
"${chip_root}/src/platform",
Expand Down
7 changes: 1 addition & 6 deletions src/transport/retransmit/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,11 @@ chip_test_suite_using_nltest("tests") {

cflags = [ "-Wconversion" ]

sources = [
"TestCache.cpp",
"TestRetransmit.h",
]
test_sources = [ "TestCache.cpp" ]

public_deps = [
"${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/transport/retransmit",
"${nlunit_test_root}:nlunit-test",
]

tests = [ "TestCache" ]
}
5 changes: 1 addition & 4 deletions src/transport/retransmit/tests/TestCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "TestRetransmit.h"

#include <lib/support/UnitTestRegistration.h>
#include <transport/retransmit/Cache.h>

Expand Down Expand Up @@ -271,7 +268,7 @@ static const nlTest sTests[] =
};
// clang-format on

int TestCache(void)
int TestCache()
{
nlTestSuite theSuite = { "Retransmit-Cache", &sTests[0], nullptr, nullptr };
gPayloadTracker.Init(&theSuite);
Expand Down
25 changes: 0 additions & 25 deletions src/transport/retransmit/tests/TestCacheDriver.cpp

This file was deleted.

28 changes: 0 additions & 28 deletions src/transport/retransmit/tests/TestRetransmit.h

This file was deleted.

0 comments on commit bf46b08

Please sign in to comment.