Skip to content

Commit

Permalink
[darwin-framework-tool] Remove codegen tests (project-chip#31942)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored Feb 6, 2024
1 parent f4da03c commit 4c4d8bf
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 194,409 deletions.
112 changes: 43 additions & 69 deletions examples/darwin-framework-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ assert(chip_build_tools)
declare_args() {
chip_codesign = current_os == "ios"

# When config_enable_yaml_tests is false, the Matter SDK options are not available.
if (!config_enable_yaml_tests) {
chip_inet_config_enable_ipv4 = true
if (!defined(chip_config_network_layer_ble)) {
chip_config_network_layer_ble = true
}
if (!defined(is_clang)) {
is_clang = false
}
chip_inet_config_enable_ipv4 = true

if (!defined(chip_config_network_layer_ble)) {
chip_config_network_layer_ble = true
}
if (!defined(is_clang)) {
is_clang = false
}

enable_provisional_features = config_enable_yaml_tests
Expand Down Expand Up @@ -125,12 +123,17 @@ action("build-darwin-framework") {
output_name = "Matter.framework"
outputs = [
"${root_out_dir}/macos_framework_output/Build/Products/${output_sdk_type}/${output_name}",
"${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/gen/include",
"${root_build_dir}/darwin_framework_build.log",
"${root_out_dir}/macos_framework_output/ModuleCache.noindex/",
"${root_out_dir}/macos_framework_output/Logs",
"${root_out_dir}/macos_framework_output/Index",
"${root_out_dir}/macos_framework_output/Build",
]

if (sdk == "macosx") {
outputs += [ "${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/lib/libCHIP.a" ]
}
}

config("config") {
Expand All @@ -150,7 +153,7 @@ config("config") {
]

defines = [
"CONFIG_ENABLE_YAML_TESTS=${config_enable_yaml_tests}",
"CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>",
"CONFIG_USE_INTERACTIVE_MODE=${config_use_interactive_mode}",

# Disable availability annotations in Matter.framework headers because we
Expand All @@ -171,6 +174,8 @@ executable("darwin-framework-tool") {
"${chip_root}/examples/chip-tool/commands/common/Commands.cpp",
"${chip_root}/examples/chip-tool/commands/common/Commands.h",
"${chip_root}/examples/chip-tool/commands/common/HexConversion.h",
"${chip_root}/examples/common/websocket-server/WebSocketServer.cpp",
"${chip_root}/examples/common/websocket-server/WebSocketServer.h",
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp",
"commands/bdx/Commands.h",
"commands/bdx/DownloadLogCommand.mm",
Expand Down Expand Up @@ -214,17 +219,14 @@ executable("darwin-framework-tool") {

deps = [
":build-darwin-framework",
"${chip_root}/third_party/libwebsockets",
jsoncpp_root,
]

if (config_use_interactive_mode) {
sources += [ "commands/interactive/InteractiveCommands.mm" ]

deps += [
"${chip_root}/examples/common/websocket-server",
"${chip_root}/src/platform/logging:headers",
"${editline_root}:editline",
]
deps += [ "${editline_root}:editline" ]
}

ldflags = [
Expand All @@ -237,63 +239,35 @@ executable("darwin-framework-tool") {
"Security.framework",
]

# When config_enable_yaml_tests=true the Matter SDK is pulled in as a dependency because the code of the test suite
# uses some helpers from the Matter SDK. As a result, the SDK is built twice. Once because of this dependency and once
# when the Matter.framework is built.
# It may results in different versions of the Matter SDK between the output binary and the linked Matter.framework.
#
# When config_enable_yaml_tests=false the Matter SDK is built once when the Matter.framework is built and the resulting
# libCHIP.a library is linked statically to the output binary.
if (config_enable_yaml_tests) {
deps += [
"${chip_root}/src/app/tests/suites/commands/delay",

# IM is needed for MTRError
"${chip_root}/src/app/tests/suites/commands/interaction_model",

# Log is needed by tests UserPrompt and Log
"${chip_root}/src/app/tests/suites/commands/log",

# System is needed by tests FactoryReset etc..
"${chip_root}/src/app/tests/suites/commands/system",

# pics is needed by tests
"${chip_root}/src/app/tests/suites/pics",
"${chip_root}/src/protocols/interaction_model",
]

defines = []
} else {
include_dirs = [
"${chip_root}/config/standalone/",
"${chip_root}/src/",
"${chip_root}/src/include/",
"${chip_root}/src/protocols/",
"${chip_root}/src/protocols/interaction_model",
"${chip_root}/third_party/nlassert/repo/include/",
"${chip_root}/third_party/nlio/repo/include/",
"${chip_root}/zzz_generated/app-common/",
"${root_gen_dir}/include",
"${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/gen/include",
]
include_dirs = [
"${chip_root}/config/standalone/",
"${chip_root}/src/",
"${chip_root}/src/include/",
"${chip_root}/src/protocols/",
"${chip_root}/src/protocols/interaction_model",
"${chip_root}/third_party/nlassert/repo/include/",
"${chip_root}/third_party/nlio/repo/include/",
"${chip_root}/zzz_generated/app-common/",
"${root_gen_dir}/include",
"${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/gen/include",
]

defines = [
"CHIP_HAVE_CONFIG_H=1",
"CHIP_SYSTEM_CONFIG_USE_SOCKETS=1",
]
defines = [
"CHIP_HAVE_CONFIG_H=1",
"CHIP_SYSTEM_CONFIG_USE_SOCKETS=1",
]

frameworks += [
"CoreFoundation.framework",
"Foundation.framework",
"CoreBluetooth.framework",
"Network.framework",
]
frameworks += [
"CoreFoundation.framework",
"Foundation.framework",
"CoreBluetooth.framework",
"Network.framework",
]

# Other SDKs are linked statically to Matter.framework but the macosx SDK is linked dynamically but needs some symbols that are
# not exposed by the dylib.
if (sdk == "macosx") {
libs = [ "${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/lib/libCHIP.a" ]
}
# Other SDKs are linked statically to Matter.framework but the macosx SDK is linked dynamically but needs some symbols that are
# not exposed by the dylib.
if (sdk == "macosx") {
libs = [ "${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/lib/libCHIP.a" ]
}

if (enable_provisional_features) {
Expand Down
16 changes: 7 additions & 9 deletions examples/darwin-framework-tool/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ import("//build_overrides/chip.gni")

import("${chip_root}/config/standalone/args.gni")

import("${chip_root}/examples/chip-tool/chip-tool.gni")

chip_crypto = "boringssl"

if (config_enable_yaml_tests) {
chip_device_project_config_include = "<CHIPProjectAppConfig.h>"
chip_project_config_include = "<CHIPProjectAppConfig.h>"
chip_device_project_config_include =
"${chip_root}/examples/darwin-framework-tool/include/CHIPProjectAppConfig.h"
chip_project_config_include =
"${chip_root}/examples/darwin-framework-tool/include/CHIPProjectAppConfig.h"

chip_project_config_include_dirs =
[ "${chip_root}/examples/darwin-framework-tool/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
}
chip_project_config_include_dirs =
[ "${chip_root}/examples/darwin-framework-tool/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
2 changes: 0 additions & 2 deletions examples/darwin-framework-tool/main.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "commands/storage/Commands.h"

#include <zap-generated/cluster/Commands.h>
#include <zap-generated/test/Commands.h>

int main(int argc, const char * argv[])
{
Expand All @@ -47,7 +46,6 @@ int main(int argc, const char * argv[])
registerCommandsPayload(commands);
registerClusterOtaSoftwareUpdateProviderInteractive(commands);
registerCommandsStorage(commands);
registerCommandsTests(commands);
registerClusters(commands);
return commands.Run(argc, (char **) argv);
}
Expand Down
80 changes: 0 additions & 80 deletions examples/darwin-framework-tool/templates/tests/ciTests.json

This file was deleted.

63 changes: 0 additions & 63 deletions examples/darwin-framework-tool/templates/tests/commands.zapt

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4c4d8bf

Please sign in to comment.