Skip to content

Commit

Permalink
Add Pigweed integration for esp32 (project-chip#32430)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlatusek authored Mar 5, 2024
1 parent f05f3f0 commit 92d87e8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
10 changes: 10 additions & 0 deletions config/esp32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/pigweed.gni")

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

pw_sys_io_BACKEND = dir_pw_sys_io_stdio
pw_assert_BACKEND = dir_pw_assert_log
pw_log_BACKEND = dir_pw_log_basic

pw_build_LINK_DEPS = [
"$dir_pw_assert:impl",
"$dir_pw_log:impl",
]

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ]
pw_build_PIP_REQUIREMENTS = [
Expand Down
5 changes: 4 additions & 1 deletion config/esp32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ group("esp32") {
}

if (chip_build_tests) {
deps += [ "${chip_root}/src:tests" ]
deps += [
"${chip_root}/src:tests",
"${chip_root}/src/lib/support:pw_tests_wrapper",
]
}
}
2 changes: 1 addition & 1 deletion src/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ if (chip_build_tests) {
if (chip_monolithic_tests) {
# TODO [PW_MIGRATION] Remove this if after migartion to PW_TEST is completed for all platforms
# TODO [PW_MIGRATION] There will be a list of already migrated platforms
if (false) {
if (chip_device_platform == "esp32") {
deps += [ "${chip_root}/src/lib/support:pw_tests_wrapper" ]
}
build_monolithic_library = true
Expand Down
2 changes: 1 addition & 1 deletion src/test_driver/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ target_compile_options(${COMPONENT_LIB} PUBLIC
)

target_link_directories(${COMPONENT_LIB} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../chip/lib)
target_link_libraries(${COMPONENT_LIB} PUBLIC -lSupportTesting)
target_link_libraries(${COMPONENT_LIB} PUBLIC -lSupportTesting -lPWTestsWrapper)
3 changes: 3 additions & 0 deletions src/test_driver/esp32/main/main_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <crypto/CHIPCryptoPAL.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/UnitTest.h>
#include <lib/support/UnitTestRegistration.h>
#include <platform/CHIPDeviceLayer.h>

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

0 comments on commit 92d87e8

Please sign in to comment.