Skip to content

Commit

Permalink
Use logging:stdio in preference to platform backend for tests and chi…
Browse files Browse the repository at this point in the history
…p-tool
  • Loading branch information
ksperling-apple committed Nov 22, 2022
1 parent 308b20d commit f6478c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
17 changes: 6 additions & 11 deletions build/chip/chip_test_suite.gni
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,16 @@ template("chip_test_suite") {
forward_variables_from(invoker, "*", [ "tests" ])

output_dir = "${root_out_dir}/lib"
public_deps = [] # invoker.public_deps will be appended below

if (!defined(invoker.public_deps)) {
public_deps = []
}

# TODO: figure out a way to auto-define dependency on stdio logging.
# This dep is required since libSupportLayer now does not include
# a default implementation.
#
# Tests such as TestInetEndPoint need to exercise the system event
# loop however they do not seem to include a logging binding so this
# is forcefully added here.
# Prepend a dependency on logging:stdio so it is used in preference to the normal platform logging backend
if (current_os != "zephyr" && current_os != "mbed") {
public_deps += [ "${chip_root}/src/platform/logging:stdio" ]
}

if (defined(invoker.public_deps)) {
public_deps += invoker.public_deps
}
}

if (chip_link_tests) {
Expand Down
4 changes: 3 additions & 1 deletion examples/chip-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ static_library("chip-tool-utils") {
executable("chip-tool") {
sources = [ "main.cpp" ]

deps = [ ":chip-tool-utils" ]
# Use stdio logging in preference to the platform backend
deps = [ "${chip_root}/src/platform/logging:stdio" ]
deps += [ ":chip-tool-utils" ]

output_dir = root_out_dir
}
Expand Down

0 comments on commit f6478c8

Please sign in to comment.