Skip to content

Commit 2ef3a36

Browse files
jlatusekarkq
andauthored
Add missing logging handler for embedded platforms for testing with Pigweed (#33105)
* Add missing logging handler for embedded platforms * Update src/lib/support/UnitTest.cpp Co-authored-by: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com> --------- Co-authored-by: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
1 parent 9ca1f59 commit 2ef3a36

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/lib/support/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ pw_static_library("pw_tests_wrapper") {
350350
public_deps = [
351351
"$dir_pw_log:impl",
352352
"$dir_pw_unit_test",
353+
"$dir_pw_unit_test:logging",
353354
]
354355
sources = [
355356
"UnitTest.cpp",

src/lib/support/UnitTest.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#include "UnitTest.h"
22

33
#include "pw_unit_test/framework.h"
4+
#include "pw_unit_test/logging_event_handler.h"
45

56
namespace chip {
67
namespace test {
78

89
int RunAllTests()
910
{
11+
testing::InitGoogleTest(nullptr, static_cast<char **>(nullptr));
12+
pw::unit_test::LoggingEventHandler handler;
13+
pw::unit_test::RegisterEventHandler(&handler);
1014
return RUN_ALL_TESTS();
1115
}
1216

0 commit comments

Comments
 (0)