Skip to content

Commit 92d87e8

Browse files
authored
Add Pigweed integration for esp32 (project-chip#32430)
1 parent f05f3f0 commit 92d87e8

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed

config/esp32/.gn

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/build.gni")
16+
import("//build_overrides/pigweed.gni")
1617

1718
# The location of the build configuration file.
1819
buildconfig = "${build_root}/config/BUILDCONFIG.gn"
@@ -24,6 +25,15 @@ default_args = {
2425
target_cpu = "esp32"
2526
target_os = "freertos"
2627

28+
pw_sys_io_BACKEND = dir_pw_sys_io_stdio
29+
pw_assert_BACKEND = dir_pw_assert_log
30+
pw_log_BACKEND = dir_pw_log_basic
31+
32+
pw_build_LINK_DEPS = [
33+
"$dir_pw_assert:impl",
34+
"$dir_pw_log:impl",
35+
]
36+
2737
pw_build_PIP_CONSTRAINTS =
2838
[ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ]
2939
pw_build_PIP_REQUIREMENTS = [

config/esp32/BUILD.gn

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ group("esp32") {
3636
}
3737

3838
if (chip_build_tests) {
39-
deps += [ "${chip_root}/src:tests" ]
39+
deps += [
40+
"${chip_root}/src:tests",
41+
"${chip_root}/src/lib/support:pw_tests_wrapper",
42+
]
4043
}
4144
}

src/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ if (chip_build_tests) {
143143
if (chip_monolithic_tests) {
144144
# TODO [PW_MIGRATION] Remove this if after migartion to PW_TEST is completed for all platforms
145145
# TODO [PW_MIGRATION] There will be a list of already migrated platforms
146-
if (false) {
146+
if (chip_device_platform == "esp32") {
147147
deps += [ "${chip_root}/src/lib/support:pw_tests_wrapper" ]
148148
}
149149
build_monolithic_library = true

src/test_driver/esp32/main/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ target_compile_options(${COMPONENT_LIB} PUBLIC
4545
)
4646

4747
target_link_directories(${COMPONENT_LIB} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../chip/lib)
48-
target_link_libraries(${COMPONENT_LIB} PUBLIC -lSupportTesting)
48+
target_link_libraries(${COMPONENT_LIB} PUBLIC -lSupportTesting -lPWTestsWrapper)

src/test_driver/esp32/main/main_app.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include <crypto/CHIPCryptoPAL.h>
3232
#include <lib/core/ErrorStr.h>
33+
#include <lib/support/UnitTest.h>
3334
#include <lib/support/UnitTestRegistration.h>
3435
#include <platform/CHIPDeviceLayer.h>
3536

@@ -41,7 +42,9 @@ const char TAG[] = "CHIP-tests";
4142
static void tester_task(void * pvParameters)
4243
{
4344
ESP_LOGI(TAG, "Starting CHIP tests!");
45+
// TODO [PW_MIGRATION] Remove NLUnit tests call after migration
4446
int status = RunRegisteredUnitTests();
47+
status += chip::test::RunAllTests();
4548
ESP_LOGI(TAG, "CHIP test status: %d", status);
4649
exit(status);
4750
}

0 commit comments

Comments
 (0)