chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:04:25 +08:00
commit 548b49ebc0
20937 changed files with 5455372 additions and 0 deletions
@@ -0,0 +1,6 @@
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
components/esp_bootloader_format/test_apps:
disable:
- if: IDF_TARGET != "esp32"
reason: It is enough to test it only for one target
@@ -0,0 +1,8 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.22)
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(esp_bootloader_format_test)
@@ -0,0 +1,2 @@
| Supported Targets | ESP32 |
| ----------------- | ----- |
@@ -0,0 +1,3 @@
idf_component_register(SRCS "test_bootloader_desc.c"
PRIV_INCLUDE_DIRS .
PRIV_REQUIRES esp_bootloader_format app_update unity)
@@ -0,0 +1,45 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
#include <string.h>
#include "esp_ota_ops.h"
#include "esp_bootloader_desc.h"
#include "unity.h"
#include "unity_fixture.h"
#include "unity_internals.h"
TEST_GROUP(esp_bootloader_format);
TEST_SETUP(esp_bootloader_format)
{
}
TEST_TEAR_DOWN(esp_bootloader_format)
{
}
TEST(esp_bootloader_format, esp_ota_get_bootloader_description)
{
esp_bootloader_desc_t desc;
printf("\n");
TEST_ESP_OK(esp_ota_get_bootloader_description(NULL, &desc));
TEST_ASSERT_EQUAL(desc.magic_byte, ESP_BOOTLOADER_DESC_MAGIC_BYTE);
TEST_ASSERT_EQUAL(desc.version, CONFIG_BOOTLOADER_PROJECT_VER);
printf("\tESP-IDF version from 2nd stage bootloader: %s\n", desc.idf_ver);
printf("\tESP-IDF version from app: %s\n", IDF_VER);
TEST_ASSERT_EQUAL(0, memcmp(desc.idf_ver, IDF_VER, sizeof(IDF_VER)));
}
TEST_GROUP_RUNNER(esp_bootloader_format)
{
RUN_TEST_CASE(esp_bootloader_format, esp_ota_get_bootloader_description)
}
void app_main(void)
{
UNITY_MAIN(esp_bootloader_format);
}
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
from pytest_embedded_idf.utils import idf_parametrize
@pytest.mark.generic
@idf_parametrize('target', ['esp32'], indirect=['target'])
def test_esp_bootloader_format(dut: Dut) -> None:
dut.expect_unity_test_output()
@@ -0,0 +1,10 @@
# General options for additional checks
CONFIG_HEAP_POISONING_COMPREHENSIVE=y
CONFIG_COMPILER_WARN_WRITE_STRINGS=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y
CONFIG_COMPILER_STACK_CHECK=y
# Enable Unity fixture support
CONFIG_UNITY_ENABLE_FIXTURE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=n