-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ci/migrate_mbedtls_unit_test_app' into 'master'
ci: Migrate mbedtls unit tests from unit-test-app to component-test-app Closes IDF-5593 See merge request espressif/esp-idf!19783
- Loading branch information
Showing
54 changed files
with
211 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#This is the project CMakeLists.txt file for the test subproject | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(mbedtls_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-S2 | ESP32-S3 | | ||
| ----------------- | ----- | -------- | -------- | -------- | -------- | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
#include "freertos/FreeRTOS.h" | ||
#include "freertos/task.h" | ||
#include "unity.h" | ||
#include "memory_checks.h" | ||
|
||
/* setUp runs before every test */ | ||
void setUp(void) | ||
{ | ||
test_utils_record_free_mem(); | ||
test_utils_set_leak_level(CONFIG_UNITY_CRITICAL_LEAK_LEVEL_GENERAL, ESP_LEAK_TYPE_CRITICAL, ESP_COMP_LEAK_GENERAL); | ||
test_utils_set_leak_level(CONFIG_UNITY_WARN_LEAK_LEVEL_GENERAL, ESP_LEAK_TYPE_WARNING, ESP_COMP_LEAK_GENERAL); | ||
test_utils_set_leak_level(0, ESP_LEAK_TYPE_CRITICAL, ESP_COMP_LEAK_LWIP); | ||
} | ||
|
||
/* tearDown runs after every test */ | ||
void tearDown(void) | ||
{ | ||
/* some FreeRTOS stuff is cleaned up by idle task */ | ||
vTaskDelay(5); | ||
|
||
/* clean up some of the newlib's lazy allocations */ | ||
esp_reent_cleanup(); | ||
|
||
/* check if unit test has caused heap corruption in any heap */ | ||
TEST_ASSERT_MESSAGE( heap_caps_check_integrity(MALLOC_CAP_INVALID, true), "The test has corrupted the heap"); | ||
|
||
test_utils_finish_and_evaluate_leaks(test_utils_get_leak_level(ESP_LEAK_TYPE_WARNING, ESP_COMP_LEAK_ALL), | ||
test_utils_get_leak_level(ESP_LEAK_TYPE_CRITICAL, ESP_COMP_LEAK_ALL)); | ||
|
||
} | ||
|
||
static void test_task(void *pvParameters) | ||
{ | ||
vTaskDelay(2); /* Delay a bit to let the main task be deleted */ | ||
unity_run_menu(); | ||
} | ||
|
||
void app_main(void) | ||
{ | ||
xTaskCreatePinnedToCore(test_task, "testTask", CONFIG_UNITY_FREERTOS_STACK_SIZE, NULL, CONFIG_UNITY_FREERTOS_PRIORITY, NULL, CONFIG_UNITY_FREERTOS_CPU); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
components/mbedtls/test/test_aes.c → components/mbedtls/test_apps/main/test_aes.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
components/mbedtls/test/test_aes_perf.c → ...ts/mbedtls/test_apps/main/test_aes_perf.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...ents/mbedtls/test/test_apb_dport_access.c → ...ls/test_apps/main/test_apb_dport_access.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...ents/mbedtls/test/test_apb_dport_access.h → ...ls/test_apps/main/test_apb_dport_access.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
components/mbedtls/test/test_mbedtls.c → ...nts/mbedtls/test_apps/main/test_mbedtls.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
import pytest | ||
from pytest_embedded import Dut | ||
|
||
|
||
@pytest.mark.supported_targets | ||
@pytest.mark.generic | ||
def test_mbedtls(dut: Dut) -> None: | ||
dut.expect_exact('Press ENTER to see the list of tests') | ||
dut.write('*') | ||
dut.expect_unity_test_output(timeout=120) | ||
|
||
|
||
@pytest.mark.esp32 | ||
@pytest.mark.esp32s2 | ||
@pytest.mark.esp32s3 | ||
@pytest.mark.esp32c3 | ||
@pytest.mark.generic | ||
@pytest.mark.parametrize( | ||
'config', | ||
[ | ||
'aes_no_hw', | ||
], | ||
indirect=True, | ||
) | ||
def test_mbedtls_aes_no_hw(dut: Dut) -> None: | ||
dut.expect_exact('Press ENTER to see the list of tests') | ||
dut.write('*') | ||
dut.expect_unity_test_output(timeout=120) | ||
|
||
|
||
@pytest.mark.esp32 | ||
@pytest.mark.esp32s2 | ||
@pytest.mark.esp32s3 | ||
@pytest.mark.generic | ||
@pytest.mark.parametrize( | ||
'config', | ||
[ | ||
'psram', | ||
], | ||
indirect=True, | ||
) | ||
def test_mbedtls_psram(dut: Dut) -> None: | ||
dut.expect_exact('Press ENTER to see the list of tests') | ||
dut.write('*') | ||
dut.expect_unity_test_output(timeout=120) | ||
|
||
|
||
@pytest.mark.esp32 | ||
@pytest.mark.generic | ||
@pytest.mark.parametrize( | ||
'config', | ||
[ | ||
'psram_esp32', | ||
'psram_all_ext', | ||
], | ||
indirect=True, | ||
) | ||
def test_mbedtls_psram_esp32(dut: Dut) -> None: | ||
dut.expect_exact('Press ENTER to see the list of tests') | ||
dut.write('*') | ||
dut.expect_unity_test_output(timeout=120) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONFIG_MBEDTLS_HARDWARE_AES=n | ||
CONFIG_MBEDTLS_MPI_USE_INTERRUPT=n |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_SPIRAM=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CONFIG_SPIRAM=y | ||
CONFIG_ESP_INT_WDT_TIMEOUT_MS=800 | ||
CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y | ||
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_SPIRAM=y | ||
CONFIG_ESP_INT_WDT_TIMEOUT_MS=800 | ||
CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# General options for additional checks | ||
CONFIG_HEAP_POISONING_COMPREHENSIVE=y | ||
CONFIG_COMPILER_WARN_WRITE_STRINGS=y | ||
CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y | ||
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y | ||
CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y | ||
CONFIG_COMPILER_STACK_CHECK=y | ||
|
||
CONFIG_ESP_TASK_WDT=n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y | ||
CONFIG_XTAL_FREQ_AUTO=y | ||
CONFIG_SPI_FLASH_SHARE_SPI1_BUS=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n | ||
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y | ||
CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y | ||
CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.