mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
ci(size_metrics): add more size metrics apps
This commit is contained in:
@@ -55,6 +55,11 @@ tools/test_apps/size_metrics/minimal_baseline:
|
|||||||
configs:
|
configs:
|
||||||
- default
|
- default
|
||||||
|
|
||||||
|
tools/test_apps/size_metrics/wifi_ota:
|
||||||
|
libs: all
|
||||||
|
configs:
|
||||||
|
- default
|
||||||
|
|
||||||
components/esp_timer/test_apps/size_metrics:
|
components/esp_timer/test_apps/size_metrics:
|
||||||
libs: all
|
libs: all
|
||||||
configs:
|
configs:
|
||||||
|
|||||||
@@ -5,3 +5,8 @@ tools/test_apps/size_metrics/minimal_baseline:
|
|||||||
- if: IDF_TARGET == "linux"
|
- if: IDF_TARGET == "linux"
|
||||||
temporary: true
|
temporary: true
|
||||||
reason: Not a real hardware target
|
reason: Not a real hardware target
|
||||||
|
|
||||||
|
tools/test_apps/size_metrics/wifi_ota:
|
||||||
|
disable:
|
||||||
|
- if: SOC_WIFI_SUPPORTED != 1
|
||||||
|
reason: Wi-Fi is not supported
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# This is the project CMakeLists.txt file for the wifi_ota size metrics test app
|
||||||
|
cmake_minimum_required(VERSION 3.22)
|
||||||
|
|
||||||
|
list(PREPEND SDKCONFIG_DEFAULTS
|
||||||
|
"$ENV{IDF_PATH}/tools/test_apps/configs/sdkconfig.size_metrics"
|
||||||
|
"sdkconfig.defaults")
|
||||||
|
|
||||||
|
# "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(wifi_ota)
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-H21 | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 |
|
||||||
|
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | --------- | -------- | -------- | -------- | -------- | --------- |
|
||||||
|
|
||||||
|
# Wi-Fi OTA Size Metrics App
|
||||||
|
|
||||||
|
This build-only app tracks the size of a minimal application using Wi-Fi and
|
||||||
|
HTTPS OTA. It calls the production APIs so their implementations are retained
|
||||||
|
by the linker, but it is intentionally skipped by the target-test pipeline.
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
idf_component_register(SRCS "main.c"
|
||||||
|
PRIV_REQUIRES esp_event esp_https_ota esp_netif esp_wifi mbedtls nvs_flash)
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "esp_event.h"
|
||||||
|
#include "esp_https_ota.h"
|
||||||
|
#include "esp_netif.h"
|
||||||
|
#include "esp_wifi.h"
|
||||||
|
#include "nvs_flash.h"
|
||||||
|
|
||||||
|
void app_main(void)
|
||||||
|
{
|
||||||
|
ESP_ERROR_CHECK(nvs_flash_init());
|
||||||
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
|
esp_netif_create_default_wifi_sta();
|
||||||
|
|
||||||
|
wifi_init_config_t wifi_config = WIFI_INIT_CONFIG_DEFAULT();
|
||||||
|
ESP_ERROR_CHECK(esp_wifi_init(&wifi_config));
|
||||||
|
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
|
||||||
|
ESP_ERROR_CHECK(esp_wifi_start());
|
||||||
|
|
||||||
|
esp_http_client_config_t http_config = {
|
||||||
|
.url = "https://example.invalid/firmware.bin",
|
||||||
|
};
|
||||||
|
esp_https_ota_config_t ota_config = {
|
||||||
|
.http_config = &http_config,
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK(esp_https_ota(&ota_config));
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||||
|
import pytest
|
||||||
|
from pytest_embedded_idf.dut import IdfDut
|
||||||
|
from pytest_embedded_idf.utils import idf_parametrize
|
||||||
|
from pytest_embedded_idf.utils import soc_filtered_targets
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.generic
|
||||||
|
@pytest.mark.skip(reason='Build-only configuration used for size metrics')
|
||||||
|
@pytest.mark.parametrize('config', ['default'], indirect=True)
|
||||||
|
@idf_parametrize(
|
||||||
|
'target',
|
||||||
|
soc_filtered_targets('SOC_WIFI_SUPPORTED == 1', targets='supported_targets'),
|
||||||
|
indirect=['target'],
|
||||||
|
)
|
||||||
|
def test_wifi_ota_build_only(dut: IdfDut) -> None:
|
||||||
|
pass
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# App-specific defaults for the Wi-Fi OTA size metrics app
|
||||||
|
CONFIG_PARTITION_TABLE_TWO_OTA=y
|
||||||
|
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
||||||
Reference in New Issue
Block a user