Skip to content

Commit

Permalink
Add missing logging handler for embedded platforms for testing with P…
Browse files Browse the repository at this point in the history
…igweed (#33105)

* Add missing logging handler for embedded platforms

* Update src/lib/support/UnitTest.cpp

Co-authored-by: Arkadiusz Bokowy <[email protected]>

---------

Co-authored-by: Arkadiusz Bokowy <[email protected]>
  • Loading branch information
jlatusek and arkq authored Apr 23, 2024
1 parent 9ca1f59 commit 2ef3a36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/support/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ pw_static_library("pw_tests_wrapper") {
public_deps = [
"$dir_pw_log:impl",
"$dir_pw_unit_test",
"$dir_pw_unit_test:logging",
]
sources = [
"UnitTest.cpp",
Expand Down
4 changes: 4 additions & 0 deletions src/lib/support/UnitTest.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#include "UnitTest.h"

#include "pw_unit_test/framework.h"
#include "pw_unit_test/logging_event_handler.h"

namespace chip {
namespace test {

int RunAllTests()
{
testing::InitGoogleTest(nullptr, static_cast<char **>(nullptr));
pw::unit_test::LoggingEventHandler handler;
pw::unit_test::RegisterEventHandler(&handler);
return RUN_ALL_TESTS();
}

Expand Down

0 comments on commit 2ef3a36

Please sign in to comment.